Computing Zeros: the Riemann–Siegel Formula

We have said, almost in passing, that computers have checked more than ten trillion zeros of the Riemann zeta function and found every one sitting exactly on the critical line. That sentence hides an enormous practical question: how do you even evaluate \zeta(\tfrac12 + it) when t is a number like 10^{20}? The defining series \sum n^{-s} does not converge on the critical line at all, and the honest approximations that do work seem to need a hopeless number of terms.

The tool that cracks this open is the Riemann–Siegel formula — a way of computing \zeta high up the critical line using only about \sqrt{t/2\pi} terms instead of about t of them. It is the workhorse behind every large-scale verification of the Riemann Hypothesis, and this page is the story of how the zeros are actually found — and, just as importantly, how a pile of numerics is turned into a genuine proof for the range searched.

The challenge: too many terms

On the critical line write s = \tfrac12 + it. The Dirichlet series \zeta(s) = \sum_{n\ge1} n^{-s} only converges for \Re(s) > 1, so it is useless here — we must use the analytic continuation. The classical workhorse for that is the Euler–Maclaurin summation formula: sum the first M terms of \sum n^{-s} exactly, then patch on an integral and a tail of correction terms. To get an accurate value at height t you need to push M out to roughly t itself.

That is fine for t = 30. It is a catastrophe for t = 10^{12}: a trillion terms per zeta value, and you need a zeta value at every candidate zero. Verifying the Riemann Hypothesis to great heights with Euler–Maclaurin would be like counting the atoms in a bucket one at a time. We need something dramatically faster.

A real-valued stand-in: Hardy's Z(t)

The trick that makes zero-hunting practical is to stop looking at the complex number \zeta(\tfrac12+it) and look instead at a clever real-valued function that carries exactly the same zeros. Define the \theta phase (the Riemann–Siegel theta function) by

\theta(t) = \arg\Gamma\!\left(\tfrac14 + \tfrac{it}{2}\right) - \tfrac{t}{2}\log\pi,

and then Hardy's function

Z(t) = e^{i\theta(t)}\,\zeta\!\left(\tfrac12 + it\right).

This is a huge simplification. Locating a complex zero becomes the grade-school task of watching a real graph cross the horizontal axis. Every zero we can see Z cross is a zero we have proved lies on the line — the phase factor e^{i\theta(t)} has done the work of pinning the real part to \tfrac12 for us.

The Riemann–Siegel formula

Here is the payoff. Let N = \left\lfloor \sqrt{t/2\pi} \right\rfloor. Then Z(t) is given by a short main sum plus a small, computable correction:

Z(t) = 2\!\!\sum_{n \le \sqrt{t/2\pi}} \frac{1}{\sqrt{n}}\,\cos\!\big(\theta(t) - t\log n\big) \;+\; R(t),

The magic is entirely in the summation bound. Where Euler–Maclaurin needed about t terms, the Riemann–Siegel main sum needs only about \sqrt{t} of them — a square-root speedup that turns the impossible into the routine. The remainder R(t) is not a vague error bar: it is a genuine asymptotic series (the leading term involves a smooth function of the fractional part of \sqrt{t/2\pi}), and taking a handful of its terms is enough for high-precision work.

Worked example: how many terms at t \approx 10^{6}?

Take a zero somewhere near height t = 10^{6}. The Riemann–Siegel main sum runs up to

N = \left\lfloor \sqrt{\tfrac{10^{6}}{2\pi}} \right\rfloor = \left\lfloor \sqrt{159154.9\ldots}\, \right\rfloor = \lfloor 398.9\ldots \rfloor = 398.

So about 400 terms — a sum you could add up by hand in an afternoon. Contrast that with the Euler–Maclaurin approach, which at the same height needs on the order of t/2\pi \approx 159{,}000 terms, and the naive Dirichlet series, which needs infinitely many and still would not converge. Four hundred versus a hundred and sixty thousand: that ratio is precisely \sqrt{t/2\pi} against t/2\pi, and it only grows more lopsided as t climbs. At t = 10^{12} it is roughly a million terms instead of a trillion.

Seeing the zeros: the graph of Z(t)

Below is Z(t) for t from 8 to 50, computed straight from the Riemann–Siegel main sum (with the Stirling phase and the leading remainder term). Each place the curve crosses zero is a genuine non-trivial zero of \zeta sitting on the critical line. The first crossings fall at the famous heights t \approx 14.13, 21.02, 25.01, 30.42, 32.94, 37.59, 40.92, 43.33, 48.01, and 49.77.

This is what every large computation is really watching: a real curve wiggling above and below the axis, and a careful count of exactly where it changes sign. The whole game is (a) evaluating this curve cheaply — that is Riemann–Siegel — and (b) proving you have not missed a crossing.

Gram points and Gram's law

Sign changes are easy to see but you need a systematic way to find them. Enter the Gram points. The n-th Gram point g_n is the height where the phase \theta passes a multiple of \pi:

\theta(g_n) = n\pi, \qquad n = -1, 0, 1, 2, \dots

At a Gram point the phase e^{i\theta} is real, so Z(g_n) tends to line up with the sign of (-1)^n — that is, Z is usually positive at even Gram points and negative at odd ones. When that pattern holds, each Gram interval [g_n, g_{n+1}] contains exactly one zero, neatly interlacing the zeros with the Gram points. This tidy expectation is Gram's law.

Gram's law gives you a cheap, almost-always-correct way to guess how many zeros lie below a height and roughly where each one is: count the Gram points, expect one zero between each consecutive pair. For small t it is uncannily reliable. But — and this is the crucial word — it is only a heuristic, not a theorem, and leaning on it too hard is exactly the trap the next box is about.

Two traps hide in this page, and they are close cousins of the "evidence is not proof" warning from the Riemann Hypothesis itself.

First: computing that the first 10^{13} zeros all lie on the critical line does not prove the Riemann Hypothesis. There are infinitely many zeros; a finite search, however staggering, only settles a finite prefix. A single stray zero off the line at height 10^{40} would demolish the conjecture, and no computer will ever reach there directly.

Second: Gram's law is false — it fails infinitely often. The first failure already occurs at the 127-th Gram interval, and violations only become more common higher up (near height t a positive proportion of Gram intervals break the rule). So you cannot simply count Gram points and declare victory: sometimes a Gram interval holds two zeros, or none, and the interlacing breaks. Treating Gram's law as if it were a theorem would let you miss or double-count zeros — which is why the honest verifications never rely on it for the final count. That rigour comes from Turing's method, next.

Turing's method: turning numerics into a proof

How do you prove — not guess — that every zero up to a height T has been found and lies on the line, with none skipped off it? The answer is a beautiful idea of Alan Turing's. Start from the exact zero-counting formula (the Riemann–von Mangoldt formula), which says the number of zeros with imaginary part in (0, T) is

N(T) = \frac{\theta(T)}{\pi} + 1 + S(T), \qquad S(T) = \frac{1}{\pi}\arg\zeta\!\left(\tfrac12 + iT\right).

The smooth piece \theta(T)/\pi + 1 is known exactly. Everything mysterious is bundled into the fluctuating term S(T). The key fact Turing exploited is that S(T) cannot be large on average: its integral is provably bounded, so S(T) spends most of its time near zero and cannot drift far for long.

This is the punchline of the whole computational programme. Riemann–Siegel makes it cheap to evaluate Z(t); Turing's method makes the resulting count rigorous. Turing himself ran it on an early electronic computer in 1953. The exact same two-sided squeeze — count what you see, bound what can exist, check they match — still certifies the record-breaking searches today.

Going enormous: the Odlyzko–Schönhage algorithm

Riemann–Siegel evaluates Z(t) at one height for about \sqrt{t} arithmetic operations. But a real search wants Z(t) at many thousands of nearby heights at once, and doing them one-by-one still costs \sqrt{t} each. In the late 1980s Andrew Odlyzko and Arnold Schönhage found how to evaluate the main sum at a whole grid of points simultaneously, sharing the work through a fast, FFT-like / fast-multipole machinery. This amortises the cost so that many values come out for little more than the price of one.

The consequences were spectacular. Odlyzko used the method to compute zeros near astronomical heights — around 10^{20} and beyond — to study their fine statistics (which, remarkably, match the eigenvalue spacings of random matrices). Large distributed projects have used these ideas to verify that the first \sim 10^{13} zeros all lie exactly on the critical line. Every last one, checked and certified by Turing's method, sits on \Re(s) = \tfrac12.

The formula is called Riemann–Siegel for a wonderful reason. Riemann derived it privately around 1859 — but he published nothing of it, and it lay hidden in his chaotic personal notes, the Nachlass, in the Göttingen library. For seventy years mathematicians assumed Riemann's scribbles were just rough working. Then, in 1932, Carl Ludwig Siegel dug through the notebooks, decoded the cryptic calculations, and revealed that Riemann had already possessed this powerful formula — decades ahead of everyone. Siegel reconstructed and published it, and it turned out to be far better than anything developed in the intervening years. Riemann had been sitting on the state-of-the-art algorithm for computing his own zeros, and never told a soul.

What this does — and doesn't — tell us about RH

It is worth being crisp about the epistemic status of all this. The computations, certified by Turing's method, prove a real theorem: all non-trivial zeros up to the searched height T are simple, lie exactly on the critical line, and none has been missed. That is genuine mathematical knowledge, not mere sampling.

What it does not do is prove the Riemann Hypothesis. The hypothesis is a claim about all zeros, of which there are infinitely many; any finite T, however vast, leaves infinitely many zeros unchecked. The computations are also a superb disproof engine: had a single zero ever appeared off the line, RH would be dead. None ever has. So the numerics deliver overwhelming evidence and a growing certified range — but the summit, a proof for every zero, remains unclimbed.