Questions tagged [number]
A competition to solve a particular problem through the usage and manipulation of numbers.
1,300
questions
21
votes
9
answers
2k
views
What's my lucky factor?
Lucky numbers (A000959) are numbers generated by applying the following sieve:
Begin with the list of natural numbers:
...
11
votes
21
answers
3k
views
Exciting Mario Kart Grand Prix - Minimize the point difference!
Introduction
When playing Mario Kart the other day, an interesting question popped up when a Grand Prix with my 2 roommates, 9 AI drivers and myself seemed to be fairly close and therefore exciting ...
8
votes
17
answers
1k
views
Base-ically god
Story
The god of base is opening heaven’s gate for mortals to join the base party. You, as one of the believers, want to follow their steps to ascend to heaven.
But not everyone can get in.
The god ...
15
votes
21
answers
2k
views
Do I need a win streak?
You have played \$N\$ matches in some game where each match can only result in one of the two outcomes: win or loss. Currently, you have \$W\$ wins. You want to have a win percentage of \$P\$ or more, ...
21
votes
6
answers
1k
views
You are kinda Replacable to Me
You are provided with a non-empty array \$A\$ of integers, all greater than 0. But what good is an array if the elements do not sum up to the number \$N\$ (also provided as input)...
So to change that,...
1
vote
4
answers
218
views
A problem of rarity [closed]
Given a positive input \$n > 0\$, output the amout of two types based on their rarity. The two types are called \$A\$ and \$B\$, we know the followings:
\$n\$ is a limited input and the maximum is ...
22
votes
20
answers
2k
views
Code the Levine sequence
Introduction
Note that I learned it from a Numberphile Video, where Neil Sloane explains it better. I recommend you to watch his Video. But for a quick Introduction:
The Levine Sequence is made from ...
27
votes
31
answers
4k
views
Count all possible Tweets
Challenge
This challenge is pretty simple: Output the total number of possible Tweets. Given the fact that \$1{,}114{,}112\$ Unicode characters exist, and Tweets can be up to \$280\$ characters long, ...
28
votes
12
answers
1k
views
Unique half rainbows
If we take a positive integer \$n\$ and write out its factors. Someone can determine \$n\$ just from this list alone. In fact it is trivial to do this since the number is its own largest factor.
...
19
votes
16
answers
2k
views
Self-Replicating Numbers
Background
For the purpose of this challenge, all numbers and their string representations are assumed to be in decimal (base 10). I tried to find proper terminology for this challenge, but I do not ...
17
votes
32
answers
2k
views
Largest power of 2 that divides \$n\$
Related, related
Introduction
The ruler sequence is the sequence of the largest possible numbers \$a_n\$ such that \$2^{a_n}\mid n\$. It is so-called because its pin plot looks similar to a ruler's ...
16
votes
17
answers
1k
views
Liars and Guessers
Github
You have probably played, and may even have written a program to play, a simple number guessing game. If so, this probably looks familiar:
...
-3
votes
8
answers
993
views
Let's rise higher [closed]
Challenge
The main objective of the challenge is pretty simple, this is an answer chaining contest, where you have to serially print numbers from 1. That means User 1's answer will print ...
30
votes
24
answers
2k
views
First sequence with no square differences
Consider the sequence \$(a_n)\$ defined in the following way.
\$a_0=0\$
For all \$n=1, 2, 3, \dots\$, define \$a_n\$ to be the smallest positive integer such that \$a_n-a_i\$ is not a square number, ...
26
votes
36
answers
2k
views
Remove excessive occurrences
Given an array \$A\$ of positive integers between \$1\$ and \$9\$ inclusive and a positive integer \$n\$, remove all integers in \$A\$ which appear more than \$n\$ times.
For example:
...
66
votes
170
answers
16k
views
Print 0 to 100 without 1-9 characters
Print integers 0 to 100 (inclusive) without using characters 123456789 in your code.
Separator of numbers can be comma or white space (by default <blank>, <...
15
votes
6
answers
838
views
Golf this Thumb-2 Constant!
One thing that is constantly frustrating when golfing ARM Thumb-2 code is generating constants.
Since Thumb only has 16-bit and 32-bit instructions, it is impossible to encode every immediate 32-bit ...
47
votes
24
answers
5k
views
Ginormous number
Output this 1364-digit base-10 number:
...
16
votes
8
answers
769
views
Close(st) Binary Boxes
Challenge:
Given a list of non-negative integers, determine by how much you should increase each item to create the closest binary box with the resulting integer-list.
What is a binary box?
A binary ...
19
votes
24
answers
1k
views
Get the length of a Sumac Sequence
Heavily based on this closed challenge.
Codidact post, Sandbox
Description
A Sumac sequence starts with two non-zero integers \$t_1\$ and \$t_2.\$
The next term, \$t_3 = t_1 - t_2\$
More generally, \$...
15
votes
14
answers
1k
views
Split a number in every way possible way within a threshold
Task
Given a positive integer number and a threshold, split into every possible way without generating any numbers above the threshold.
Examples
Input: 15008
Threshold: 400
Valid Output:
...
4
votes
5
answers
357
views
Strobogrammatic Numbers [duplicate]
Strobogrammatic Numbers
Definition
A number which is rotationally symmetrical, i.e., it'll appear the same when rotated by 180 deg in the plane of your screen. The following figure illustrates it ...
22
votes
25
answers
1k
views
Possible binaries sum
This challenge is inspired by the AoC 2020, Day 14 - Part II, created by Eric Wastl and his team, which asks to output the possible binary values from a bitmask.
Let's say we've a bitmask like ...
23
votes
3
answers
727
views
Towering Cistercian representation
SE Sandbox Link, Codidact Sandbox Link
Inspired by this video.
Given a positive integer, draw its Cistercian representation as ascii art.
The Challenge
Cistercian numerals are a decimal-based number ...
26
votes
17
answers
3k
views
Convert negadecimal to decimal (and back)
Negadecimal, also known as base -10, is a non-standard positional numeral system.
Take the number \$1337_{10}\$. In decimal, this has the value one thousand three hundred thirty seven, and can be ...
12
votes
7
answers
3k
views
Fastest square root of an arbitrary size
We do seem to have a fastest square root challenge, but it's very restrictive. In this challenge, your program (or function) will be given an arbitrarily sized nonnegative integer, which is the square ...
20
votes
34
answers
3k
views
Make a minimal and maximal 2-digit number from digits of two 3-digit numbers
Let's solve this user's homework; I think it's an interesting exercise!
Input
Two 3-digit natural numbers.
Outputs
Two 2-digit numbers. In each of the output numbers, one digit is taken from one input ...
11
votes
14
answers
892
views
Prefix divisibility
Inspiration
Given a positive integer \$1 \le n \le 9\$, output all positive \$n\$-digit integers \$i\$ for which the following is true:
Each digit from \$1\$ to \$n\$ appears exactly once in \$i\$. ...
-1
votes
1
answer
221
views
Square root of a base 10 positive integer, digit by digit [closed]
It is possible (Wikipedia reference) to compute the square root of any number in a digit by digit fashion using a simple (I had learned it in primary school) algorithm.
Challenge:
read a positive ...
10
votes
14
answers
652
views
Golf a bijection \$\mathbb{N}^n\to\mathbb{N}\$
Your task is to write a program which implements a bijection \$\mathbb{N}^n\to\mathbb{N}\$ for \$n \ge 1\$. Your program should take \$n\$ natural numbers as input, in any acceptable method (including ...
23
votes
9
answers
1k
views
Count the Collatz survivors mod 2^n
Introduction
We have 22 Collatz conjecture-related challenges as of October 2020, but none of which cares about the restrictions on counter-examples, if any exists, to the conjecture.
Considering a ...
14
votes
9
answers
2k
views
We're much closer than you think
Martin Ender's 2D programming language Alice has two different modes depending on what orientation the IP has: orthogonal (Cardinal mode) or diagonal (Ordinal mode). Commands in Alice change their ...
22
votes
18
answers
2k
views
Eating Persistence
Intro
Find the result of number cannibalism.
Why was 6 scared of 7? Becase 7 8 9.
Your program will have to find the result of applying the ...
19
votes
16
answers
2k
views
Size up a number
Intro
Given a whole number \$< 100,\$ extend/shorten the english representation of the number to have as many characters as it's value.
Sandbox
Rules
Take the number \$n\$, and get it in words ...
11
votes
1
answer
434
views
Amount Of Potential Keys That'll Fit The Lock
Introduction:
You're a key maker, and want to access something from a safe that has a lock. Unfortunately, the key to that lock is lost, so you'll have to make a new one. You have access to a bunch of ...
20
votes
14
answers
1k
views
sporeball numbers
Background
We've studied at least five different types of numbers based on the IDs of different users on this site. Why not study another?
My user ID is \$91030_{10}\$. Its binary representation is \$...
13
votes
13
answers
2k
views
Diophantine Approximation: find lowest possible denominator to approximate within given precision
Challenge
Given a number x and a precision e, find the lowest positive integer q such that <...
17
votes
12
answers
3k
views
Implement the Polygamma function
The Polygamma function of order \$m\$, \$\psi^{(m)}(z)\$, is the \$(m + 1)\$th derivative of the logarithm of the gamma function, which is also the \$m\$th derivative of the digamma function. Your ...
-7
votes
13
answers
760
views
Number chopping: Split a number into its digits [closed]
Number Splitting
Instructions
Oh no, my numbers have stuck together! Luckily, we can split them apart with code.
Your code should be a function that takes an integer input from stdin or as an argument....
35
votes
44
answers
4k
views
Rotate a number
Given a positive number n, rotate its base-10 digits m positions rightward. That is, output the result of ...
9
votes
14
answers
824
views
Descending dungeons of positional systems
The sequence discussed in this challenge is a variant of the Descending Dungeons sequence family. Specifically, the sequence generation rules:
...
36
votes
51
answers
4k
views
How many 1's we get
Description
Count how many occurrences there are of the digit 1 between two given numbers \$[a, b]\$, inclusive.
For example, from 1 to 100 it should be 21:
1, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,...
9
votes
8
answers
2k
views
Music with pi and e
Because I forgot to celebrate Pi Day (14.3), let's celebrate with \$\pi\$, \$e\$ (Euler's number) and music!
Challenge
No, we don't have time to eat a pi-pizza, let's make a program.
What you need is ...
5
votes
8
answers
282
views
Is it a geometric sequence or not? [closed]
Well, last time I asked for an arithmetic sequence, now comes the geometric sequence
Challenge
In this challenge, the input will be an unordered set of numbers and the program should be able to tell ...
-8
votes
4
answers
253
views
Is it an Arithmetic Sequence or not? [closed]
Challenge
In this challenge, the input will be an ordered set of numbers and the program should be able to tell if the set of numbers is an Arithmetic Sequence.
Input
The input will be a list ...
13
votes
18
answers
1k
views
Name the Aztec year
It's time for another Mesoamerican calendar! The Xiuhnelpilli was used by the Aztecs (more properly, the Mexica) to name their years. Each year has a number and a sign. Here's part of the cycle:
<...
2
votes
3
answers
2k
views
Checking a Windows 95 OEM Key for validity [closed]
Introduction
Windows 95 used a very simple algorithm for verifying license keys. The scheme of an OEM license key always looked like this:
xxxyy-OEM-NNNNNNN-zzzzz
...
17
votes
11
answers
2k
views
The Double-Castle Numbers™
Introduction
A double-castle number™ is a positive integer number that has a pattern of $$\underbrace{a\cdots a}_{m\text{ }a\text{s}}b\underbrace{a\cdots a}_{m\text{ }a\text{s}}b\underbrace{a\...
42
votes
5
answers
4k
views
Compute xkcd's Wrong Times Table
The 2020-05-29 xkcd comic showed us the numbers that Randall Munroe feels would be most likely to result from multiplication, other than the correct answers. The table does seem to have some sort of ...
26
votes
19
answers
2k
views
Bubbler numbers
Background
My user ID is 78410, or \$1 0 0 1 1 0 0 1 0 0 1 0 0 1 0 1 0_2\$. One interesting property of this number is that, in binary,
it doesn't have three consecutive identical digits, and yet
it ...