---
tag: 7J3P1W042Y
kind: statement
role: theorem
name: Mertens' theorems
msc: [11N05]
uses: [01826KMG2H, 04DXAFN2ES, 00C5P9JZBK, 0TGV80E6A4, 0QR92XBV6H, B8AKSVBE5Z]
about: [01826KMG2H]
sources:
  - url: https://en.wikipedia.org/wiki/Mertens%27_theorems
same_as:
  wikidata: Q1196729
  wikipedia: Mertens' theorems
---

## Statement

Let $p$ run over the [[prime numbers|01826KMG2H]], let $\log$ be the [[natural logarithm|04DXAFN2ES]], and let $x \ge 2$ be real.

1. $\displaystyle \sum_{p \le x} \frac{\log p}{p} = \log x + O(1)$.
2. There is a constant $M$ such that $\displaystyle \sum_{p \le x} \frac{1}{p} = \log \log x + M + O\!\left(\frac{1}{\log x}\right)$.
3. $\displaystyle \prod_{p \le x} \left(1 - \frac{1}{p}\right) \sim \frac{e^{-\gamma}}{\log x}$ as $x \to \infty$, where $\gamma$ is the [[Euler–Mascheroni constant|00C5P9JZBK]].

Here $O$ is [[big O notation|0TGV80E6A4]] as $x \to \infty$, and $\sim$ is [[asymptotic equivalence|0QR92XBV6H]].

## Remarks

For the first theorem, compare two expressions of $\log(n!)$.
Legendre's formula gives $\log(n!) = \sum_{p^k \le n} \floor{n/p^k} \log p = n \sum_{p \le n} \frac{\log p}{p} + O(n)$, using the bound $\psi(n) = O(n)$ of Chebyshev for the [[Chebyshev function|B8AKSVBE5Z]] $\psi$.
[[Stirling's formula|0KC0F51T6A]] gives $\log(n!) = n \log n + O(n)$, and dividing by $n$ gives the result.
The second theorem follows from the first by partial summation.
The third follows from the second by taking logarithms; identifying the constant $e^{-\gamma}$ needs the behaviour of the [[Riemann zeta function|1XWBY4N0VT]] near $s = 1$.
The constant $M \approx 0.2615$ is the Meissel–Mertens constant.
The theorems do not need the [[prime number theorem|0EHBY5Y84N]]; they are elementary.

## Explanations

### L1 human

The sum of the reciprocals of the primes diverges, but very slowly, like $\log \log x$.
Mertens' theorems give the precise size of this sum and of two related quantities.
The product $\prod_{p \le x} (1 - 1/p)$ is the proportion of integers that have no prime factor up to $x$, in a heuristic sense, and it decays like $e^{-\gamma}/\log x$.

### L2 human

The theorems are typical of elementary prime number theory: they use only Chebyshev bounds and the factorization of $n!$.
The third theorem is used in sieve methods, where products over primes such as $\prod_{p \le z} (1 - 1/p)$ give the main term.
A naive sieve heuristic with $z = \sqrt{x}$ would predict about $2e^{-\gamma} x/\log x \approx 1.12\, x/\log x$ primes up to $x$, while the prime number theorem gives $x/\log x$.
The difference shows that divisibility by different large primes is not independent.
