The Euler Product for Zeta
Here is a sum built from every positive integer:
\zeta(s) = 1 + \frac{1}{2^{s}} + \frac{1}{3^{s}} + \frac{1}{4^{s}} + \frac{1}{5^{s}} + \cdots
It has no obvious opinion about primes at all — it happily adds up 4^{-s}
and 6^{-s} and 1000^{-s} right alongside the
prime terms. And yet it turns out to be exactly equal to an infinite product that
mentions only the primes:
\zeta(s) = \prod_{p \text{ prime}} \frac{1}{1 - p^{-s}} = \frac{1}{1-2^{-s}}\cdot\frac{1}{1-3^{-s}}\cdot\frac{1}{1-5^{-s}}\cdot\frac{1}{1-7^{-s}}\cdots
This is the Euler
product idea, now read as a statement about the
zeta function.
It is arguably the single most important identity connecting sums and primes in all
of mathematics — the precise hinge that lets analysis (limits, calculus, complex functions) reach
in and touch arithmetic (which numbers are prime).
The identity
For real (or complex) s with \Re(s) > 1,
\zeta(s) = \sum_{n=1}^{\infty}\frac{1}{n^{s}} = \prod_{p \text{ prime}} \frac{1}{1 - p^{-s}}.
The left side sees every integer; the right side sees only primes. Their equality means
\zeta is a faithful encoding of the primes — anything we learn about the
function becomes a fact about the primes, and vice versa.
Where does it come from?
The engine underneath is unique
factorisation: every integer n \ge 1 is a product of prime
powers in exactly one way. Start from the geometric series for a single prime p:
\frac{1}{1-p^{-s}} = 1 + p^{-s} + p^{-2s} + p^{-3s} + \cdots = \sum_{k=0}^{\infty} \frac{1}{(p^{k})^{s}}.
Now multiply one such series together for every prime p, and
expand the giant product term by term. Each term picks one power of 2,
one power of 3, one power of 5, and so on, and
multiplies them — producing exactly 1/n^{s} for some integer
n. Because factorisation into primes is unique, every integer
n is produced by exactly one combination of choices, so every term
1/n^{s} appears in the expansion exactly once. Collecting them
all back up gives precisely \sum_n 1/n^{s} = \zeta(s). Unique
factorisation is the whole proof, dressed in analytic clothing.
Making it concrete: where does 1/12^{s} come from?
The derivation above can feel abstract, so let's catch the machinery in the act for one specific
number. Since 12 = 2^{2} \cdot 3, the term 1/12^{s}
should appear exactly once when the giant product is expanded. Here is where it comes from:
-
from the prime-2 factor (1 + 2^{-s} + 2^{-2s} + \cdots),
pick the term 2^{-2s} (that's the "use two factors of 2" choice);
-
from the prime-3 factor (1 + 3^{-s} + 3^{-2s} + \cdots),
pick the term 3^{-s} (the "use one factor of 3" choice);
-
from every other prime's factor (5, 7, 11, \ldots), pick the
plain 1 (the "use none of this prime" choice).
Multiply the chosen terms together: 2^{-2s} \cdot 3^{-s} = (2^{2}\cdot 3)^{-s} =
12^{-s}. Because 12 factors into primes in exactly one way,
no other combination of choices could ever produce it — so this term is picked out neither
twice nor never, but exactly once. Repeat this for every integer, and the expanded product is
forced to equal the full sum \sum_n 1/n^{s}, term for term.
Even n=1 fits the pattern: pick the plain "1"
term from every single prime's factor, and the empty combination of choices multiplies out
to exactly 1 = 1^{-s}. Nothing is left over and nothing is missing —
which is exactly what "exactly once" demands.
Worked example: watching both sides meet
Euler himself already knew that \zeta(2) = \pi^2/6 \approx 1.6449 (the
famous "Basel problem"). Let's check the identity numerically at s=2 by
truncating both sides and watching them close in on the same number.
Summing the first 10 terms of the left side:
\sum_{n=1}^{10} \frac{1}{n^{2}} = 1 + \frac{1}{4} + \frac{1}{9} + \cdots + \frac{1}{100} \approx 1.5498.
Multiplying the first few factors of the right side — one for each prime up to 13:
\frac{1}{1-2^{-2}}\cdot\frac{1}{1-3^{-2}}\cdot\frac{1}{1-5^{-2}}\cdot\frac{1}{1-7^{-2}}\cdot\frac{1}{1-11^{-2}}\cdot\frac{1}{1-13^{-2}} \approx 1.6184.
Both are heading toward the same target, \pi^2/6 \approx 1.6449 — and
notice the product, built from just six primes, is already closer than the sum of
ten terms. A handful of primes carries a surprising amount of the whole sum's
weight. Run the code below to see it for yourself, and try raising the cutoffs.
function partialSum(N: number, s: number): number {
let total = 0;
for (let n = 1; n <= N; n++) total += 1 / Math.pow(n, s);
return total;
}
function isPrime(n: number): boolean {
if (n < 2) return false;
for (let d = 2; d * d <= n; d++) if (n % d === 0) return false;
return true;
}
function partialProduct(upTo: number, s: number): number {
let total = 1;
for (let p = 2; p <= upTo; p++) {
if (isPrime(p)) total *= 1 / (1 - Math.pow(p, -s));
}
return total;
}
const s = 2;
console.log("Sum, n up to 10: ", partialSum(10, s).toFixed(4));
console.log("Product, primes up to 13:", partialProduct(13, s).toFixed(4));
console.log("True value pi^2/6: ", ((Math.PI * Math.PI) / 6).toFixed(4));
The chart below plots both running totals as the cutoff grows — the sum climbing up through more
and more integers, the product climbing through more and more primes. Watch them both squeeze in on
the same dashed line from below:
Euler wrote down this identity around 1737 — over a century before Riemann was born — and used it
for a strikingly clever purpose: a brand-new proof that there are
infinitely many
primes. Set s = 1. The left side becomes the harmonic
series, which diverges to infinity. But if there were only finitely many primes, the right
side would be a finite product of finite numbers — a contradiction. Infinitely many factors are
needed to blow the product up, so infinitely many primes must exist.
That one trick — turning a question about primes into a question about the behaviour of a sum — is
the founding move of an entire field, analytic number theory. Everything from the
Prime Number
Theorem to the Riemann
Hypothesis is, at bottom, an exploitation of this single sum-product bridge.
The primes are encoded in the zeros
Taking a logarithm turns the product into a sum over primes, and differentiating relates
\zeta to a sum that counts primes (and prime powers). The upshot
— Riemann's great insight — is an exact formula for the prime-counting function
\pi(x) written in terms of the zeros of
\zeta:
\pi(x) \approx \operatorname{Li}(x) - \sum_{\rho} (\text{term from each zero } \rho).
Each zero contributes an oscillation; together they correct the smooth estimate into the exact
prime count. The primes' apparent randomness is the music of the zeta zeros.
Concretely, the logarithmic derivative -\zeta'(s)/\zeta(s) unpacks —
again via the Euler product — into a sum weighted by the von Mangoldt function
\Lambda(n), which is \log p when
n is a power of the prime p, and
0 otherwise. That single function, summed up, counts primes (with a
careful weighting for prime powers) — and it is precisely this sum that Riemann's formula above
pins down exactly, zero by zero.
Why this matters
This is the strategy behind every proof of the
Prime Number Theorem:
control where \zeta can vanish, and you control how the primes are spread.
Showing simply that \zeta(s) \ne 0 on the line
\Re(s) = 1 is already enough to prove it. Pinning the zeros down
exactly is the
Riemann Hypothesis.
This is not just a hypothetical strategy — it is exactly how the Prime Number Theorem was finally
proved. In 1896, two mathematicians working independently, Jacques Hadamard and Charles Jean de la
Vallée Poussin, both showed that \zeta(s) has no zeros on the line
\Re(s)=1, and both used it — via the Euler product — to nail down exactly
how the primes thin out among the integers. A century of effort chasing this single sum-product
identity finally paid off.
The Euler product identity, exactly as stated, only holds where the sum genuinely converges
— that is, for \Re(s) > 1. At s = 1 both
sides blow up together (the harmonic series diverges, and so does the product), and for
\Re(s) \le 1 the sum as written no longer makes sense at all.
It's tempting to think this means \zeta(s) simply doesn't exist to the
left of 1. It does — but reaching it takes a completely different piece
of machinery, analytic continuation, which extends \zeta
to (almost) the whole complex plane by an entirely different route. The Euler product formula itself
is not valid there and cannot simply be "plugged in" for s \le 1 — that
subtlety is exactly why the Riemann zeros (which live at \Re(s) = 1/2)
are such a delicate business.