The Rhythm of Numbers · New probable primes · added
Five of pi’s best fractions have a probable prime on the bottom or on top
Pi’s best fractions are 22/7, 333/106, 355/113, and on and on, each one closer than the last. Only a few of their bottom numbers are prime. In November 2026 Teddy Rook found the 11th, far out at fraction number 25,332, then the 12th, at fraction number 27,651, only a little further on, the 13th, at fraction number 32,394, and the 14th, at fraction number 37,721. They have 13,017, 14,190, 16,695 and 19,465 digits. He also found a prime on top: the top number of fraction 42,037, with 21,667 digits, the first new prime top number since fraction 8,750. As far as we can find, no one has reported any of them before.
Where they come from
Pi’s continued fraction, [3; 7, 15, 1, 292, 1, 1, …], gives a list of fractions that close in on pi, one per step. Their bottom numbers are called q₁, q₂, q₃, …, so q₁ = 7 (from 22/7) and q₃ = 113 (from 355/113). Each is made from the two before it: multiply the last one by the next term of the continued fraction and add the one before that.
The Rhythm of Numbers paper asked whether infinitely many of these bottom numbers are prime. Up to fraction number 20,000 there were ten, the last at number 6,925. The same question can be asked of the top numbers, p₁, p₂, p₃, …: up to fraction 20,000 there were fifteen prime ones, the last at number 8,750. Teddy Rook carried the search to fraction 50,000, top and bottom numbers, with his own programs and found that the bottom numbers q₂₅₃₃₂, q₂₇₆₅₁, q₃₂₃₉₄ and q₃₇₇₂₁ and the top number p₄₂₀₃₇ pass the tests for primes. To save time he first used a “rhythm sieve”: the rule that builds each bottom number, run with the remainders after division by every prime below ten million, which throws out about 19 candidates in 20 before any huge number is touched. You can hear a small version of it on the Rhythm of Numbers page.
We then rebuilt all five numbers from scratch, from two separate high-precision values of pi, and got the same digits. We also repeated the search ourselves, the bottom numbers to fraction 38,571 and the top numbers to fraction 42,037: these are the only new ones that pass there, and our search turned up the top number at 42,037 on its own. Beyond that, to fraction 50,000, the counts rest on his search. In each of the five fractions, the other number is not prime.
The eleventh: the bottom number of fraction 25,332
Status: probable prime, proof in progress. It passed the standard tests for primes, run independently twice. A full proof of primality (a certificate that anyone can check) is being computed now, and it may take a week or more.
This page will be updated when the proof is done. Until then, please call it a probable prime.
- What it is
- The denominator of pi’s 25,332nd best fraction, called q25332
- Size
- 13,017 digits
- Found by
- Teddy Rook, November 2026
- Its place in the list
- The 11th prime denominator of pi; the 10th is at fraction number 6,925
- First and last 30 digits
- 275925685453683448216470675444 … 606911050410360149428090949703
- SHA-256 of the digits (no spaces or line breaks)
- 73f98bd668e4c94394d07e7846ca7643d6ecf617317850bcbff60ac260ad7974
All 13,017 digits, in rows of 50 and groups of 10. The gray number at the start of each row is the position of its first digit. Copy or download the number as one line with no spaces.
The twelfth: the bottom number of fraction 27,651
Status: probable prime, no proof started. It passed the same tests, run independently twice. No proof has been started yet; one would take roughly 40% longer than the proof of the eleventh.
- What it is
- The denominator of pi’s 27,651st best fraction, called q27651
- Size
- 14,190 digits
- Found by
- Teddy Rook, November 2026
- Its place in the list
- The 12th prime denominator of pi, only 2,319 fractions after the 11th
- First and last 30 digits
- 305357235078324549749316705051 … 365508444845110093131433096729
- SHA-256 of the digits (no spaces or line breaks)
- 4373b2822612a676bfbbeec29a0ea3e56aac31467a99903804990469e10b659d
All 14,190 digits, in rows of 50 and groups of 10. The gray number at the start of each row is the position of its first digit. Copy or download the number as one line with no spaces.
The thirteenth: the bottom number of fraction 32,394
Status: probable prime, no proof started. It passed the same tests, run independently twice. No proof has been started yet; one would take roughly 2.7 times as long as the proof of the eleventh.
- What it is
- The denominator of pi’s 32,394th best fraction, called q32394
- Size
- 16,695 digits
- Found by
- Teddy Rook, November 2026
- Its place in the list
- The 13th prime denominator of pi, 4,743 fractions after the 12th
- First and last 30 digits
- 196570744506352244286366583511 … 881876896778091710967499920787
- SHA-256 of the digits (no spaces or line breaks)
- 08bfe3ab0ebbd69b1945ad957a2fbae729aaca5a3e26ef00a80c9650711eb4a6
All 16,695 digits, in rows of 50 and groups of 10. The gray number at the start of each row is the position of its first digit. Copy or download the number as one line with no spaces.
The fourteenth: the bottom number of fraction 37,721
Status: probable prime, no proof started. It passed the same tests, run independently twice. No proof has been started yet; one would take roughly 5 times as long as the proof of the eleventh.
- What it is
- The denominator of pi’s 37,721st best fraction, called q37721
- Size
- 19,465 digits
- Found by
- Teddy Rook, November 2026
- Its place in the list
- The 14th prime denominator of pi, 5,327 fractions after the 13th
- First and last 30 digits
- 188364159512382802228558781064 … 913253006430753806198839061119
- SHA-256 of the digits (no spaces or line breaks)
- e400a170de02c0578e23b9d3b2e2ca73f2345ba9a4232cfee009c148d15af77d
All 19,465 digits, in rows of 50 and groups of 10. The gray number at the start of each row is the position of its first digit. Copy or download the number as one line with no spaces.
A top number: the sixteenth numerator: the top number of fraction 42,037
Status: probable prime, no proof started. This one is a top number (numerator), not a bottom number: the 42,037th fraction is p₄₂₀₃₇/q₄₂₀₃₇, and it is p₄₂₀₃₇ that passed the tests for primes, run independently twice. Its bottom number is not prime. No proof has been started; one would take roughly 8 times as long as the proof of the eleventh.
- What it is
- The numerator (the top number) of pi’s 42,037th best fraction, called p42037
- Size
- 21,667 digits
- Found by
- Teddy Rook, November 2026
- Its place in the list
- The 16th prime numerator of pi; the 15th is at fraction number 8,750
- First and last 30 digits
- 419202862293316599419568810055 … 387825692125801262809180879521
- SHA-256 of the digits (no spaces or line breaks)
- ca837a3355299394dacfb035d2b07ad092625da952405d18ef3a1b2389510098
All 21,667 digits, in rows of 50 and groups of 10. The gray number at the start of each row is the position of its first digit. Copy or download the number as one line with no spaces.
What “probable prime” means
Checking that a number this big is prime by trying every possible divisor would take longer than the age of the universe. Instead, there are quick tests that every prime passes and almost every non-prime fails. The strongest common one is the Baillie–PSW test. No one has ever found a non-prime that passes it, but no one has proved that none exists either. A number that passes is called a probable prime.
All five numbers passed the Baillie–PSW test and 25 more rounds of the Miller–Rabin test with random bases. For a number that is not prime, each Miller–Rabin round alone would catch it at least three times out of four.
A proof is a different kind of computation. The elliptic-curve method (ECPP) builds a chain of facts, a certificate, that shows the number is prime beyond any doubt; checking the certificate is much faster than making it. That computation is now running for the eleventh. When it finishes, “probable prime” becomes “prime”.
Check it yourself
You don’t have to take our word for it. This short Python program uses only the standard library. It works out pi to about 28,000 to 45,000 digits with Machin’s formula from 1706, finds the continued fraction (keeping only terms that are certain), rebuilds the number, compares it with the downloaded file, prints its SHA-256 fingerprint, and runs the Miller–Rabin test. Everything but the last step takes from several seconds to a minute or two, depending on the number; each Miller–Rabin round takes a few minutes in plain Python. If the gmpy2 package is installed, it runs the full Baillie–PSW test instead, in under a minute.
Save the program and q25332.txt, q27651.txt, q32394.txt, q37721.txt or p42037.txt in the same folder and run, for example, python3 check_pi_prime.py 37721 for a bottom number or python3 check_pi_prime.py 42037 p for the top number. Python 3.8 or later is enough.
# Check pi's new probable primes yourself. Python 3, standard library only; with gmpy2 installed the
# primality test at the end is much faster. Put q25332.txt, q27651.txt, q32394.txt, q37721.txt or p42037.txt (from this
# page) in the same folder, then run, for example,
# python3 check_pi_prime.py 37721 (a bottom number) or python3 check_pi_prime.py 42037 p (a top number)
import hashlib, random, sys
if hasattr(sys, "set_int_max_str_digits"):
sys.set_int_max_str_digits(0) # allow printing a 13,017-digit number
def pi_floor(d):
"""An integer within a few units of pi * 10^d, by Machin's formula pi = 16 atan(1/5) - 4 atan(1/239)."""
one = 10 ** (d + 10)
def atan_inv(x): # atan(1/x) * one
total = power = one // x
n, sign = 3, -1
while power:
power //= x * x
total += sign * (power // n)
n, sign = n + 2, -sign
return total
return (16 * atan_inv(5) - 4 * atan_inv(239)) // 10 ** 10
def terms(num, den, count):
out = []
while den and len(out) < count:
a, r = divmod(num, den)
out.append(a)
num, den = den, r
return out
N = int(sys.argv[1]) if len(sys.argv) > 1 else 25332
TOP = len(sys.argv) > 2 and sys.argv[2] == "p" # p: the numerator (top number) instead of the denominator
D = int(1.03 * N) + 1500 # digits of pi needed, with room to spare
P = pi_floor(D)
lo, hi = terms(P - 10, 10 ** D, N + 50), terms(P + 10, 10 ** D, N + 50) # pi lies between the two
k = 0
while k < len(lo) and lo[k] == hi[k]:
k += 1
assert k > N + 1, "not enough certain terms; raise D"
a = lo[:N + 1]
print("first terms:", a[:8], " terms %d-%d:" % (N - 2, N + 2), lo[N - 2:N + 3])
q0, q1 = (1, a[0]) if TOP else (0, 1) # p_{-1} = 1, p_0 = 3; q_{-1} = 0, q_0 = 1
for n in range(1, N + 1):
q0, q1 = q1, a[n] * q1 + q0
s = str(q1)
print("digits:", len(s), " matches the file:", s == open("%s%d.txt" % ("p" if TOP else "q", N)).read().strip())
print("SHA-256:", hashlib.sha256(s.encode()).hexdigest())
try:
import gmpy2
print("strong Baillie-PSW test (gmpy2):", gmpy2.is_strong_bpsw_prp(gmpy2.mpz(q1)))
except ImportError:
def strong_test(n, b): # one Miller-Rabin round; takes a few minutes here
d, s2 = n - 1, 0
while d % 2 == 0:
d, s2 = d // 2, s2 + 1
x = pow(b, d, n)
if x in (1, n - 1):
return True
for _ in range(s2 - 1):
x = x * x % n
if x == n - 1:
return True
return False
print("Miller-Rabin, base 2:", strong_test(q1, 2))
print("Miller-Rabin, random base:", strong_test(q1, random.randrange(3, q1 - 2)))
Why it matters, and why it was a long wait
Five numbers cannot answer the question “are there infinitely many?”. What they can do is test the paper’s rule of thumb, which says a typical number should have about 2 ln 2 × ln n ≈ 1.39 ln n prime bottom numbers among its first n fractions. By fraction 50,000 that rule expects about 14.1 prime bottom numbers (95% of the time between 8 and 22) and 13.5 prime top numbers (between 7 and 21). Pi has 14 and 16. That is ordinary: pi keeps looking like a typical number.
The long wait from fraction 6,925 to 25,332 is ordinary too, the bunch of four after it is probably luck, and so is the long wait for a top number, from 8,750 to 42,037 (about 1 chance in 9). The bottom numbers grow by about 1 digit every 2 steps, and the bigger a number is, the rarer primes are. So the expected count grows only like a logarithm: roughly one more prime each time the fraction number doubles. Primes that arrive at random like this often come in clumps, with long gaps in between. Four in the stretch from 25,000 to 40,000 would happen less than 1% of the time for a typical number, but that stretch was picked after the primes were seen, and the stretch before it ran low. The chance of a 15th prime bottom number by fraction 62,500 is about 27%, by fraction 100,000 about 62%, and by fraction 200,000 about 85%, and the same holds for a 17th prime top number.
What it all means, in plain words →Pi’s prime fractions on the Rhythm of Numbers page →Section 17.5 of the paper (PDF, page 115) ↗