All Questions
1,223
questions
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. ...
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:
...
10
votes
6
answers
945
views
Unnecessary Fluff
Following the great advice (what do you mean it's not advice?!) on Adding unnecessary fluff we can devise the following task:
Take a list of positive integers and a positive integer \$m\$ as input.
...
19
votes
31
answers
2k
views
Is this number tetrahedral?
Happy New Year 2024!
2024 is a tetrahedral number. A tetrahedral number is a number that can be represented in the form \$n(n+1)(n+2)/6\$ for some positive integer \$n\$. Or, equivalently, they are ...
8
votes
7
answers
854
views
Bloons TD 6 Ordered Upgrade Paths
Background
The monkeys need your help again organizing their defense and have asked you, Benjamin the code monkey, to create a program that will list all tower upgrade options as they appear in your ...