Silicon Logic
SL · /primes · 26.05
§ 11 · Instrument Filed 2026.05 · Reference SL · 26 · 011

Wind the integers and watch primes refuse to scatter.

Stanisław Ulam scribbled this during a dull seminar in 1963. Number the plane in a square spiral, mark the primes, and the diagonals appear by themselves — patterns we still can't fully explain. Zoom, pan, switch modes. At the foot of the page, the first dozen zeros of the Riemann zeta function — the deepest known music in the prime numbers.

Drag to pan · Scroll to zoom · Pinch on touch Plain primes
Prime
Integers shown 1 — 1 Primes 0 Cell 12 px
Cell size
12 px
Sieve speed
Sieve control
Labels

The other side of the same coin

§ 02 · Zeta zeros
First 12 nontrivial zeros · ζ(½ + it) = 0
Why these matter

The diagonals you see on the spiral and these dots on the line are the same fact, twice.

Riemann's zeta function ζ(s) is built from the primes — yet its complex zeros, conjectured to all lie on the line Re(s) = ½, control how the primes are distributed down the number line. Every wobble in the prime-counting function π(x) corresponds to one of these dots. Prove they all sit on the line and you've proved the Riemann hypothesis: a million-dollar problem, and the closest thing mathematics has to a master key for the primes.

t₁  = 14.134725
t₂  = 21.022040
t₃  = 25.010858
t₄  = 30.424876
t₅  = 32.935062
t₆  = 37.586178
t₇  = 40.918719
t₈  = 43.327073
t₉  = 48.005151
t₁₀ = 49.773832
t₁₁ = 52.970321
t₁₂ = 56.446248

What you're looking at

§ 03 · Notes
A
The spiral itself is just bookkeeping. 1 sits at the centre; 2 to the right; 3 above; integers wind outward counter-clockwise forever.
B
Diagonals are quadratic. Each one is the trace of an integer polynomial like 4n²+2n+1 — values that, for unexplained reasons, contain many primes.
C
Gaussian split colours rational primes by how they behave in ℤ[i]: p ≡ 3 mod 4 stay prime; p ≡ 1 mod 4 split into two Gaussian primes a + bi.
D
Twin primes are pairs (p, p+2). Whether infinitely many exist is open. Polymath8 and Maynard have pushed the bounded gaps frontier hard since 2013.
E
Prime-gap colouring goes warm for small gaps, cool for large. The biggest gaps you see scrolling out are mostly between primes that are themselves stuck between long composite runs.
F
The sieve mode replays Eratosthenes (≈200 BCE). For each new prime p, every multiple 2p, 3p, … is struck out — what survives is prime, computed without a single division.
Implementation notes — how the spiral and the sieve are computed

The Ulam spiral has a closed-form inverse: for a lattice point (x, y) at Chebyshev distance k = max(|x|,|y|), the previous ring ends at (2k−1)² and the four sides of ring k give the integer at (x,y) in O(1). Drawing is therefore a single pass over visible cells — no spiral walk, no precomputed array of positions.

Primes are produced by a classical sieve of Eratosthenes up to the largest integer currently on screen, extended in segments whenever you zoom further out. The animation in Sieve mode replays that same algorithm at a configurable rate so you can see the composites being struck out, prime by prime, in spiral order.

Twin pairs are flagged by walking the prime list once; gap-colour uses the difference to the previous prime, mapped through a perceptual warm-to-cool ramp clamped at gap 50.

The 12 zeta-zero heights are hard-coded — they are constants of nature, like π. The plot draws Re(s) = ½ as a vertical critical line with each tₖ as a dot whose halo brightness fades with height, hinting that they continue forever upward.