Summing the Reciprocals of Primes

Azimuth 2026-06-01

The sum of the reciprocals of the primes diverges, but very slowly. The sum of the reciprocals of the first 100 primes is

2.106…

The sum of the reciprocals of the first 1,000 primes is

2.457…

For the first 10,000 it’s

2.709…

And it keeps creeping up, ever more slowly. To get the sum to reach 6, you need to add up the reciprocals of the first 3 × 10¹³² primes—far more than the number of atoms in the observable universe! Luckily there is no shortage of primes.

Here’s how you can see that the sum diverges, and that it diverges very slowly. First, remember Euler’s product formula for the Riemann zeta function:

\displaystyle{ \sum_{n=1}^\infty \frac{1}{n^{s}} = \prod_{p \text{\, prime}}\left(1-\frac{1}{p^{s}}\right)^{-1} }

This diverges logarithmically when s = 1. Taking logs we see

\displaystyle{ \sum_{p \text{\, prime}}\ln\!\left(1-\frac{1}{p}\right)^{-1} \;\approx\; \sum_{p \text{\, prime}}\frac{1}{p} }

must diverge too—but only log-logarithmically!

A deeper result, called Merten’s Second Theorem and proved here, says that

\displaystyle{ \sum_{p \le n} \frac{1}{p} = \ln\ln n + M + o(1) }

for some constant M. This constant is called the Meissel–Mertens constant. You can think of it as a fancier relative of Euler’s constant \gamma, which is defined by

\displaystyle{   \sum_{k = 1}^n \frac{1}{k} = \ln n + \gamma + o(1) }

But it’s much less widespread in mathematics than Euler’s constant, much as primes are less widespread than natural numbers.

Here’s how it works:

What’s a bit surprising, given the slowness of convergence and the somewhat erratic behavior of the primes, is that people can compute the Meissel–Mertens constant very precisely:

M \approx 0.26149721284764278375542683860869585905\ldots

The trick, of course, is to use another formula for this constant, which lets you compute it much more efficiently than the definition. Here it is:

\displaystyle{ M = \gamma + \sum_{n = 2}^\infty \frac{\mu(n)}{n} \ln \zeta(n)}

where \mu is the Möbius function and \zeta is the Riemann zeta function. By the way, this formula shows that calling M a fancier relative of \gamma is not just talk.

When you know how to compute the Meissel–Mertens constant, you can compare the sum of reciprocals of primes to \ln\ln n + M, and the agreement is very good:

In 1983, Guy Robin proved the curve goes above and below the actual sum infinitely many times, i.e.

\displaystyle{\left(\sum _{p\leq n}{\frac {1}{p}}\right) -\ln \ln n-M}

changes sign infinitely many times. You can see a bit of that happening here:

Puzzle. Can you find a naturally occurring sum that diverges even more slowly, for example like \ln \ln \ln n ?

Acknowledgements

The pictures were created by Dcoetzee, Marek Wolf and Saroad, respectively, and placed into the public domain on Wikicommons. Click on the pictures for more details.