Number Theory

The Explicit Formula: Primes as a Sum Over Zeta Zeros

The distribution of prime numbers — seemingly the most erratic sequence in mathematics — is governed by a set of complex numbers sitting on a vertical line, and the explicit formula spells out that governance letter by letter. Riemann's explicit formula (1859), made rigorous by von Mangoldt (1895), says the prime-counting quantity ψ(x) = ∑ₙ≤ₓ Λ(n) equals a smooth main term minus an oscillating correction that is literally a sum over the nontrivial zeros ρ of the Riemann zeta function.

Precisely, for x > 1 not a prime power, ψ(x) = x − ∑ρ xᵖ/ρ − log(2π) − ½ log(1 − x⁻²), where the sum runs over all nontrivial zeros ρ = β + iγ of ζ(s). Each zero contributes a wave xᵖ/ρ = x^β·(cos(γ log x) + i sin(γ log x))/ρ; the primes are the interference pattern of these waves. If every β = ½ (the Riemann Hypothesis), the error in the Prime Number Theorem shrinks to O(√x log²x) — the best possible.

  • FieldAnalytic number theory
  • Discovered / ProvedRiemann 1859; rigorous by von Mangoldt 1895
  • Statementψ(x) = x − ∑ᵨ xᵖ/ρ − log(2π) − ½ log(1−x⁻²)
  • Proof techniqueContour integration (Perron / Mellin) of −ζ'(s)/ζ(s); Hadamard product
  • Key inputζ(s) has a simple pole at s=1, nontrivial zeros ρ, trivial zeros at −2,−4,…
  • Generalizes toWeil explicit formula for all automorphic L-functions

Interactive visualization

Press play, or step through manually. The visualization is yours to drive — try it before reading on.

Open visualization fullscreen ↗

Watch the 60-second explainer

A condensed visual walkthrough — narrated, captioned, under a minute.

1. The precise statement

Let Λ(n) be the von Mangoldt function: Λ(n) = log p if n = pᵏ is a prime power, and 0 otherwise. Define the Chebyshev function ψ(x) = ∑ₙ≤ₓ Λ(n). The von Mangoldt explicit formula states that for every real x > 1 that is not a prime power,

ψ(x) = x − ∑ᵨ xᵖ/ρ − log(2π) − ½ log(1 − x⁻²).

Here ρ ranges over the nontrivial zeros of ζ(s) (those with 0 < Re ρ < 1), the sum being taken as lim_{T→∞} ∑_{|Im ρ| ≤ T} (the zeros are paired ρ, ρ̄ so the imaginary parts cancel and the sum is real). The term x is the residue of the pole of −ζ'/ζ at s = 1; −½ log(1−x⁻²) = ∑ₖ₌₁^∞ x⁻²ᵏ/(2k) packages the trivial zeros at s = −2, −4, −6, …; and −log(2π) = −ζ'(0)/ζ(0) (equivalently ζ'(0)/ζ(0) = +log 2π). Every symbol on the right is forced by the pole-and-zero structure of ζ.

2. The picture: primes as an interference pattern

Read the formula as a signal decomposition. The main term x is the smooth trend: on average there are dx worth of "prime-power weight" near x, matching the Prime Number Theorem ψ(x) ∼ x. Everything interesting lives in −∑ᵨ xᵖ/ρ. Pairing a zero ρ = β + iγ with its conjugate gives

−(xᵖ/ρ + xᵖ̄/ρ̄) = −2 x^β/|ρ| · cos(γ log x − arg ρ).

So each zero contributes a cosine wave in the variable log x, with frequency γ, amplitude x^β/|ρ|, and a phase. The primes are the sum of infinitely many such waves. The lowest zeros γ₁ ≈ 14.13, γ₂ ≈ 21.02, γ₃ ≈ 25.01 produce the dominant "long-wavelength" ripples you see when you plot ψ(x) − x. If the Riemann Hypothesis holds, every amplitude scales like √x, so the ripples never grow faster than √x relative to the trend — the zeros are a tuning fork and their real parts set the volume.

3. Key idea of the proof: integrate −ζ'/ζ and count residues

The engine is the identity −ζ'(s)/ζ(s) = ∑ₙ₌₁^∞ Λ(n) n⁻ˢ (Re s > 1), obtained by logarithmically differentiating the Euler product ζ(s) = ∏ₚ (1−p⁻ˢ)⁻¹. Perron's formula recovers the partial sum as a contour integral:

ψ₀(x) = (1/2πi) ∫_{c−i∞}^{c+i∞} (−ζ'(s)/ζ(s)) · (xˢ/s) ds, c > 1.

Now push the contour left to Re s = −∞. By the residue theorem (justified by contour-shift bounds on ζ'/ζ using its Hadamard product), each pole of the integrand contributes: the pole of −ζ'/ζ at s = 1 gives the residue x·(x⁰… ) = x; a nontrivial zero ρ (a pole of ζ'/ζ with residue equal to its multiplicity) gives −xᵖ/ρ; the pole at s = 0 from the 1/s factor gives −ζ'(0)/ζ(0) = −log 2π; and the trivial zeros at s = −2k give the +∑ x⁻²ᵏ/2k tail. Summing all residues is the explicit formula. The hard analytic labor is proving the horizontal segments of the contour vanish, which needs the zero-density and −ζ'/ζ growth estimates.

4. Worked special case: recovering ψ(x) ∼ x

Take the formula and bound the zero sum crudely. Group zeros in dyadic blocks of |γ|; the number of zeros with |γ| ≤ T is N(T) = (T/2π) log(T/2π) − T/2π + O(log T) (the Riemann–von Mangoldt counting formula). Since |xᵖ/ρ| = x^β/|ρ| ≤ √(x^β·x^β)/|γ| and 0 < β < 1, each term is o(x), and the whole sum is o(x) once you know no zero has β = 1. That last fact — ζ(1+it) ≠ 0, proved by Hadamard and de la Vallée Poussin in 1896 via 3 + 4cos θ + cos 2θ ≥ 0 — is exactly what makes ∑ᵨ xᵖ/ρ = o(x), hence ψ(x) = x + o(x), the Prime Number Theorem. Concretely at x = 100: the true ψ(100) ≈ 94.04, the main term is 100, and the leading zero pair ρ = ½ ± 14.13i contributes −2·10/14.14·cos(14.13·log 100 − arg ρ) ≈ a few units of the ~6-unit gap. The remaining zeros fill in the rest.

5. Why the hypotheses matter — and what RH would sharpen

Three hypotheses are load-bearing. (a) x not a prime power: at x = pᵏ, ψ jumps by log p, so ψ(x) is discontinuous there; the formula holds for the symmetric value ψ₀(x) = ½(ψ(x⁺)+ψ(x⁻)) exactly as Fourier series converge to the midpoint at jumps. (b) ζ(1+it) ≠ 0: if a zero sat on Re s = 1, its term would be of size x/|ρ|, comparable to the main term, and PNT would fail — the non-vanishing on the 1-line is not a technicality but the crux. (c) Convergence order: the sum ∑ᵨ xᵖ/ρ converges only conditionally and only with the symmetric |γ| ≤ T truncation, because ∑ 1/|ρ| diverges while ∑ 1/|ρ|² converges. Dropping the pairing destroys convergence. Under the Riemann Hypothesis (every β = ½), one gets the sharp ψ(x) = x + O(√x log²x); conversely that error bound implies RH — the explicit formula makes the two equivalent.

6. Significance: what the explicit formula unlocks

The explicit formula is the dictionary between primes and zeros, and nearly all of analytic number theory reads through it. It gives the Prime Number Theorem and its error term; it powers zero-free regions (a wider region ⇒ smaller error), yielding de la Vallée Poussin's O(x·exp(−c√log x)) and the Vinogradov–Korobov improvement. Generalized to Dirichlet L-functions it gives primes in arithmetic progressions (Dirichlet's theorem quantified). Weil's 1952 reformulation recasts it as a duality/positivity statement — RH ⇔ a positive-definiteness of a certain distribution — the starting point for the Weil, Guinand, and Riemann–Weil explicit formulas over global fields, and for the trace-formula analogies (Selberg trace formula, the conjectural spectral interpretation of the zeros). It also underlies Montgomery's pair correlation and the random-matrix (GUE) statistics of the zeros. In short: understand the zeros, and via the explicit formula you understand the primes.

The three counting functions and their explicit formulas — ψ is the cleanest because its Dirichlet series has the simplest logarithmic derivative.
Counting functionDefinitionExplicit formula (main + zero sum)
ψ(x) — Chebyshev∑ₙ≤ₓ Λ(n)x − ∑ᵨ xᵖ/ρ − log 2π − ½ log(1−x⁻²)
θ(x) — Chebyshev∑ₚ≤ₓ log p∑ₖ μ(k) ψ(x^{1/k}) = ψ(x) − ψ(√x) − ψ(∛x) − ψ(x^{1/5}) + ψ(x^{1/6}) − …
Π(x) — Riemann∑ₚᵏ≤ₓ 1/kli(x) − ∑ᵨ li(xᵖ) − log 2 + ∫ₓ^∞ dt/(t(t²−1)log t)
π(x) — prime count#{p ≤ x}∑ₖ (μ(k)/k) Π(x^{1/k}) (Möbius inversion of Π)

Frequently asked questions

Why is the sum over zeros taken symmetrically in |Im ρ| ≤ T?

Because ∑ᵨ 1/|ρ| diverges (it behaves like ∑ 1/(γ log γ)), the series ∑ᵨ xᵖ/ρ is only conditionally convergent. Pairing each zero ρ = β + iγ with its complex conjugate ρ̄ = β − iγ makes the terms real and produces cancellation; the symmetric limit lim_{T→∞} ∑_{|γ|≤T} then converges. What genuinely converges absolutely is ∑ᵨ 1/|ρ|², which is why the smoothed/weighted versions of the formula are analytically cleaner.

What is the role of the term −½ log(1 − x⁻²)?

It is the contribution of the trivial zeros of ζ at s = −2, −4, −6, …. Summing their residues −x^{−2k}/(−2k) gives ∑ₖ x⁻²ᵏ/(2k) = −½ log(1 − x⁻²). It is tiny — O(x⁻²) — so it never affects the asymptotics, but it must be present for the formula to be an exact identity rather than an approximation.

Does the explicit formula assume the Riemann Hypothesis?

No. The formula holds unconditionally: it is an exact identity valid regardless of where the nontrivial zeros lie, as long as you sum over the actual zeros ρ. RH enters only when you want the sharp error bound: if all β = ½ then each amplitude x^β = √x, giving ψ(x) = x + O(√x log²x). Without RH you still get PNT (from ζ(1+it) ≠ 0) but with a weaker error term.

Why prove it for ψ(x) rather than for π(x) directly?

Because −ζ'(s)/ζ(s) = ∑ Λ(n)n⁻ˢ has the simplest possible pole/zero structure: a single pole at s=1 and poles at each zero of ζ, with residues equal to zero multiplicities. The Dirichlet series generating π(x) is log ζ(s), which has branch points at the zeros rather than poles, making contour integration far messier. One recovers π(x) from ψ(x) or Π(x) afterward by partial summation and Möbius inversion, absorbing the ½, ⅓ prime-power corrections.

What breaks if x is exactly a prime power?

ψ(x) has a jump discontinuity of size log p at x = pᵏ, so the left- and right-hand limits differ. The explicit formula's right-hand side (a symmetric contour integral) converges to the midpoint ψ₀(x) = ½(ψ(x⁺) + ψ(x⁻)), exactly the Gibbs/Dirichlet phenomenon for Fourier-type series at a jump. So the identity as stated needs either x not a prime power or the symmetrized ψ₀.

How does the explicit formula generalize beyond ζ?

For a Dirichlet L-function L(s,χ) one replaces −ζ'/ζ by −L'/L and gets primes in the arithmetic progression class of χ; summing over characters gives Dirichlet's theorem quantitatively. More broadly, Weil (1952) recast it as ∑ᵨ ĥ(ρ) = (archimedean term) − ∑ₚ,ₖ (log p) h(k log p) for a test function h and its transform ĥ — the Weil explicit formula — valid for all automorphic L-functions, and turning RH into a positivity statement about a distribution.