Explore how primes thin out among integers, the Prime Number Theorem, and the race to count primes
Primes thin out as numbers grow, yet they never run dry. Up close they look random; from far away they follow a smooth, predictable curve.
Slide x and compare the staircase π(x) with x/ln(x) and Li(x). Notice how much closer Li(x) hugs the count.
Prime Number Theorem: π(x) ~ x/ln(x) as x → ∞. The logarithmic integral Li(x) is a better approximation.
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.
Look at the gaps between consecutive primes, then switch to the histogram. Twin primes, with gap 2, keep turning up.
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.
Each n sits at angle 2π√n and radius √n. Look for the curved lines of primes, then compare with the Archimedes spiral.
Sacks spiral: integer n placed at angle 2π√n, radius √n. Primes form striking radial lines.
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.
Slide n and look between n and 2n. There is always at least one prime there.
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.
Spot a mistake or have an idea?