Working notes on the primes

Grant Golland’s working notes on how the prime numbers are spread out. Every figure is computed here from a sieve of all 5 761 455 primes below 100 000 000, or with mpmath, and its caption says how. A sibling site, Zeta Zeros, covers the zeros that control these patterns.

Sentences carry a flag: Settled for proved theorems or computations on a stated range, Open for conjectures. A numerical match is never a proof.

Step 7

Twin primes and the Hardy–Littlewood conjectures

Twin primes are pairs like 11 and 13, two apart. Nobody can prove there are infinitely many. Hardy and Littlewood did something bolder: they predicted how many there should be, and the prediction keeps matching.

Number of twin prime pairs (p, p+2) with p+2 ≤ x (teal) against 2C₂∫₂ˣ dt/(log t)² with C₂ = 0.6601618 (gold), x from 100 to 10^8. Lower panel ratio near 1: 440312 pairs counted below 10^8 against a prediction of 440367.
Sieve: numpy boolean sieve of Eratosthenes to 108, 23 October 2026 PT, giving π(108) = 5 761 455 (matches the standard value). Twin pairs with p + 2 ≤ x counted at 300 points. At 108: 440 312 counted, 440 368 predicted. The twin constant C₂ = ∏(1 − 1/(p − 1)²) over odd primes, computed here as 0.6601618 from primes below about 2.8 million (the accepted value is 0.6601618…). The integral is evaluated with mpmath. Motion is off if your system asks for reduced motion.
  • Open The twin prime conjecture: infinitely many twin pairs. Open.
  • Open Hardy and Littlewood (Acta Mathematica, 1923), conjecture B: the count up to x is asymptotic to 2C₂∫dt/(log t)². The match above, to about 0.01 percent at 108, is evidence, not proof.
  • Settled Brun (1919): the sum of 1/p over twin primes converges, so twins are rare compared with primes.

Other gaps h

The same conjecture covers any even difference h. It predicts each count is the twin count times ∏ (p − 1)/(p − 2) over odd primes p dividing h. So pairs 6 apart should be twice as common as twins, and pairs 30 apart (30 = 2·3·5) about 2.67 times.

For each even h from 2 to 60, bars give the number of primes p ≤ 10^8 − h with p + h also prime; gold ticks give the Hardy–Littlewood prediction 2C₂∏(p−1)/(p−2)∫dt/(log t)², product over odd primes p dividing h. Every bar matches its tick to within about 0.2 percent; h = 30 has the most pairs, about 2.67 times h = 2, as predicted.
Counted from the sieve: for h = 2, 6, 30 the counts are 440 312, 879 908, 1 173 934 against predictions 440 368, 880 736, 1 174 314. Largest relative deviation across all 30 values of h: 0.19 percent. Motion is off if your system asks for reduced motion.
  • Open The general Hardy–Littlewood k-tuple conjecture predicts the count of any admissible pattern, such as prime triples p, p + 2, p + 6. Not one case with two or more primes is proved.

Reading path · step 8 of 11