Questions tagged [number]
A competition to solve a particular problem through the usage and manipulation of numbers.
1,317
questions
3
votes
2
answers
179
views
Non-Decreasing Fibonacci Sequence modulo M
Given integers \$a,b,m, k, n\$ and array \$F = (f_1, f_2,...,f_n)\$ defined as:
\begin{cases}
f_1 = \text{a}\\
f_2 = \text{b}\\
f_i = (f_{i-1} + f_{i-2}) \text{ mod m},∀i > 2
\end{cases}
When \$F\$ ...
6
votes
4
answers
1k
views
Hoop, Hoop, Hoop, Hoop, Eye-Eye-Eye-Eye
The Horrible Histories song "Learn Your Hieroglyphics" mentions a fanmade number system. Numbers are written as a sum of 10's ("hoops") and 1's ("eyes"), for example 99 ...
11
votes
23
answers
922
views
Construct a uInt from an array of bits
Task is simple!
Take an array of binary values (can be boolean, 0/1, etc.) and use those bits to construct an n-th bit long unsigned integer (return type does not need to be an unsigned integer, just ...
16
votes
19
answers
1k
views
Infer pluses and minuses
The problem
Consider an equation such as "3 ± 2 ± 4 ± 1 = 4" and determine if there exists a sequence of pluses and minuses that makes it arithmetically correct. If it exists, ...
15
votes
16
answers
1k
views
Pretty Palintiples
Imagine you have a positive integer number \$n\$. Let \$m\$ be the number obtained by reversing \$n\$'s digits. If \$m\$ is a whole multiple of \$n\$, then \$n\$ is said to be a reverse divisible ...
7
votes
7
answers
468
views
Floating point numbers... dar nu-mă, nu-mă iei!
When you leave, my challenges fade to grey, 0A0AE16, 0A0A0AE16...
A while ago, I made this programming language (https://esolangs.org/wiki/Dragostea_din_tei) which uses an interesting number system. ...
6
votes
2
answers
356
views
Compact Binary Representation
Background
Often, when storing a number in binary with some maximum, we simply round the maximum to the next power of two then allocate the number of bits nececairy to store the whole range. Lets call ...
-2
votes
8
answers
1k
views
Number of cigarettes that can be made from a given number of butts
Assumption
A cigarette can be made by combining four cigarette butts. Cigarette butts last infinitely until smoked.
Explanation
Say you have 31 butts. That means, you can make 7 cigarettes from 28 ...
12
votes
7
answers
1k
views
Horsey sightseeing
A knight's tour is a sequence of moves of a knight on a chessboard such that the knight visits every square only once. For those who are not aware of how knights in chess work, knights are capable of ...
13
votes
20
answers
2k
views
Complete a Mystery Sequence
Given a sequence of three integers, determine if the sequence is arithmetic (of the form [a, a+d, a+2*d]) or geometric (of the form ...
7
votes
10
answers
969
views
Make 1's and 2's composite
Input
An integer k composed of 1 and 2, with at least 3 digits and at most 200 digits.
...
17
votes
21
answers
2k
views
Divmod continuously until the remainder is 1 or 0, then get the remainder
The task is simple, divide, get the quotient and the remainder, and if the remainder isn't 1 or 0, do the same thing (quotient divmod remainder) until the remainder is 1 or 0, then get the remainder. ...
0
votes
9
answers
582
views
Can you decrypt me? (Robbers)
Can you decrypt me?
Robbers
Find any combination of \$n\$ working chars to change and what they should change into, where \$n\$ is chosen by the cop. You cannot change less than n chars, only exactly \...
2
votes
9
answers
608
views
Can you decrypt me? (Cops)
Can you decrypt me?
Cops
Cops, post obfuscated code that hides a number \$n\$ (n must not be greater than the program length) inside its code. If \$n\$ chars are changed (no additions or deletions), ...
24
votes
15
answers
3k
views
"Perfect" an array
Given an n non-negative integers, how many numbers must be changed so that each number x appears x times? You cannot add or remove elements, only replace them with other numbers.
For example:
...