# Make a super fair number

An even distribution number is a number such that if you select any of it's digits at random the probability of it being any particular value (e.g. 0 or 6) is the same, $$\\frac1{10}\$$. A precise definition is given later on.

Here are a few examples:

• $$\\frac{137174210}{1111111111} =0.\overline{1234567890}\$$ is an even distribution number.
• $$\2.3\$$ is not an even distribution number since 7 of the digits 1456789 never appear and all but two of the digits are 0.
• $$\1.023456789\$$ may look like it's an even distribution number, but for this challenge we count all the digits after the decimal point, including all the 0s. So nearly all the digits are 0, and the probability of selecting anything else is $$\0\$$.

Precisely speaking if we have a sequence of digits $$\\{d_0^\infty\}\$$ then the "probability" of a particular digit $$\k\$$ in that sequence is:

$$\ \displaystyle P(\{d_0^\infty\},k) = \lim_{n\rightarrow\infty}\dfrac{\left|\{i\in[0\dots n], d_i=k\}\right|}{n} \$$

That is if we take the prefixes of size $$\n\$$ and determine the probability that a digit selected uniformly from that prefix is $$\k\$$, then the overall probability is the limit as $$\n\$$ goes to infinity.

Thus an even distribution number is a number where all the probabilities for each $$\k\$$, converge and give $$\\frac1{10}\$$.

Now a super fair number is a number $$\x\$$ such that for any rational number $$\r\$$, $$\x+r\$$ is an even distribution number.

Output a super fair number. Since super fair numbers are irrational you should output as an infinite sequence of digits. You can do this using any of the defaults.

This is so the goal is to minimize the size of your source code as measured in bytes.

• is the decimal point required if the number is <1? Commented Oct 5, 2023 at 15:45
• Are solutions using a pseudorandom generator with a finite state valid? Technically, they output a rational number Commented Oct 6, 2023 at 5:19
• May I assume $\pi$, $e$ or $\sqrt2$ are normal? Commented Oct 6, 2023 at 5:22
• @Wheat Wizard: "even distribution" numbers are more commonly called simply normal (in base 10) numbers. Commented Oct 6, 2023 at 7:01
• @CommandMaster: it is an open problem to show that any of those constants are simply normal. Commented Oct 6, 2023 at 7:01

# Jelly, 4 3 bytes

‘Ṙß


Try it online!

# Jelly, 7 bytes (if leading 0. is required)

.1¹2‘Ṙ¿


Try it online!

A niladic link that takes no arguments and prints Champernowne’s constant, one of the few numbers that have been proven ‘normal’, which is the more common term for this type of number (though the request here is more specifically for an irrational ‘simply normal’ number in base 10 which is an easier target to meet).

Thanks to @JonathanAllan for saving a byte!

• @FryAmTheEggman Well, an irrational simply normal number at least.
– Neil
Commented Oct 6, 2023 at 7:26
• ‘Ṙß for 3 if we may assume no recursion limit (which I guess we can). Commented Oct 6, 2023 at 15:17

# R, 26 19 bytes

\(n)sample(0:9,n,T)


Attempt This Online!

Function that returns n digits, representing the digits after the decimal point.
The particular choice of super-fair number returned changes each time the function is called, since the digits are random.
Add +14 bytes to output digits from the same super-fair number on successive calls.

# R, 19 18 bytes

repeat cat(F<-F+1)


Try it online!

Like my other answer, this outputs Champernowne’s constant. Thanks to @DominicVanEssen for saving a byte!

• 18 bytes... Commented Oct 5, 2023 at 16:43

# Python, 31 bytes

i=0
while[print(i,end="")]:i+=1


Attempt This Online!

Edit: since someone is downvoting all the Champernowne constant answers, I thought that I should prove that it is a super fair number.

I don't have time to write a formal proof right now, but the basic idea is that as you move further along Champernowne constant the period of the digits of the rational number gets insignificant compared to the period of most digits (of i).

This essentially means that we can treat the effect of the rational number as (a combination of) constant offsets. Applying a constant offset just has the effect of "rotating" when digits appear; it doesn't change their frequency.

Essentially the point is that only digits in the "middle" of i really matter, and what happens at the edges doesn't.

# 05AB1E, 8 2 bytes

∞S


Try it online! Outputs as a list of digits.

• That's an even distribution number, not a super fair number. Commented Oct 5, 2023 at 15:27
• @WheatWizard fixed Commented Oct 5, 2023 at 15:44
• 3 bytes with --no-lazy, ∞ʒ? Commented Oct 6, 2023 at 5:21

# Charcoal, 9 bytes

⭆Ｎ⁺‽χ….¬κ


Try it online! Link is to verbose version of code. Explanation: Prints i random digits.

If e is ever proven normal, then for 8 bytes:

×ψ⊕Ｎ¤≕E


Try it online! Link is to verbose version of code. Explanation: Prints the first i digits of e, which is believed to be normal.

• Why the downvote?
– Neil
Commented Oct 6, 2023 at 7:27
• Apparently someone really really hates the Champernowne constant Commented Oct 6, 2023 at 8:15
• @AnttiP Indeed, but my answer doesn't use it...
– Neil
Commented Oct 6, 2023 at 8:46

# Nibbles, 3 bytes (6 nibbles)

(or 4 bytes (8 nibbles) if leading 0. is required.

+.,~p


Attempt This Online!

Outputs the digits of Champernowne's constant. Credit to Nick Kennedy's answer for pointing-out that this has been proven to be a 'normal' number.

# Nibbles, 3.5 bytes (7 nibbles)

+.,~p*


Attempt This Online!

Outputs the digits of a different super-fair number, proven by Abram Besicovitch to be 'normal'. 5 bytes if the leading 0. is required.

# Gaia, 3 bytes

ṅ\$<


Try it online!

Prints the first $$\n\$$ digits of the Copeland–Erdős constant, the concatenation of the primes.

# JavaScript (Node.js), 22 bytes

f=x=>x&&(f(x>>1)+x)%10


Try it online!

Looks messy but unproven

• Not sure if it's a signal that it's wrong, but there's so many 01347801 in output
– l4m2
Commented Oct 12, 2023 at 9:17
• f(x) is the number, written in binary, summed mod 10, with digits weighted ... 5 7 3 1 5 7 3 1. As an alternative characterization, start with 0, and each time append it the sequence plus each of 1 3 4 7 8 0 1 5 6 8 9 2 3 5 6 mod 10. This can be used to show it's an even distribution number, I believe. Showing it's a super fair number is more complex, and I'm not sure how it could be done for fractions whose period isn't a power of 2. Commented Oct 13, 2023 at 3:34