The Euler Product and Why the Zeta Function Encodes the Primes
Follow how a sum over all whole numbers equals a product over primes, and what that identity reveals about prime numbers.
Key takeaways
- The zeta function ζ(s) is the sum 1 + 1/2ˢ + 1/3ˢ + ..., which converges for s > 1.
- The same value equals a product with one factor for each prime, because factorization is unique.
- Letting s approach 1 proves there are infinitely many primes and that the sum of their reciprocals diverges.
- The reciprocal of zeta generates the Möbius function, and 1/ζ(2) is the chance two random integers are coprime.
- Riemann extended zeta to complex numbers, where its zeros control the error in estimates of the number of primes.
The Euler product is an identity saying that the sum of 1/nˢ over all positive whole numbers equals the product of 1/(1 − p^(−s)) over all primes p, whenever s > 1. The left side never mentions primes. The right side is built from nothing else.
The two sides are equal because every whole number greater than 1 factors into primes in exactly one way. So the identity is unique factorization written in the language of analysis, and it is why a single function, the zeta function, can tell us how the primes are distributed.
The two sides
For a real number s greater than 1, define
ζ(s) = 1/1ˢ + 1/2ˢ + 1/3ˢ + 1/4ˢ + ... At s = 1 this would be the harmonic series, which grows without bound. For larger s the terms shrink fast enough for the total to be finite. At s = 2 the total is π²/6 ≈ 1.644934, a value Euler found in the 1730s.
The product side takes one factor per prime:
1/(1 − 1/2ˢ) × 1/(1 − 1/3ˢ) × 1/(1 − 1/5ˢ) × 1/(1 − 1/7ˢ) × ... Why they are equal
Each factor is the sum of a geometric series:
1/(1 − p^(−s)) = 1 + 1/pˢ + 1/p^(2s) + 1/p^(3s) + ... Take just the primes 2 and 3 and multiply the two series. Every product has the form 1/(2^a × 3^b)ˢ, so you get exactly one term for each number whose only prime factors are 2 and 3:
1 + 1/2ˢ + 1/3ˢ + 1/4ˢ + 1/6ˢ + 1/8ˢ + 1/9ˢ + 1/12ˢ + ... Add the prime 5 and the numbers built from 2, 3 and 5 appear. With all primes included, every positive integer appears, and it appears once. Existence of factorization guarantees nothing is missed, and uniqueness guarantees nothing is counted twice.
To make this rigorous, note that the product over primes up to N contains every term 1/nˢ with n ≤ N, plus some larger ones. Its difference from ζ(s) is therefore no more than the tail of the series beyond N, which tends to zero when s > 1.
Watching the product converge
At s = 2 the factors are p²/(p² − 1).
| Primes included | Newest factor | Partial product |
|---|---|---|
| 2 | 4/3 | 1.3333 |
| 2, 3 | 9/8 | 1.5000 |
| 2, 3, 5 | 25/24 | 1.5625 |
| 2, 3, 5, 7 | 49/48 | 1.5951 |
The limit is 1.6449. The factors approach 1 quickly, so each new prime changes less than the last.
A sieve in disguise
Another way to see the identity is to strip multiples away. Multiply ζ(s) by (1 − 1/2ˢ):
ζ(s) − ζ(s)/2ˢ = 1 + 1/3ˢ + 1/5ˢ + 1/7ˢ + 1/9ˢ + ... All the even terms are gone. Multiply the result by (1 − 1/3ˢ) and the remaining multiples of 3 vanish. Continuing through the primes removes everything except the first term, 1.
This is the sieve of Eratosthenes performed on a series. In the end ζ(s) multiplied by every factor (1 − p^(−s)) equals 1.
Where π²/6 comes from
Euler's value of ζ(2) came from another product. The function sin x / x equals 1 at the limit x = 0 and vanishes at x = ±π, ±2π, ±3π and so on. Euler wrote it as a product with one factor for each pair of zeros:
sin x / x = (1 − x²/π²)(1 − x²/4π²)(1 − x²/9π²)... The same function has the series 1 − x²/6 + x⁴/120 − .... Compare the terms in x². From the product you collect one such term from each factor, so
−1/6 = −(1/π²)(1 + 1/4 + 1/9 + ...)
ζ(2) = π²/6 Treating an infinite product like a finite polynomial needs justification, which was supplied later. The conclusion is correct. The same method gives ζ(4) = π⁴/90, and every positive even input gives a rational multiple of a power of π.
Odd inputs are much more mysterious. Roger Apéry proved in the late 1970s that ζ(3) is irrational, but no comparably simple formula for it is known.
The product cut off at x
Stopping the product at a finite point answers a concrete question: what proportion of integers avoid all small primes? Divisibility by 2, 3, 5 and 7 repeats every 210 numbers, and the proportion surviving is
(1 − 1/2)(1 − 1/3)(1 − 1/5)(1 − 1/7) = 8/35 = 48/210 So 48 numbers in each block of 210 are divisible by none of those four primes.
Franz Mertens showed in the 1870s that the product of (1 − 1/p) over primes up to x behaves like e^(−γ) / ln x, where γ ≈ 0.5772 is the Euler–Mascheroni constant. At x = 100 the true product is about 0.120 and the formula gives about 0.122.
One tempting step fails. Multiplying this proportion by x, with primes taken up to √x, does not give the correct count of primes near x. Divisibility events are not independent enough when the primes are large compared with the range, and the heuristic is off by a constant factor. Counting primes correctly needs finer information.
Infinitely many primes, twice over
Suppose there were only finitely many primes. Then the product at s = 1 would be a finite number. But as s decreases to 1, ζ(s) grows beyond every bound. So the list of primes cannot be finite.
A second proof uses s = 2. If there were finitely many primes, ζ(2) would be a product of finitely many fractions, hence rational. Yet π²/6 is irrational. This proof leans on much heavier facts than Euclid's, but it shows how information flows between the two sides.
Taking logarithms of the product gives more:
ln ζ(s) = sum over primes of 1/pˢ + (a part that stays bounded near s = 1) Therefore the sum 1/2 + 1/3 + 1/5 + 1/7 + ... diverges. It does so extremely slowly, roughly like ln(ln x) when you stop at x.
Reading the product backwards
Flip the identity:
1/ζ(s) = (1 − 2^(−s))(1 − 3^(−s))(1 − 5^(−s))...
= 1 − 1/2ˢ − 1/3ˢ − 1/5ˢ + 1/6ˢ − 1/7ˢ + 1/10ˢ − ... The coefficients are the values of the Möbius function: zero for numbers with a repeated prime factor, and otherwise +1 or −1. This is the series form of Möbius inversion.
It also has a probability reading. Roughly speaking, the chance that two large random integers are both divisible by p is 1/p², and the events for different primes behave independently. The chance of no common prime is the product of (1 − 1/p²), which is 1/ζ(2) = 6/π² ≈ 0.608. A rigorous version takes limits over bounded ranges.
Other series built the same way
Squaring zeta gives the series whose coefficients are the number of divisors d(n). The product ζ(s)ζ(s − 1), valid for s > 2, has the divisor sum σ(n) as coefficients.
If you attach to each integer a multiplicative weight χ(n) that depends only on its remainder modulo q, the product still works:
sum of χ(n)/nˢ = product over primes of 1/(1 − χ(p)/pˢ) Here χ must satisfy χ(mn) = χ(m)χ(n) for all m and n. These are Dirichlet L-functions, and they separate primes by remainder class.
Into the complex plane
In 1859 Bernhard Riemann let s be a complex number. The series converges only when the real part of s exceeds 1, but the function has a unique analytic continuation to every complex number except s = 1.
The continued function takes values that the original series cannot produce. For instance ζ(−1) = −1/12. This does not mean that 1 + 2 + 3 + ... equals −1/12; the series diverges, and the value belongs to the extended function.
The product shows that ζ(s) has no zeros where the real part exceeds 1. The extension has "trivial" zeros at −2, −4, −6 and so on, and others lying in the strip with real part between 0 and 1. The first of these has real part 1/2 and imaginary part about 14.13.
Riemann gave a formula expressing prime counts as a smooth main term corrected by one oscillating term for each zero. Showing there are no zeros with real part 1 yields the prime number theorem. The Riemann hypothesis, that every nontrivial zero has real part 1/2, remains unproved as of the mid-2020s.
Computing with the two sides
Neither side is a fast way to get many digits at s = 2. After N terms of the sum, the missing tail is close to 1/N, so a thousand terms leave an error of about 0.001. The product does somewhat better when you count only primes, but finding the primes costs work too.
Practical computation uses accelerated formulas that estimate the tail by an integral and then correct it. As a first step, add 1/(N + 1/2) to the sum of the first N terms. With N = 4 the sum is 1 + 0.25 + 0.1111 + 0.0625 = 1.4236, and adding 1/4.5 = 0.2222 gives 1.6458, within 0.001 of π²/6.
The gap between the slow identity and the quick estimate is typical. The Euler product matters for what it explains about primes, and numerical work calls on other tools.
Points to watch
- The product formula is valid as written only where the real part of s is greater than 1. Inserting other values gives meaningless results.
- An infinite product converges, in the usual sense, to a nonzero limit. A product that sinks toward zero is said to diverge to zero.
- The identity does not provide a formula for the n-th prime. It encodes statistical information about all of them together.
To test your understanding, derive the product for the sum of 1/nˢ over odd n only. Simply leave out the factor for the prime 2, which gives (1 − 2^(−s)) ζ(s). At s = 2 that is (3/4)(π²/6) = π²/8.