Among the first million decimal digits of pi, the digit 5 appears 100,359 times and the digit 6 appears 99,548 times. Those two numbers differ by 811, which sounds like a lot until a statistical test is applied to all ten counts together: a perfectly fair ten-sided die, rolled a million times, would stray from even counts at least this much about four times in five. Pi’s digits passed every test run on them here, from single-digit counts to five-digit poker hands. Yet nobody has proved that pi’s digits behave this way forever, and the gap between “passes every test” and “proven” is one of the stubborn open questions in mathematics.
What “normal” means
A precise idea of random
A number is called normal in base 10 if every digit appears with frequency 1/10 in the long run, every pair of digits with frequency 1/100, every triple with frequency 1/1,000, and so on for blocks of every length. A normal number’s digits look like the output of a fair random process, at every scale.
What’s known about pi
Wolfram MathWorld’s page on the digits of pi is blunt: “It is not known if pi is normal.” It adds that the first 30 million digits have approximately equal digit frequencies, a check it credits to Bailey in 1988. Almost every real number is normal, in a precise mathematical sense, but proving it for any specific famous constant has turned out to be very hard.
Getting the digits
The Python library mpmath computed pi to one million decimal places in about 13 seconds on a cloud server. The digit counts matched the table MathWorld gives for the first million digits, which it attributes to Yasumasa Kanada, exactly in every one of the ten positions. The millionth digit is 1, and the last ten of the first million are 5779458151.

Single digits
The counts
| Digit | Count in first 1,000,000 | Difference from 100,000 |
|---|---|---|
| 0 | 99,959 | −41 |
| 1 | 99,758 | −242 |
| 2 | 100,026 | +26 |
| 3 | 100,229 | +229 |
| 4 | 100,230 | +230 |
| 5 | 100,359 | +359 |
| 6 | 99,548 | −452 |
| 7 | 99,800 | −200 |
| 8 | 99,985 | −15 |
| 9 | 100,106 | +106 |
The chi-square test
A chi-square test measures how far observed counts stray from expected ones. For these ten counts it gives a statistic of 5.51 with nine degrees of freedom and a p-value of 0.79. A truly random sequence would stray at least this far 79 percent of the time. MathWorld describes the same distribution as showing no statistically significant departure from uniform.
At smaller scales
| First N digits | p-value |
|---|---|
| 100 | 0.90 |
| 1,000 | 0.86 |
| 10,000 | 0.41 |
| 100,000 | 0.91 |
| 1,000,000 | 0.79 |
None of the prefixes looks suspicious. In the first 100 digits, 9 appears 14 times and 0 only 8 times, a spread that looks uneven but is ordinary for so few digits.
Pairs, triples and poker hands
Pairs
Normality requires more than even single digits. Every overlapping pair of adjacent digits, 00 through 99, was counted across the million digits. The chi-square statistic was 94.2 on 99 degrees of freedom, p = 0.62. No pair of digits shows up suspiciously often or rarely.
Triples
Splitting the digits into 333,333 non-overlapping blocks of three gave counts for all 1,000 possible triples, from a low of 266 to a high of 393 against an expected 333. The chi-square statistic was 998 on 999 degrees of freedom, p = 0.50, almost exactly what pure chance predicts.
The poker test
A classic randomness check splits the digits into five-digit “hands” and counts how many different digits each hand contains. Of 200,000 hands, 13 contained only one distinct digit, against 20 expected; 2,644 had two, against 2,700; 36,172 had three, against 36,000; 100,670 had four, against 100,800; and 60,501 had five different digits, against 60,480. The chi-square test gives p = 0.33.
Two controls
The same tests were run on two other million-digit sequences for comparison. The first came from NumPy’s pseudorandom generator, which is designed to imitate fair dice. It passed both the single-digit test (p = 0.88) and the pair test (p = 0.65), behaving just like pi. The second was a deliberately bad sequence: the block 0123456789 repeated 100,000 times. Its single-digit counts are perfectly even, exactly 100,000 of each digit, so the single-digit test returns p = 1.0, a score so flawless that it is itself suspicious. The pair test then demolishes it. Only 10 of the 100 possible pairs ever appear, always a digit followed by the next one, and the p-value is effectively zero. That’s why normality is defined over blocks of every length: a sequence can be balanced one digit at a time and still be completely predictable. Pi, in the first million digits, looks like the pseudorandom stream and nothing like the repeating one.

Runs, gaps and famous strings
The Feynman point
MathWorld notes that the sequence 999999 first appears starting at decimal 762, a spot sometimes called the Feynman point. The scan found it in the same place. Six identical digits that early stands out: the chance that six 9s begin at any one particular spot is one in a million. Across hundreds of thousands of starting points and ten possible digits, though, runs of six are expected to turn up, and the scan found them later in the million as well.
The longest run
Across the whole first million, the longest run of a single repeated digit was seven 3s, starting at decimal 710,100. In a random million-digit sequence, a few runs of six or seven identical digits are expected. A run of nine or ten would have been surprising.
Gaps
The gaps between successive appearances of the digit 0 averaged 10.004 places, against a theoretical 10 for a random sequence. The longest gap without a single 0 was 114 digits. The whole shape of the gaps matched chance too. In a random sequence, a 0 is followed immediately by another 0 one time in ten; in pi it happened 9.94 percent of the time. The next 0 should arrive within ten places 65.13 percent of the time; in pi it was 65.20 percent. A gap longer than 50 places should occur 0.52 percent of the time, and in pi it was 0.53 percent.
Strings that aren’t there
The scan also searched for a few strings. The first six digits of pi, 314159, reappear starting at decimal 176,451. The string 2026 first appears at decimal 3,118. But 123456 and 000000 don’t appear anywhere in the first million, and neither does 0123456789. MathWorld lists the first occurrence of that ten-digit run at decimal 17,387,594,880, past 17 billion digits.
What the tests can and can’t show
Passing isn’t proof
A test can catch a sequence that’s non-random in the way the test looks for. Pi passed tests of single digits, pairs, triples, poker hands, runs and gaps on the first million digits. But normality is a statement about infinitely many digits and blocks of every length. No finite number of tests on a finite number of digits can establish it.
Why it’s hard
Pi is defined geometrically, as the ratio of a circle’s circumference to its diameter, and nothing in that definition obviously connects to the statistics of its decimal expansion. Mathematicians can construct specific normal numbers on purpose, but proving normality for a constant that wasn’t built for it has resisted every attempt so far. MathWorld’s page cites Wagon in 1985 and Bailey and Crandall in 2001 alongside its statement that pi’s normality isn’t known.
What it would mean
If pi is normal, every finite string of digits appears somewhere in its expansion, infinitely often and with exactly the expected frequency. That includes any phone number, any date, and the digits of any computer file. The first million digits already contain 2026 at position 3,118. Whether they eventually contain everything is a question the digits alone can never settle.

Running the tests at home
A few lines of code
The whole investigation takes a short script: compute or download a million digits, count them with a single call, and pass the counts to a chi-square function from a statistics library. Pairs and triples need one more line each to combine digits into numbers.
One trap
Combining digits into triples by arithmetic needs care with data types. A first attempt here stored digits as 8-bit integers, which can’t hold values above 255, so multiplying the first digit by 100 overflowed silently and produced a chi-square statistic of nearly a million, wildly “non-random.” Converting to ordinary integers fixed it and returned the unremarkable p = 0.50. Sometimes the most suspicious-looking result in a randomness test is a bug, and pi was fine all along.
Sources
- Wolfram MathWorld, “Pi Digits”: https://mathworld.wolfram.com/PiDigits.html
