Explore how primes thin out among integers, the Prime Number Theorem, and the race to count primes
Primes become rarer as numbers grow, but how much rarer? The Prime Number Theorem (proved independently by Hadamard and de la Vallée-Poussin in 1896) gives the answer: the number of primes up to x is approximately x/ln(x).
But while the global trend is smooth, the local behavior of primes is wildly irregular. Prime gaps fluctuate unpredictably, and geometric arrangements of primes reveal mysterious patterns that remain unexplained to this day.
The function π(x) counts primes up to x. Compare it with two approximations: x/ln(x) (crude but famous) and Li(x), the logarithmic integral (far more accurate). Watch them converge as x grows — this is the Prime Number Theorem in action.
Prime Number Theorem: π(x) ~ x/ln(x) as x → ∞. The logarithmic integral Li(x) is a better approximation.
The gaps between consecutive primes reveal the local irregularity beneath the smooth global trend. Twin primes (gap 2) are the closest pairs, while large gaps also appear. The twin prime conjecture — that there are infinitely many twin primes — remains one of the great open problems.
Beyond the Ulam spiral, other geometric arrangements reveal different prime patterns. The Sacks spiral places n at angle 2π√n and radius √n, producing striking radial lines of primes that correspond to quadratic polynomials.
Sacks spiral: integer n placed at angle 2π√n, radius √n. Primes form striking radial lines.
Despite their irregularity, primes are never too sparse: for every n ≥ 1, there is always a prime between n and 2n. This was conjectured by Bertrand (1845) and proved by Chebyshev (1850), with a famously elegant proof later given by Erdős at age 19.
You now understand both the global order and local chaos of prime distribution:
Next: We reach the summit — the Riemann Zeta Function, the most important function in all of number theory, which encodes the distribution of primes in its zeros.