## Introduction:

In a previous article, I considered Mertens’ first theorem which states that:

$$\sum_{p \leq N} \frac{\log p}{p} = \log N + \mathcal{O}(1)$$

This theorem has a beautiful corollary with the rather unassuming name of Mertens’ second theorem(1874):

$$\sum_{p \leq N} \frac{1}{p} = \log\log N + \mathcal{O}(1)$$

While we may develop this result using Abel’s summation theorem, its natural interpretation was unveiled at a later date by the Hardy-Ramanujan theorem(1917) where (2) corresponds to the expected number of prime divisors of $$\sqrt{N}$$.

## Abel summation theorem:

Let’s suppose $$A(n)$$ is a convergent series defined in terms of a continous function $$a(\cdot)$$:

$$A(n) = \sum_{c < r \leq n} a(r) = \int_{c}^n a(r)dr + \mathcal{O}(1)$$

If $$f$$ is a function having a continuous derivative on $$[y,x]$$, then:

$$\sum_{y < r \leq x} a(r) \cdot f(r) = A(x) \cdot f(x) - A(y) \cdot f(y) - \int_{y}^x A(t) \cdot f’(t) dt$$

which may be demonstrated using integration by parts.

## Derivation of Mertens’ second theorem:

In order to apply Abel’s summation theorem, let’s first note that:

$$\sum_{p \leq N} \frac{1}{p} = \sum_{p \leq N} \frac{\log p}{p} \cdot \frac{1}{\log p}$$

where $$A(N) = \sum_{2 \leq p \leq N} \frac{\log p}{p}$$ and $$f(t) = \frac{1}{\log t}$$.

Therefore, we have:

$$\sum_{p \leq N} \frac{1}{p} = \sum_{p \leq N} \frac{\log p}{p} \cdot \frac{1}{\log p} = \frac{1}{\log N} \sum_{p \leq N} \frac{\log p}{p} + \int_{2}^N \sum_{p \leq t} \frac{\log p}{p} \cdot \frac{1}{t \cdot (\log t)^2} dt + \mathcal{O}(1)$$

and due to Mertens’ first theorem this simplifies to:

$$\sum_{p \leq N} \frac{1}{p} = \int_{2}^N \frac{\log t}{t \cdot (\log t)^2} dt + \mathcal{O}(1) = \int_{2}^N \frac{1}{t \cdot \log t} dt + \mathcal{O}(1) = \log \log N + \mathcal{O}(1)$$

QED.

## References:

1. Weisstein, Eric W. “Mertens’ Second Theorem.” From MathWorld–A Wolfram Web Resource. https://mathworld.wolfram.com/MertensSecondTheorem.html
2. Hardy, G. H.; Ramanujan, S. (1917), “The normal number of prime factors of a number n”, Quarterly Journal of Mathematics