# Questions tagged [number]

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

1,312 questions
Filter by
Sorted by
Tagged with
478 views

Write the shortest program or function that mimics the addition in this XKCD strip: Input Two positive decimal integers containing only the digits 150. Output The ...
• 9,208
6k views

### Doing a little trolling with the microwave timer

Related Sometimes when I use my microwave, I do a little trolling and enter times such as 2:90 instead of 3:30 because they end ...
• 32.9k
3k views

### How far from binary?

Given a decimal integer n as input, output the smallest (in terms of absolute value) decimal integer m such that the absolute ...
• 38.5k
1k views

### Extract the contained powers of two!

Take as input an integer in any reasonable format. Then, output all the proper sub-strings of the base-10 digits of that integer that are powers of two, in any reasonable format. Test cases ...
• 1,623
5k views

### Previous Fibonacci number

The sequence of Fibonacci numbers is defined as follows: $F_0 = 0 \\ F_1 = 1 \\ F_n = F_{n-1} + F_{n-2}$ Given a Fibonacci number, return the previous Fibonacci number in the sequence. You do not ...
• 23.5k
2k views

### There's more than one way to skin a set

Given a set of positive integers $S$, output the set of all positive integers $n$ such that $n$ can be made by summing a subset of $S$ in more than one different way, i.e., that are ...
• 23.5k
2k views

### Palindromic Powers

Powers We define an important power as a number that can be represented as $x^y$ where $x ≥ 2$ and $y ≥ 2$. Palindrome We define an ...
• 1,538
3k views

### ASCII-Art n'th Root

Challenge: Given two integers $a$ and $b$, with lengths $A=length(a), B=length(b)$, output an ASCII-art of the $a^{th}$ root of $b$, including the answer rounded to $A$ amount of decimal ...
• 125k
693 views

### Rounding a range

You have a line with two endpoints a and b (0 ≤ a < b) on a 1D space. When ...
• 2,355
992 views

### Sequence of integers not the sum of powers of earlier terms

Starting with 1, output the sequence of integers which cannot be represented as the sum of powers of earlier terms. Each previous term can be used at most once, and the exponents must be non-negative ...
• 420
1k views

### Words with Easy Letters in a Word Search

Introduction: Apparently I keep coming up with word search related challenges lately. :) When I do the word search in the Dutch news paper, some words are very easy to find because they contain ...
• 125k
1k views

### Average-ignorant sets of integers

Recently a friend of mine posed the following: What subset of the integers satisfies the condition if distinct a and b are in the subset, their average is not in the subset? I know the set of non-0 ...
• 515
3k views

### Find the weight of five apples

Problem John bought 5 apples. You are given the weights of every group of four apples, and must then find the weights of the apples themselves. For example, if all apples without the first one weigh ...
• 209
3k views

### Numbers in 2050

It's 2050, and people have decided to write numbers in a new way. They want less to memorize, and number to be able to be written quicker. For every place value(ones, tens, hundreds, etc.) the number ...
• 303
545 views

### Batt to the Basics

One of your acquaintances has a hobby of making make-shift electrical gadgets using various types of batteries. However, since they're thrifty, they want to use as few batteries as possible for their ...
1k views

### The interstice of two binary numbers

Given two integers, compute the two numbers that come from the blending the bits of the binary numbers of equal length(same number of digits, a number with less digits has zeros added), one after the ...
• 420
2k views

### How many times do I break my own rule?

Introduction: In my recent Strikethrough the Word Search List challenge I mentioned the following: When I do the word-search puzzles, I (almost) always go over the words in order, and strike them ...
• 125k
1k views

### int, float or neither?

Given a string, determine if it is an int, a float or neither. Examples 123 - int 62727.0033 - float 644c.33 - neither Your code should output a different value depending on which it is. For example ...
1k views

### Pairs of integers ordered by their exponentiation

Output the infinite list of pairs of integers (a, b), where both $a > 1$ and $b > 1$, ordered by the value of $a^b$. When there are multiple pairs ...
• 23.5k
2k views

### Fill in the next numbers

Given a list of integers, output a list where the $i$th element of the list equals the first number in the input list which is $\ge i$, until there are no such numbers. For example, if the ...
• 23.5k
1k views

### Lexicographically Smallest Decreasing Integer Partition

For a given number n, output an strictly decreasing array whose sum is n and its lexicographical order is the smallest for any ...
• 5,049
667 views

### Factorials of primes decomposition

You have to decompose a positive integer/fraction as a product of powers of factorials of prime numbers. For example ...
• 5,049
2k views

### Output two numbers (Robbers' thread)

This is the robbers' thread to a cops-and-robbers challenge. Click the link to find the cops' thread. In the cops' thread of this challenge, answerers will be writing programs which output two ...
• 97.7k
2k views

### Output two numbers (Cops' thread)

This is the cops' thread to a cops-and-robbers challenge. Click the link to find the robbers' thread. The challenge here is very simple. Create two programs of the same size, in the same language, ...
• 97.7k
1k views

### Reversed Multiple Pair

Intro Two numbers are a reversed multiple pair if they satisfy the following property: $$a\cdot b = \operatorname{reversed}( (a-1)\cdot b )$$ Here, $\operatorname{reversed}()$ means to reverse the ...
• 4,083
1k views

### Move to Right and left

Task Your task is to take an array of numbers as input, and produce a new one where each number has been shifted both right and left, leaving 0s if no number fills ...
• 3,831
204 views

### Represent any integer with an expression that uses no digit besides '4' [closed]

Fourward (Introduction) I have an unhealthy obsession with the number 4. I love it so much, in fact, that seeing any other digit is frustrating to me. I therefour wish to create a 'Fourier ...
• 169
156 views

### Indices of square numbers that are also pentagonal [closed]

First 15 numbers of the A046173: ...
• 5,049
2k views

### Next Greater Number

Given an integer n, find the next number that follows the following requirements: The next greater number is a number where each digit, from left to right, is ...
• 5,049
1k views

### Number of complete rhyme schemes

A rhyme scheme is the pattern of rhymes at the end of the lines in a poem. They are typically represented using letters, like ABAB. We consider two rhyme schemes ...
• 23.5k
782 views

### Largest SKI output in less than 200 combinators

The Challenge Create an terminating expression in SKI Combinator Calculus in less than 200 combinators (S, K, I) that reduces to the expression with the most combinators. There will be no limit on how ...
• 743
835 views

### Minimum difference between cartesian product of 3 elements that add up to a certain number

Let's say I've got a list (or array) of: l = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] I want to get the third Cartesian power of the above list, where we take every ...
• 2,001
1k views

### Kolmogorov-simple numbers

If you visit Code Golf often, you may have heard of Kolmogorov complexity. It's usually defined as the amount of bytes required to express some string in a programming language. Here the Kolmogorov-...
• 7,848
1k views

### Nth FizzBuzz Number

Introduction Everyone knows the FizzBuzz sequence. It goes something like this: 1 2 Fizz 4 Buzz Fizz 7 8 Fizz Buzz 11 Fizz 13 14 FizzBuzz . . . In case you don't ...
• 4,083