Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Challenges

Posts tagged number

This tag doesn't have any usage information yet.

This tag doesn't have a detailed wiki yet.

50%
+0 −0
Sandbox Awkward Ordinals [FINALIZED]

posted 12d ago by trichoplax‭  ·  edited 8d ago by trichoplax‭

50%
+0 −0
Challenges Awkward Ordinals

Write code that takes a positive integer and outputs the awkward ordinal name from the test cases. Notice that these are not the conventional ordinal names, although there is significant overlap. ...

0 answers  ·  posted 8d ago by trichoplax‭

Question code-golf number string
50%
+0 −0
Challenges Digit balanced numbers

Does a number have balanced numbers of distinct digits? That is, do the number's digits appear with equal frequency? Input A positive integer N. N will have no leading zeroes. Output An ...

3 answers  ·  posted 23d ago by trichoplax‭  ·  last activity 22d ago by m90‭

Question code-golf number
64%
+7 −3
Challenges Make $2 + 2 = 5$

In this challenge, add 2 integers, but if both the integers are 2, output 5. Shortest code in each language wins! Example ungolfed program in Python 3.x def add(x, y): if x == 2 and y == 2: ...

23 answers  ·  posted 3y ago by General Sebast1an‭  ·  last activity 5mo ago by arutonee‭

Question code-golf math number
60%
+1 −0
Challenges How many odd digits?

Given a positive integer, count its odd digits. Input An integer from 1 to 999,999,999, inclusive, in any of the following formats: A number (such as an integer or floating point number), li...

6 answers  ·  posted 8mo ago by trichoplax‭  ·  last activity 6mo ago by Shaggy‭

Question code-golf number
83%
+8 −0
Challenges The 50 substrings that validate any string of Roman numerals

Given a string of Roman numerals, decide whether it forms a valid Roman number. If not, output the substring that proves this, from the list of 50 strings described below. Relevant fact This chal...

7 answers  ·  posted 1y ago by trichoplax‭  ·  edited 7mo ago by trichoplax‭

Question code-golf math number string
50%
+0 −0
Challenges Multiplicative perfection

Given a positive integer, indicate whether it is the product of its proper divisors. Integers equal to the product of their proper divisors can be found on the Online Encyclopedia of Integer Seque...

4 answers  ·  posted 7mo ago by trichoplax‭  ·  last activity 7mo ago by celtschk‭

Question code-golf math number decision-problem
50%
+0 −0
57%
+2 −1
Challenges Fibonacci without consecutive digits

Output the Nth number in the list of Fibonacci numbers that have no consecutive digits. Input A non-negative integer (if you treat the Fibonacci numbers as zero-indexed) or a positive integer (...

4 answers  ·  posted 1y ago by trichoplax‭  ·  last activity 7mo ago by Andrew Ray‭

Question code-golf math number sequence fibonacci
50%
+0 −0
Sandbox How many odd digits? [FINALIZED]

posted 8mo ago by trichoplax‭  ·  edited 8mo ago by trichoplax‭

60%
+1 −0
Challenges Hex ​​​detector

Given an integer from 1 to 1000, indicate whether it is a centered hexagonal number[1] (also known as a hex number). What is a hex number? The hex numbers can be visualised as follows: On a he...

4 answers  ·  posted 10mo ago by trichoplax‭  ·  last activity 8mo ago by trichoplax‭

Question code-golf math number
66%
+2 −0
Challenges Substring factor

Does a positive integer have a substring as a factor? Input A positive integer. Output One of 2 distinct values to indicate whether the input has a factor that is a strict substring of it...

3 answers  ·  posted 10mo ago by trichoplax‭  ·  last activity 8mo ago by Shaggy‭

Question code-golf math number string
50%
+0 −0
Sandbox Substring factor [FINALIZED]

posted 10mo ago by trichoplax‭  ·  edited 10mo ago by trichoplax‭

60%
+1 −0
Challenges Most isolated of 3 points

Given 3 points, output one that is separated from its nearest neighbour by the largest distance. Input 3 distinct points (that is, no 2 points are in the same position). Each point is a pair o...

0 answers  ·  posted 10mo ago by trichoplax‭  ·  edited 10mo ago by trichoplax‭

Question code-golf math number
66%
+2 −0
Challenges Round trip stones

$N$ vessels initially contain $3$ stones each. What is the probability of having at least $3$ stones in the first vessel after moving a uniformly random selection from the first vessel to the secon...

1 answer  ·  posted 1y ago by trichoplax‭  ·  last activity 12mo ago by Arpad Horvath‭

Question code-golf math number probability
50%
+0 −0
Sandbox Round trip stones [FINALIZED]

posted 1y ago by trichoplax‭  ·  edited 1y ago by trichoplax‭

60%
+1 −0
Challenges Shortest representation in generalised Roman numerals

Find the shortest representation of an integer in generalised Roman numerals. Since there is more than one way to generalise, only the following definition applies to this challenge. Definition T...

1 answer  ·  posted 1y ago by trichoplax‭  ·  last activity 1y ago by NikNakk‭

Question code-golf number
86%
+11 −0
Challenges Can you give me half?

Challenge idea taken from: Eliseo D'Annunzio Task Provide code that evaluates to 0.5 numerically, i.e. the output must be recognized by your chosen language as a numeric value (Number, float, dou...

23 answers  ·  posted 3y ago by Razetime‭  ·  last activity 1y ago by RubenVerg‭

Question alternative-scoring number code-challenge lowest-score
60%
+1 −0
Sandbox Make my value binary [released]

posted 3y ago by General Sebast1an‭  ·  edited 2y ago by trichoplax‭

71%
+3 −0
75%
+4 −0
Sandbox Decode periodic decimal fractions [FINALIZED]

posted 3y ago by celtschk‭  ·  edited 2y ago by trichoplax‭

66%
+2 −0
Sandbox Convert integer to English [FINALIZED]

posted 3y ago by celtschk‭  ·  edited 2y ago by trichoplax‭

71%
+3 −0
66%
+2 −0
Challenges Digit antitranspose

Convert a matrix or grid of digits to its antitranspose. For a square matrix , this is its reflection in its antidiagonal. More generally, for a rectangular matrix, this is its reflection in its sk...

4 answers  ·  posted 2y ago by trichoplax‭  ·  last activity 2y ago by torres‭

Question code-golf number
60%
+1 −0
Sandbox Digit antitranspose [FINALIZED]

posted 2y ago by trichoplax‭  ·  edited 2y ago by trichoplax‭

71%
+3 −0
Challenges Presumptuous base conversion

Take an input string representing a number and convert it to decimal (base 10). However, the base of the input is not specified. Assume the input is in the smallest base for which its digits are va...

5 answers  ·  posted 2y ago by trichoplax‭  ·  last activity 2y ago by Shaggy‭

Question code-golf math number base parsing
66%
+2 −0
75%
+4 −0
Challenges The Pell Numbers

Introduction The Pell(no, not Bell) Numbers are a simple, Fibonacci-like sequence, defined by the following relation: $P_n=\begin{cases}0&\mbox{if }n=0;\\1&\mbox{if }n=1;\\2P_{n-1}+P_{n-2...

9 answers  ·  posted 4y ago by Razetime‭  ·  last activity 3y ago by torres‭

Question code-golf number sequence
81%
+7 −0
Challenges Collatz conjecture; Count the tries to reach $1$

Background Check out this video on the Collatz conjecture, also known as A006577. If you don't know what this is, we're given an equation of $3x + 1$, and it is applied this way: If $x$ is odd...

15 answers  ·  posted 3y ago by General Sebast1an‭  ·  last activity 3y ago by torres‭

Question code-golf math number
85%
+10 −0
Challenges It's Hip to be Square

Challenge A catalogue type challenge that simply asks: Given an integer n (where n>=0) as input return a truthy value if n is a perfect square or a falsey value if not. Rules You may take...

20 answers  ·  posted 3y ago by Shaggy‭  ·  last activity 3y ago by Zakk‭

Question code-golf math number decision-problem
33%
+1 −4
Challenges Small integer swapping

In this simple challenge, create a short program that takes 2 ints as input, output them, swap their places, then output them again. Those 2 integers can't be the same number. The program with the ...

7 answers  ·  posted 3y ago by General Sebast1an‭  ·  last activity 3y ago by south‭

Question code-golf number
66%
+2 −0
Challenges Make my value binary

Challenge What do computers understand? That's right, binary. All files are turned into binary digits when you run them, but what if I suggest giving you an int then turn it into it's binary value...

14 answers  ·  posted 3y ago by General Sebast1an‭  ·  last activity 3y ago by Olin Lathrop‭

Question code-golf number
81%
+7 −0
Challenges Operation "Find The Operator"

Challenge Make a program that takes input of 3 non-negative integers: a result and 2 other values that once calculated results to the 3rd value. The program must figure out how to get the 2 fir...

5 answers  ·  posted 3y ago by General Sebast1an‭  ·  last activity 3y ago by radarek‭

Question code-golf math number
81%
+7 −0
Challenges Make my number a set

Natural to set (set meaning an unordered collection with no duplicates, though answers may use and output lists instead) Recently I was brainstorming what a language with only (arbitrarily nested...

10 answers  ·  posted 4y ago by Wezl‭  ·  last activity 3y ago by radarek‭

Question code-golf number
71%
+3 −0
Challenges Convert integer to English

Given a non-negative integer up to $999\,999\,999$, write it in English. The input number can be in any form other than English (though you'll typically want to use the native integer type of your...

3 answers  ·  posted 3y ago by celtschk‭  ·  last activity 3y ago by Moshi‭

Question code-golf number string
71%
+3 −0
Challenges Encode and decode floating point integers

Imagine you have only one byte (8 bits) to store a value, but need to store values from $0$ to $4032$. Impossible, until you are also told that an error of 1/64 of the exact value does not matter. ...

2 answers  ·  posted 3y ago by celtschk‭  ·  last activity 3y ago by General Sebast1an‭

Question code-golf number
77%
+5 −0
Challenges Decode periodic decimal fractions

Rational numbers in decimal representation can have an infinite periodic part. One common way to write this down is to repeat the periodic digits and then add three dots. Numbers without those thre...

2 answers  ·  posted 3y ago by celtschk‭  ·  edited 3y ago by General Sebast1an‭

Question code-golf number parsing
60%
+1 −0
Challenges Getting perfect squares, differently

Create a program that gets all perfect squares starting from 0 or 1 without using any methods of multiplication (repetitive addition) and exponentiation (repetitive multiplication). Output them for...

7 answers  ·  posted 3y ago by General Sebast1an‭  ·  last activity 3y ago by General Sebast1an‭

Question code-golf math number restricted-source
75%
+4 −0
Challenges When The Ternary Is Balance

Inspired by this Rosetta Code article. Introduction Balanced Ternary is a method of representing integers using -1, 0 and 1 in base 3. Decimal 11 = (1 * 32) + (1 * 31) + (−1 * 30) = [1,1,-1] or ...

3 answers  ·  posted 3y ago by Razetime‭  ·  last activity 3y ago by Moshi‭

Question code-golf number base
71%
+3 −0
Sandbox Balance my ternary[FINALIZED]

posted 3y ago by Razetime‭  ·  edited 3y ago by Razetime‭

80%
+6 −0
Challenges Juggler sequences

A Juggler sequence is a sequence that begins with a positive integer $a_0$ and each subsequent term is calculated as: $$a_{k+1} = \begin{cases} \left \lfloor a_k ^ \frac 1 2 \right \rfloor, &...

9 answers  ·  posted 4y ago by caird coinheringaahing‭  ·  last activity 3y ago by Shaggy‭

Question code-golf math number sequence
80%
+6 −0
Challenges Versatile self-printer

Using your languages of choice, golf a quine - a non-empty program taking no input and only outputting its source. Here, the win condition is your quine working in the most languages. It should be...

1 answer  ·  posted 4y ago by AndrewTheCodegolfer‭  ·  last activity 3y ago by General Sebast1an‭

Question quine number highest-score