2, 3, 5, 7, 11, 13… The primes look like noise — no formula, no rhythm. They are not noise. Buried inside their scatter is a set of pure frequencies, and the same frequencies, played backwards, rebuild the primes exactly. This page walks across that bridge in both directions, and lets you hear it.
In 1859, in the only paper he ever published on number theory — barely nine printed pages — Bernhard Riemann found the deepest fact anyone knows about the primes. He was studying a function, ζ(s), the sum 1 + 1/2ˢ + 1/3ˢ + 1/4ˢ + …, extended to the complex plane. He noticed it has a special set of points where it vanishes — its nontrivial zeros — and he wrote down an exact formula that turns those zeros into the count of primes. Not an approximation. An equals sign between the primes and the zeros.
The zeros sit at heights ½ + iγ on a single vertical line, climbing forever: the first at γ₁ = 14.1347…, the next at 21.0220…, then 25.0109…, and on up. Each one is a frequency. In Riemann's formula, each zero contributes a wave that wobbles like cos(γ log x) — and when you add the waves up, the wobbles conspire to land precisely on the prime numbers. The primes are a chord. The zeros are its notes.
The primes are the music; the zeros are the frequencies it is played at. Riemann's formula is the sheet music — and it reads in both directions.
That two-way reading is what this page is. Most accounts show one direction: zeros → primes. But a formula with an equals sign can be read backwards too, and the backwards reading is just as true and far stranger: the primes, on their own, remember where every zero is. Below, you build the primes out of the zeros (Instrument I) and then read the zeros back out of the primes (Instrument II). Nothing here is asserted; every curve is computed in your browser as you watch.
The cleanest version of Riemann's formula uses not the primes themselves but a close cousin, the prime staircase ψ(x) (Chebyshev's function): start at zero and, at every prime p and every prime power p², p³, … up to x, step up by log p. It climbs in lockstep with x itself — that's the prime number theorem — so the interesting part is the jitter around that climb. The exact, proven formula for it is:
The whole staircase — every jump at every prime — is hiding in that middle sum over the zeros ρ. Below, the copper staircase is the truth (computed directly by counting prime powers). The cyan curve is built only from the zeros, through the formula. Drag the slider to add zeros one at a time and watch the smooth curve grow teeth that snap onto the primes. Then strike the chord: each zero becomes a sine wave whose loudness is its actual weight 2/|ρ| in the formula — you are hearing the exact terms of the sum.
Two honest things you can see immediately. First, the curve never sits perfectly still on the steps — it rings, overshooting at each jump. That ringing is real (it is the Gibbs phenomenon, the same overshoot a Fourier series makes at a cliff): the sum over zeros converges, but slowly and conditionally, and never term-by-term cleanly. Second, the averaged error genuinely shrinks as you add zeros — the readout tracks it — so the staircase really is in there; it just takes infinitely many notes to render a perfect corner. Switch the view to “the harmonics” to subtract the climb and see the zeros' chorus on its own: a sum of waves, beating against each other, that happens to spell the primes.
Now backwards. Suppose you had never heard of the zeta function — you only had a list of primes. Could you find the zeros? Riemann's equals sign says you must be able to: the information is the same on both sides. So take the primes alone and ask which frequencies they are built from. Form the sum over prime powers
— literally probing the primes with a wave of frequency t and asking how strongly they resonate. Sweep t upward and the answer is almost always near zero… except at a handful of special frequencies where the primes ring like a struck bell. The cyan ticks below mark the true zeros γₙ. The copper spectrum is built only from primes — it has never been told where the zeros are. Watch where its peaks fall. Push the slider to use more primes and the peaks sharpen onto the ticks.
The peaks sit on the ticks to within a fraction of a unit, and tighten as you add primes — the finite width is the honest cost of using finitely many primes, not a fudge (a smooth raised-cosine window suppresses the truncation ringing so the resonances read cleanly). This is the same equation as Instrument I, read the other way. The primes and the zeros are two encodings of one object. Neither is more fundamental; each is a Fourier transform of the other.
A list of primes is a recording. Run it through this prism and the Riemann zeros are the spectral lines — the colours the primes are made of.
Everything above used the zeros as data — 150 of them, computed and checked (see the apparatus). But it quietly assumed something no one has proved. Every zero this page draws sits on the line Re(s) = ½. That all of them do — every last one of the infinitely many — is the Riemann Hypothesis. Riemann himself only called it "very probable" and, by his own words, "put aside" the search for a proof as inessential to his purpose; 167 years later it is still open. It is one of the seven Clay Millennium Prize Problems; a proof is worth a million dollars and, far more, would pin down the error in every estimate of how the primes are distributed.
The formula itself does not need the hypothesis — it holds wherever the zeros actually are. What the hypothesis controls is the tightness: a zero off the line at real part β > ½ would contribute a wave growing like xᵝ instead of √x, and the prime staircase would wander further from its climb than anyone has ever seen it wander. Every zero checked so far — and the first ten trillion of them were verified by Xavier Gourdon in 2004, with rigorous checks since pushing to great heights — lies exactly on the line. That is overwhelming evidence and not a proof, and the distinction is the whole game.
There is a tantalizing reason to think the line is special. The heights γₙ are spaced like the energy levels of a heavy atomic nucleus — more precisely, like the eigenvalues of a large random Hermitian matrix (the GUE of random-matrix theory). That match was noticed at tea in 1972, when Hugh Montgomery described his formula for how the zeros pair up and Freeman Dyson recognized it instantly as the one from nuclear physics. If the zeros really are the spectrum of some unknown quantum system — the Hilbert–Pólya dream — then they would lie on a line because the eigenvalues of such an operator are forced to be real. No one has found the operator. The duality you just played with may be a shadow of it.
The zeros are data, validated. The 150 imaginary parts γₙ used here were computed with mpmath.zetazero (a Riemann–Siegel-based, high-precision routine) and cross-checked against the standard published values: the first fifteen agree with the literature to better than 10⁻⁷. The first is 14.134725141734693…. The validation script, the convergence tests, and a second independent re-derivation in double precision all live in /research/harmonics-of-the-primes/ in this site's repository — run them and you get these bytes back.
Instrument I is verified against ground truth. The copper staircase ψ(x) is computed directly by sieving prime powers — it owes nothing to the zeros. The cyan reconstruction uses only the formula above. Offline, the averaged reconstruction error over x ∈ [20.5, 99.5] was confirmed to fall monotonically as zeros are added (≈0.87 at 10 zeros → ≈0.27 at 150); the pointwise ringing that remains is the Gibbs phenomenon, not an error in the code. The audio is honest additive synthesis: amplitude ∝ 1/|ρ|, the term's true weight; the frequencies are γₙ scaled into the audible band (a constant factor — the ratios are exact).
Instrument II is the same formula read backwards. The peaks of D(t) were checked offline to land on the true γₙ to within ≈0.001 once a raised-cosine window is applied, sharpening as X grows. The window is disclosed, not hidden; without it the truncation produces honest sidelobes.
What is assumed vs. proven. Drawing every zero on the line Re=½ assumes the Riemann Hypothesis for the picture; the computed zeros really do lie there, but that all zeros do is unproven. The explicit formula (Riemann 1859; first rigorously proved by von Mangoldt, 1895) holds regardless. The "music of the primes" framing follows Marcus du Sautoy (2003); the spectrum-from-primes construction follows Mazur & Stein, Prime Numbers and the Riemann Hypothesis (2016). The random-matrix connection is Montgomery (1973) and Odlyzko's numerics; the Montgomery–Dyson tea is the documented 1972 anecdote.
Sources · Explicit formulae (von Mangoldt) · Riemann hypothesis · Chebyshev ψ function · Montgomery's pair correlation · Hilbert–Pólya · Mazur & Stein, Prime Numbers and the Riemann Hypothesis (CUP 2016).
Riemann guessed the line; we have walked ten trillion zeros up it and not one has stepped off. The primes keep their music in tune to a precision no one can yet explain — and somewhere above the heights any computer has reached, the hypothesis is either true or it is broken, and the whole architecture of the primes hangs on which.