What you are playing
There is a single equation, written down by Bernhard Riemann in 1859 and made rigorous by von Mangoldt in 1895, that says the primes and the zeros of the zeta function are two views of one object. In the form this instrument uses it reads
ψ(x) = x − log 2π − ½·log(1 − x⁻²) − Σρ xᵨ⁄ρ
The left side, ψ(x), is the Chebyshev staircase: add up log p for every prime power pᵏ below x. It is pure arithmetic — it knows nothing of waves. The right side is the smooth part (the first three terms) minus a sum over the zeros ρ = ½ + iγ. Each conjugate pair of zeros contributes one real wave: (2√x / |ρ|)·cos(γ·log x − arg ρ). That is one fader.
The primes are not the notes. The primes are the chord all the zeros make when they play together.
So the staircase you watch sharpen is not an approximation of the formula — it is the formula, term by term, exactly as far as you have pushed the faders. With every zero up it would converge (in the averaged sense; pointwise it rings near each jump, the honest Gibbs ripple you can see) onto the true orange staircase. The number in the corner is the real mean error between your mix and the genuine staircase: a smaller number means your chosen zeros are doing more of the primes' work.
Why it is a chord, and an eerie one
Change variables to u = log x. Then each zero's wave becomes cos(γ·u − arg ρ) — a pure tone of frequency γ, the zero's own height. Sweep u forward at a steady rate and you are literally playing the staircase: the up zeros sound as fixed pitches while the playhead traces the curve they build. Their frequencies are the real γₙ = 14.13, 21.02, 25.01, 30.42, …, which are not whole-number multiples of each other. So the chord of the primes is inharmonic — it does not fuse into one warm note the way a plucked string does; it shimmers, a little restless, a little metallic. That restlessness is a true fact about where the zeros sit.
Their loudnesses are true too. The amplitude of the n-th partial is ∝ 1/|ρₙ|, so the lowest zeros are loudest and the high ones fade — exactly the weights in the formula. Audition a single fader and you hear one pure zero; that same tap lights its lone cosine on the staircase, one gentle corrugation that, alone, barely dents the arithmetic. Stack them and the steps appear.
What is real, and what is a choice
Every wave and every pitch is the explicit formula, not an imitation of it. The 64 zeros are mpmath.zetazero values, validated against Odlyzko's published imaginary parts (to better than 10⁻⁷); the staircase ψ(x) is sieved directly from the prime powers; the reconstruction is summed in the same double-precision arithmetic the browser runs. The numbers, the convergence, and the identity that each fader is exactly one independent term are checked in research/the-primes-played/ (and the deeper math in harmonics-of-the-primes/).
The one free choice is the base pitch — where we put the lowest zero's tone so the rest land in your speakers. Everything above it (the ratios γₙ/γ₁, the relative loudnesses, the decay) is fixed by the mathematics. The struck-chord decay is a mild modelling choice, the same for every zero so no zero is flattered over another.
The honest edge. This instrument draws every zero on the critical line Re(s) = ½. The computed ones really do lie there, but the claim that all of them do is the Riemann Hypothesis — unproven, a Clay Millennium problem. The explicit formula holds wherever the zeros are; the Hypothesis only controls how loud the high partials are allowed to grow. Nothing here proves it, and the instrument never pretends to.
Sources
- B. Riemann, "Ueber die Anzahl der Primzahlen unter einer gegebenen Grösse," Monatsberichte der Berliner Akademie (1859) — the formula, conjectured.
- H. von Mangoldt, "Zu Riemanns Abhandlung…," J. reine angew. Math. 114 (1895) — the first rigorous proof of the explicit formula.
- H. M. Edwards, Riemann's Zeta Function (1974) — the standard modern derivation of the form used here.
- B. Mazur & W. Stein, Prime Numbers and the Riemann Hypothesis (2016) — the staircase-and-spectrum picture this instrument plays.
- A. M. Odlyzko, tables of the zeros of the Riemann zeta function — the published γₙ the data is validated against.
An exhibit in the Wasteland's instrument room — hearable mathematics, where every sound is the object. It is the playable companion to the stratum The Harmonics of the Primes, which builds the formula in both directions and reads the zeros back out of the primes.