The 2024 Developer Survey results are live! See the results

# Questions tagged [number]

A competition to solve a particular problem through the usage and manipulation of numbers.

1,319 questions
Filter by
Sorted by
Tagged with
318 views

### Cubic Concatenation

Challenge Given three non-negative integers $a, b$ and $c$, decide if the sum of their cubes is equal to the concatenation of those numbers, aka: $$a^{3}+b^{3}+c^{3} = a^\frown b ^\frown c$$ ...
• 329
669 views

• 6,219
200 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$ ...
• 123
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 ...
• 1,401
930 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 ...
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, ...
• 3,694
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 ...
• 487
472 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. ...
• 1,401
358 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 ...
• 12.9k
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 ...
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 ...
• 17.2k
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 ...
• 383
972 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. ...
• 439
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. ...
• 4,177
586 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 \...
• 4,203
611 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), ...
• 4,203
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: ...
• 4,203
950 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. ...
• 10.6k
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 ...
• 49k
859 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 ...
• 12.2k
1k views

### Name the Dutch ancestor

The Dutch system for naming one's ancestors is a lot more interesting than the English version. For English, the sequence goes "parent", "grandparent", "great-grandparent"...
• 1,373
746 views

### Convert from Spoken Binary

This is an exact inverse of the question Convert to Spoken Binary. This introduction is copied from there. Introduction In the video the best way to count, binary is proposed as the best system of ...
• 2,093
1k views

### Convert to Spoken Binary

Introduction In the video the best way to count, binary is proposed as the best system of counting numbers. Along with this argument is a proposal on how to say numbers in this system. First, we give ...
• 2,093
630 views

### Print 100 digits of Champernowne's Constant

Inspired by this and this question Challenge Your challenge is to print any 100 consecutive digits of Champernowne's Constant. You must give the index at which that subsequence appears. The 0 at the ...
• 421
908 views

### How Many Paint Tins Do I Need?

Task Take in 3 inputs. The length of the wall, the height of the wall and the coverage of the paint. Output how many tins of paint are required. Output Since there's no way to purchase ...
• 579
231 views

### Convert real numbers between factoradic and positive integer bases

This prompt asked you to convert back and forth to factoradic, but is very limited in scope (only decimal integers from 0 to 10!-1). Your task in this challenge is to reach just a bit further and ...
• 1,063
4k views

### German pharmacy payment

Your task is to calculate the amount you have to pay for prescribed medication at a pharmacy in Germany. The amount is simply based on the full price of the item, which will be your input. It is a ...
• 5,672
270 views

### It's Just Simple Math! [duplicate]

Task Your boss is on another crusade for 'efficiency.' He wants to encourage the use of numbers with fewer syllables, so that they're easier to discuss in meetings. If you want to take some time off ...
• 579
2k views

### Diagonal Binary Sequence

Challenge: Given a positive number $n$, convert it to binary, and output a sequence where all 1s form a top-left to bottom-right diagonal line, including a ...
• 129k
786 views

### Calculate NDos-size of given integer

Objective Given a nonnegative integer, calculate its NDos-size as defined below, and output it. NDos' numeral system The concept of NDos-size comes from the numeral system I made. It represents every ...
• 6,219
978 views

### Convert a non-negative integer to Barbrack

Barbrack Your task is to write a program or function that takes a non-negative integer (in decimal or any other convenient base for your language), and output a number in the numbering system Barbrack....
• 335
3k views

### Funny Numbers :D

The task is to calculate the average "funniness" of a given number given the following scoring system: 1 point for each "420" in it 2 points for each "69" in it 3 points ...
• 115
1k views

### Find the longest permutations of integers from 1..k such that all neighbouring pairs sum to a square

OEIS A090461 details the ‘numbers k for which there exists a permutation of the numbers 1 to k such that the sum of adjacent numbers is a square’. This has also been the subject of Matt Parker’s ...
• 21.1k
2k views

### Keep jumping till a cycle

Objective You're on a nonempty list of integers that wraps around. You start at the leftmost entry of the list, and keep jumping to the right to the amount of the integer entry you're at. Eventually, ...
• 6,219
4k views

### American odds to probabilities

American odds (aka moneyline odds) are numbers like $+150$ or $-400$ used to express how much a winning bet would pay out. Convert odds to a fair win probability like this: Positive odds $+n$ ...
• 146k
4k views

### Add two really big numbers

Preamble We've already proven we're good at adding two numbers, but many solutions only operate on tiny numbers like 2³²-1, honestly we can do a lot better. The Challenge Given two unsigned, non-...
• 10.9k
3k views

### Half even rounding

The round function in Python 3 will round values of the form $k+\frac{1}{2}$ (with $k$ being an integer) to the nearest even integer, which is apparently better ...
• 6,035
1k views

### Print a meter of numbers to a specified limit

Given a positive integer n, output a number meter formatted like this: ...
• 169
842 views

### Output the smallest increasing sequence where each term is coprime to preceding 3 terms

This sequence is defined as Starts with 1, 2, 3 The next element of the sequence is the first number greater than the previous three that is co-prime with each of the previous 3 elements in the ...
• 12.9k