Mertens' first theorem states that
$$
\sum\_{p \leq n} \frac{\log p}{p} = \log n + O(1).
$$
I read in [this paper](https://tenenb.perso.math.cnrs.fr/PPP/PropStatFriables.pdf) that the following variant is "classical":
$$
\sum\_{p \leq n} \frac{\log p}{p - 1} = \log n - \gamma + o(1).
$$
Could anyone provide a reference (or a proof) to the "classical" variant?



Mertens-like theorem
This lies beyond Mertens, in the sense that this variant actually implies the Prime Number Theorem, as will be explained below, while Mertens' theorem is weaker than the PNT.


I sketch below a complex analytic proof of the variant, due to Landau.




---


Let $\Lambda$ be the von Mangoldt function, defined as $\Lambda(p^k)=\log p$ if $p$ is a prime and $k \ge 1$, and $\Lambda(n)=0$ otherwise. Note that your sum
$$S\_1(n):=\sum\_{p \le n} \frac{\log p}{p-1}$$
is very close to
$$S\_2(n):= \sum\_{m \le n} \frac{\Lambda(m)}{m}.$$
Indeed,
$$S\_2(n)-S\_1(n) = \sum\_{p \le n} \log p \sum\_{1 \le k \le \log\_p n} p^{-k}- \sum\_{p \le n} \log p\sum\_{k \ge 1} p^{-k} = \sum\_{p \le n} \log p \sum\_{k >\log \_p n} p^{-k}.$$
The inner $k$-sum is always $\ll \min\{1/n, 1/p^2\}$, so that this difference is  

$$\ll \sum\_{p \le n} \log p \min\{1/n, 1/p^2\}\ll \sum\_{m \le \sqrt{n}} \frac{\log m}{n} + \sum\_{\sqrt{n}<m \le n} \frac{\log m}{m^2} \ll \frac{\log n}{\sqrt{n}}=o(1).$$
We see it suffices to estimate $S\_2(n)$.




---


The reason that I introduced $\Lambda$ is that the PNT is usually proved with $\Lambda$. The Dirichlert series of $\Lambda$ is $-\zeta'(s)/\zeta(s)$, so Perron's formula gives
$$S\_2(n) = \frac{1}{2\pi i}\int\_{(1)}-\frac{\zeta'}{\zeta}(s+1) n^s \frac{ds}{s}+O((\log n)/n).$$
The main term $\log n - \gamma$ arises as the residue of the double pole of the integrand at $s=0$. Indeed, near $s=0$ we have the Laurent expansion
$$\begin{align}-\frac{\zeta'}{\zeta}(s+1)n^s/s&= s^{-2} (1-\gamma s + O(s^2)) (1+s \log n + O(s^2 \log^2 n)) \\
&= s^{-2}(1+(\log n-\gamma)s+O(s^2)).
\end{align}$$
Here we made use of
$$(\star)\, -\frac{\zeta'}{\zeta}(s) = \frac{1}{s-1} -\gamma + O(s-1)$$
near $s=1$. To justify the above heuristic one needs, as in the classical proof of the PNT, to 1) apply a truncated version of Perron's formula and 2) shift the contour to the left using a zero-free region. This is why I believe Hadamard and de la Vallée Poussin had possibly known this variant.


Landau, in his book "Handbuch der Lehre von der Verteilung der Primzahlen" (1911) used Perron's formula to work out an explicit formula for $\sum\_{m \le n} \Lambda(m)/m^s$ for general $s$. For $s=1$ it corresponds to $S\_2(n)$. A reference with proof is Lemma 4.1 [in this preprint](https://arxiv.org/abs/2211.08973) (specialize to $s=1$). In particular, letting
$$\Delta(n):=S\_2(n)-( \log n- \gamma)$$
then, assuming $n$ is a positive integer,
$$\Delta(n)=\frac{\Lambda(n)}{2n}- \sum\_{\rho} \frac{n^{\rho-1}}{\rho-1} \ll \exp(-c(\log n)^{3/5}(\log \log n)^{-1/5})$$
for some $c>0$.
Here the sum is over the zeros of $\zeta$, and the inequality follows from the Vinogradov--Korobov zero-free region. Under RH, $\Delta(n)\ll n^{-1/2}\log^2 n$.




---


The Laurent expansion $(\star)$ is not mysterious; it's equivalent to the Laurent expansion
$$(\star \star)\, \zeta(s) = \frac{1}{s-1} + \gamma +O(s-1)$$
at the same point, which in turn is equivalent to the Harmonic sum $\sum\_{m \le n} 1/n$ being equal to $\log n + \gamma + O(1/n)$. See Corollary 1.16 in Montgomery and Vaughan's book, "Multiplicative Number Theory I" for a rigorous derivation of $(\star \star)$.




---


Here is a more accessible proof. Given an arithmetic function $f=\alpha\*\beta$ we have
$$\sum\_{n \le x} f(n)=\sum\_{n \le x} \alpha(n) \sum\_{m\le x/n} \beta(m).$$
Applying this with $\log = \mathbf{1}\*\Lambda$ where $\log$ is the natural logarithm and $\mathbf{1}$ is the constant function taking the value $1$, we find
$$\sum\_{n \le x} \log n = \sum\_{n \le x} \Lambda(n)\lfloor x/n \rfloor.$$
This identity goes back to Chebyshev. Dividing both sides by $x$ we see
$$\sum\_{n \le x} \frac{\Lambda(n)}{n} =x^{-1}\sum\_{n \le x} \log n +x^{-1} \sum\_{n \le x} \Lambda(n) \{x/n\}$$
where $\{t\} \in [0,1)$ is the fractional part of $t$. A very weak version of Stirling's approximation tells us
$$x^{-1}\sum\_{n \le x} \log n=\log x - 1 + O\left( \frac{\log x}{x}\right).$$
To establish $S\_2(x) =\log x- \gamma+o(1)$ it remains to show
$$x^{-1} \sum\_{n \le x} \Lambda(n) \{x/n\} = 1-\gamma + o(1).$$
By the Prime Number Theorem, $\Lambda =1$ 'on average', so we would expect the sum to be
$$=x^{-1} \sum\_{n \le x} \{x/n\}+o(1)$$
which indeed tends to $1-\gamma$ (see Exercise 2.1.1.1, page 39 in Montgomery--Vaughan, which is attributed to de la Vallée Poussin; this is a restatement of the asymptotic $\sum\_{n \le x} d(n) = x\log x + (2\gamma-1)x+o(x)$ which was known to Dirichlet). To make this formal we just need to show that the difference
$$\sum\_{n \le x} (\Lambda(n)-1) \{x/n\}$$
is $o(x)$ which can be done via the Prime Number Theorem, see Exercise 8.1.1.1, page 248, in Montgomery--Vaughan. In the same exercise they use Axer's theorem to show that $\sum\_{n\le x}\Lambda(n) \sim x$ (PNT) is in fact equivalent to $S\_2(n) =\log n- \gamma+o(1)$.


