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 9

The Ulam spiral, read honestly

In 1963 Stanisław Ulam, doodling in a meeting, wrote the integers in a square spiral and circled the primes. They lined up in diagonal streaks. The picture is real; what it means is more modest than it looks.

Integers 1 to 161² = 25921 placed on a square spiral starting at the centre; each prime (2851 of them) is a dark square. Diagonal streaks appear. Primes of the form n² + n + 41 (Euler's polynomial) are red. The streaks are quadratic polynomials; they reflect divisibility patterns, not a hidden order that predicts primes.
Primes from the sieve placed on a 161 × 161 spiral (2851 primes up to 25 921). Published by Stein, Ulam and Wells (American Mathematical Monthly, 1964). Motion is off if your system asks for reduced motion.

Diagonals in a square spiral are values of quadratic polynomials such as 4n² + bn + c. Some quadratics avoid small prime factors far more than others, so their diagonals are dense with primes. Euler’s n² + n + 41 is prime for n = 0 to 39 and stays unusually rich after that.

Share of prime values for n = 1 to 10000 for six quadratic polynomials. Euler's n² + n + 41 gives 41.5% primes; n² + 1 gives 8.4%. Bateman–Horn conjecture explains the differences through how often each polynomial avoids small prime factors.
Each value tested against the sieve; for 2n² + 1 only values below 108 (n ≤ 7 071) are used. Euler’s polynomial: 41.5 percent primes for n = 1 to 10 000. Motion is off if your system asks for reduced motion.
  • Settled No non-constant polynomial with integer coefficients takes only prime values (Goldbach, 1752, in substance).
  • Open Whether n² + 1 is prime infinitely often is one of Landau’s four problems (1912), open. The Bateman–Horn conjecture (1962) predicts how many prime values each polynomial should have, with a constant measuring how it avoids small divisors; it explains the bar lengths above but is unproved.
  • Reading The streaks do not reveal a formula for primes or a hidden geometric order. They are a picture of divisibility by small primes, which is the same effect that makes gaps of 6 common on the gaps page.

Reading path · step 10 of 11