The Prime Counting Race
How well can a smooth curve predict the most jagged sequence in mathematics?
The Prime Counting Race
Primes look like noise. They arrive without rhythm — — and no formula predicts the next one. Yet zoom out far enough and the noise resolves into one of the smoothest curves in mathematics. This fable is about that zoom.
Counting the unpredictable
Define as the number of primes up to . It is a staircase: flat, then a jump at every prime. Nothing about it looks smooth up close. But Gauss, at fifteen, noticed that near the primes thin out like — so the staircase should grow roughly like .
Try it — drag the values
Drag the stretch factor stretch = 1.00 and watch how sensitive the fit is.
How good is the guess?
| n | π(n) — actual | n/ln(n) — guess | error |
|---|---|---|---|
| 1000 | 168 | 145 | −14% |
| 100000 | 9592 | 8686 | −9.4% |
| 10000000 | 664579 | 620421 | −6.6% |
The error shrinks, but slowly. The Prime Number Theorem (1896) says the ratio tends to 1 — the race never ends, but the runners pace each other forever.
1792
Gauss conjectures the density law
Age fifteen, from tables of primes he computed by hand.
1859
Riemann connects primes to zeta zeros
Eight pages that defined a century of mathematics.
1896
Prime Number Theorem proved
Hadamard and de la Vallée Poussin, independently.
The better runner: the logarithmic integral◆◆◆◆◆go deeper +
Gauss's refined guess was , which beats decisively: at its error is about , not . The Riemann Hypothesis is precisely the claim that this error stays as small as square-root-of- forever.
Check yourself
The Prime Number Theorem says π(n) · ln(n) / n tends to…