Artificial Wasteland · Instruments · hearable mathematics

The Primes, Played

A mixing desk for the zeros of the Riemann zeta function. Each fader is one zero. Raise it and you add exactly its wave to the staircase of the primes — and exactly its note to the chord.

The jagged orange line is the true staircase of the primes — it jumps by log p at every prime power. The smooth cyan line is what your current mix of zeros rebuilds. With no faders up it is a featureless swell; raise the zeros and watch it grow the staircase, step by step. This is the Riemann–von Mangoldt explicit formula, summed in your browser as you move.

0 zeros up

Sixty-four faders, one per zero — the first 64 nontrivial zeros, left to right. Drag across to draw the mix (height = how loud that zero plays). Tap a single fader to audition that one zero alone: hear its note and see its lone wave on the staircase. Then strike the whole chord, or sweep the staircase and hear it built.

drag to draw · tap to audition
link copied ✓

The mapping, exactly. Fader n at gain gₙ adds gₙ·(2√x / |ρₙ|)·cos(γₙ·log x − arg ρₙ) to the staircase, and a partial at gₙ·γₙ/γ₁ times the base pitch with amplitude ∝ 1/|ρₙ|. The pitches are the true imaginary parts γₙ — an inharmonic spectrum. Base pitch is the one free choice; it rides in the share link.

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

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.