mostly math?

correctness not guaranteed

conjuring primes out of the riemann zeta function

Maybe you’ve heard of the Riemann zeta function before: it’s defined as

\[\zeta(s) = \sum_{n=1}^\infty \frac{1}{n^s} = \sum_{n=1}^\infty n^{-s}.\]

This function has deep connections in number theory, and it’s at the heart of the Riemann zeta hypothesis, one of the Millenium Prize Problems1. Back in the 18th century (which was quite a bit before Riemann’s time), good old Leonhard Euler proved a quite beautiful formula for it:

\[\zeta(s) = \prod_p \frac{1}{1 - p^{-s}} \quad (s > 1),\]

where \(\prod_p\) iterates over all prime numbers \(p\). At least for me, appreciating this beauty took some time working through the proof, but I hope I can accelerate this process for you!


So, \(\zeta(s)\) is just the value of a giant sum: for all natural numbers \(n\) starting from 1, we add up all the \(n^{-s}\). Now, if we use \(n\)’s prime factorization, we can express each \(n^{-s}\) as

\[\begin{align} n^{-s} &= (2^{a_2} \cdot 3^{a_3} \cdot 5^{a_5} \cdots P^{a_P})^{-s} \\\\ &= 2^{-a_2s} \cdot 3^{-a_3s} \cdot 5^{-a_5s} \cdot P^{-a_Ps} \end{align}\]

where all the bases are prime numbers, \(P\) is the greatest prime factor of \(n\), and each \(a_p\) is a natural number. Now, if we look at the whole sum \(\zeta(s) = \sum_{n=1}^\infty n^{-s}\) this way, we can factor out \(2^{-a_2s}\) for each \(n^{-s}\), and we get

\[\begin{align} \sum_{n=1}^\infty n^{-s} &= 1^{-s} + 2^{-s} + 3^{-s} + 4^{-s} + 5^{-s} + \cdots \\\\ &= 1 + 2^{-s} + 3 + 2^{-2s} + 5 + 2^{-s} \cdot 3 + \cdots \\\\ &= (1 + 3 + \cdots) + 2^{-s} (1 + 3 + \cdots) + \cdots \\\\ &= (2^{-0s} + 2^{-1s} + \cdots)(1 + 3 + 5 + \cdots) \\\\ &= \left( \sum_{n=0}^\infty 2^{-ns} \right) (1 + 3 + 5 + 7 + \cdots). \end{align}\]

2 Now, there are two important things to note here: When you look at the first factor, it’s similar to the sum of all powers of two, but each exponent is multiplied with \(-s\). The second factor is the sum of all numbers that aren’t divisible by 2.

Now, we can factor out all powers of 3 from this second factor, and then all powers of 5 from the remaining factor, and so on, infinitely often, until we’ve done this factoring for all the primes!3 We obtain

\[\sum_{n=1}^\infty n^{-s} = \prod_p \sum_{n=0}^\infty p^{-ns},\]

which is the product of, for each prime \(p\), the sum of powers \(p^{-ns}\).

If we imagine setting \(s = -1\), this simplifies to

\[\begin{align} \sum_{n=1}^\infty n &= \prod_p \sum_{n=0}^\infty p^n, \\\\ 1 + 2 + 3 + 4 + \cdots &= \prod_p 1 + p + p^2 + p^3 + \cdots, \end{align}\]

which in one way doesn’t really make sense, since the sum of all natural numbers doesn’t converge, but in another way can be grasped quite intuitively: if we were to evaluate the product on the right side, we basically pick a perfect power of each prime (\(1 = p^0\) included), and then multiply them together. Each combination occurs only once, and by the fundamental theorem of arithmetic, each natural number is uniquely factored by one of these combinations: for each term on the left, we can pick exactly one combination of factors on the right; for each combination of factors we pick on the right, theres exactly one term on the left!

In brief, the formula we’ve shown so far is really just a more complicated way of expressing the fundamental theorem of arithmetic (one might see it as an analytical formulation)!

To get from here to Euler’s formula, we first observe that \(\sum_{n=0}^\infty p^{-ns} = \sum_{n=0}^\infty (p^{-s})^n\) is a geometric series. Since \(s > 1\) and all primes are at least 2, we have \(\lvert p^{-s} \rvert \leq 1\), so we can apply the formula for geometric series4 to get

\[\sum_{n=0}^\infty p^{-ns} = \frac{1}{1 - p^{-s}}.\]

Putting that into the formula from above, we get what Euler proved:

\[\zeta(s) = \sum_{n=1}^\infty n^{-s} = \prod_p \sum_{n=0}^\infty p^{ns} = \prod_p \frac{1}{1 - p^{-s}}.\]

not so fast (here be limits)

Now, so far we’ve been playing around with infinities fairly lightly, so maybe you’re not convinced that what we’ve purported to show has actually been shown. We can fix this though: instead of multiplying the series5 \(\sum_{n=0}^\infty p^{-ns}\) for all \(p\), we only multiply the series5 for \(p \leq P\) for some arbitrary \(P\). What we get is the sum of \(n^{-s}\) for all \(n\) that don’t have prime factors greater than \(P\), which we’ll write as

\[\prod_{p \leq P} \sum_{n=0}^\infty p^{-ns} = \sum_{n \in (P)} n^{-s}.\]

Those \(n \in (P)\) include all numbers up to \(P\), so that

\[0 < \sum_{n=1}^\infty n^{-s} - \sum_{n \in (P)} n^{-s} < \sum_{n = P + 1}^\infty n^{-s}.\]

Now, as \(P \rightarrow \infty\), that last sum approaches 0. We conclude:

\[\begin{align} \sum_{n=1}^\infty n^{-s} &= \lim_{P \rightarrow \infty} \sum_{n \in (P)} n^{-s} \\\\ &= \lim_{P \rightarrow \infty} \prod_{p \leq P} \sum_{n=0}^\infty p^{-ns} \\\\ &= \prod_p \sum_{n=0}^\infty p^{-ns} \end{align}\]

and Euler’s formula follows as before.


  1. We won’t go into these deeper connections here: as it’s written, the definition doesn’t really make sense for \(s \leq 1\) (since the series doesn’t converge), so it’s so-called analytic continuation in the complex plane is used. We don’t need to worry about that for what I wanna show here though (also, I don’t really understand it). If you’re interested, you should check out 3Blue1Brown’s excellent video about this, if you haven’t seen it already. 

  2. The factoring might become clearer if you try to factor out the powers of two for more numbers. 

  3. We’re playing a bit fast and loose here, but we’ll make this more precise later. 

  4. This formula states that \(\sum_{n=0}^\infty x^n = \frac{1}{1 - x}\) whenever \(\lvert x \rvert < 1\). 

  5. Plural!  2

categories: math tags: math number-theory riemann-zeta-function