Readout
The spiral is a square grid, so on a wide window its top and bottom run past the frame; the counts include them. 1 / ln N is the prime number theorem's estimate. The measured density runs about a point high — 1 / ln N always undershoots at sizes this small — but it tracks the same slow decline, and then the diagonals break it locally.
Inspect
- Breakdown
- —
- Position
- —
- Neighbours
- —
Click a cell, or focus the grid and walk it with the arrow keys.
Trace a formula
—
Why it's odd
Primes have no formula and no pattern anyone can predict. Yet Stanisław Ulam, doodling through a dull talk in 1963, spiralled the integers onto graph paper and the diagonals jumped out at him.
The reason isn't magic: each diagonal of the spiral is a quadratic, and a quadratic
whose constant term is chosen well can dodge division by 2, 3, 5, 7 and more, so it hits
primes far above its fair share. Euler's n² + n + 41 is the champion — it turns
out prime for forty values in a row. Start the spiral at its own constant and any of
these four traces the same cells, the middle anti-diagonal; only the constant changes,
and the difference in how much of that one line lights up is the whole show.