prime orchestra · frontier math

The primes, played by the zeros of zeta.

Every prime leaves a step in the counting staircase, and Riemann’s explicit formula says that staircase is exactly a sum of waves, one for each nontrivial zero of the zeta function. This is that sum, live: feed the zeros in one at a time and watch the primes resolve out of pure harmonics.

Fully self-contained: one HTML file, no build step, no network. The first 300 nontrivial zeros are baked in (γ₁ = 14.1347…, γ₃₀₀ = 541.8474…).

Four channels, one signal

Riemann rebuilds Chebyshev’s staircase ψ(x) as x minus a chorus of waves, one per zero ρ = ½ ± iγ. The four scopes show the same signal from four angles.

CH·1

Reconstruction

The running sum ψ_N(x) in cyan against the true prime staircase, dashed. A live RMS-error readout tells you how close the chorus has gotten. Wheel to zoom, drag to pan, click to drop a probe.

CH·2

The wave

Zero number N on its own: one pure chirp with its ±envelope, the harmonic you just added. This is the single voice the reconstruction folds in.

CH·3

Convergence

The value at your probe point as a function of N. Watch it hunt toward the true height and overshoot, the signature of conditional convergence.

CH·4

Return map

Each step plotted as (ψ at N−1, ψ at N) against the diagonal. The reconstruction spirals in on a fixed point rather than settling clean.

Play it

  1. 1Hit ▶ RESOLVE and let the zeros pour in. It starts slow for the first fifteen so you can watch the primes precipitate out of noise, then accelerates.
  2. 2Drag and zoom CH·1 to chase a single prime, then click to set the probe and watch CH·3 converge on that exact point.
  3. 3Flip LOG X. On a log axis every chirp becomes a pure sine wave, which is the real reason the formula works: the zeros are frequencies.

The formula, spelled out

The Riemann–von Mangoldt explicit formula, exactly what the top scope plots:

ψ(x) = x − Σ_ρ x^ρ/ρ − log(2π) − ½·log(1 − x⁻²)

Zeros come in conjugate pairs, so each pair collapses into one real wave whose frequency is the zero’s height γ:

W_k(x) = −(2√x / |ρ_k|) · cos(γ_k · log x − α_k)

Truncate at 300 zeros and you get ψ_N(x). It never fully converges: the explicit formula converges only conditionally, in zero order, as N → ∞. The ringing at each prime jump is Gibbs’ phenomenon, a truncated Fourier series meeting a discontinuity. That is the demonstration, not a defect.