A sum involving fractional parts and prime numbers In this paper a formula involving fractional parts, denoted by $\{\cdot\}$, is derived
\begin{equation}
\sum_{\;\;\;\;\;d\leq x \\ d \equiv b \mod a}\Big\{ \frac{x}{d}\Big\} = \frac{x}{a}(1-\gamma) + O(\sqrt{x}).
\end{equation}
A generalization of this is given also, which I understand. However, it also remarks that the following very interesting relation is also true
\begin{equation}
\sum_{p \leq x} \Big\{\frac{x}{p}\Big\} = \frac{x}{\log x}(1-\gamma) + o\Big(\frac{x}{\log x}\Big)
\end{equation}
where the sum is over primes $p\leq x$. However the reference it gives here is in french, and I can't quite see how it is true from the derivation of the previous result (although I can see the intuitive link due to the prime number theorem). Does anyone know any references to the proof of the result, or can explain it?
 A: This is a generalisation of Axer's limit theorem, which says that if $f$ is an arithmetic function such that


*

*$F(x) := \sum_{n \leqslant x} f(n) = o(x)$, and

*$G(x) := \sum_{n \leqslant x} \lvert f(n)\rvert = O(x)$, then


$$\sum_{n \leqslant x} f(n) \biggl\lbrace \frac{x}{n}\biggr\rbrace = o(x)\,.$$
Together with
$$\sum_{n \leqslant x} \biggl\lbrace \frac{x}{n}\biggr\rbrace = (1-\gamma) x + o(x)$$
which is well-known from the asymptotics of the summatory function of the divisor function (and from that we also know that here the $o(x)$ is much smaller, $O(\sqrt{x})$ is Dirichlet's famous result from 1849), one immediately obtains the form

If $F(x) = Ax + o(x)$ and $G(x) = O(x)$, then $$\sum_{n \leqslant x} f(n) \biggl\lbrace \frac{x}{n}\biggr\rbrace = (1-\gamma)Ax + o(x)\,.$$

This does not yet yield the result for the sum of the fractional parts with prime denominators. That is the generalisation. The corresponding result holds also if the dominant term of $F(x)$ contains factors $(\log x)^a$ and/or $(\log \log x)^b$ and so on. It also holds if the asymptotics of $F$ have a different power of $x$ (and optionally logarithmic factors), say for example we have $F(x) = Ax^s(\log x)^a + o(x^{\sigma}(\log x)^{\alpha})$ and $G(x) = O(x^{\sigma}(\log x)^{\alpha})$ with $\sigma = \operatorname{Re} s > 0$ and $\alpha = \operatorname{Re} a$. Then the factor $1-\gamma$ is replaced with $\frac{s}{s-1} - \zeta(s)$ [and $1 - \gamma$ is the value of that entire function at $s = 1$], i.e. we obtain
$$\sum_{n \leqslant x} f(n)\biggl\lbrace \frac{x}{n}\biggr\rbrace = \biggl(\frac{s}{s-1} - \zeta(s)\biggr)A x^s(\log x)^a + o(x^{\sigma}(\log x)^{\alpha})\,.$$
However, for $s \neq 1$ this result isn't particularly interesting, as it can then be obtained via the hyperbola method and summation by parts. For $s = 1$ it is interesting, because then summation by parts and hyperbola method don't yield this result.
A fairly simple way of proving the generalisation of Axer's theorem employs Abel's sum formula. For a positive integer $m$ we have
\begin{align}
\sum_{\frac{x}{m+1} < n \leqslant \frac{x}{m}} f(n) \biggl\lbrace \frac{x}{n}\biggr\rbrace
&= \sum_{\frac{x}{m+1} < n \leqslant \frac{x}{m}} f(n) \biggl( \frac{x}{n} - m\biggr) \\
&= F\biggl(\frac{x}{m}\biggr)\cdot\biggl(\frac{x}{x/m} - m\biggr)
- F\biggl(\frac{x}{m+1}\biggr)\cdot \biggl(\frac{x}{x/(m+1)} - m\biggr) \\
&\quad + x\cdot \int_{x/(m+1)}^{x/m} \frac{F(u)}{u^2}\,du \\
&= -F\biggl(\frac{x}{m+1}\biggr) + x\cdot \int_{x/(m+1)}^{x/m} \frac{F(u)}{u^2}\,du\,.
\end{align}
Summing this from $m = 1$ to $m = M-1$ for a suitable $M$ yields
$$\sum_{\frac{x}{M} < n \leqslant x} f(n) \biggl\lbrace \frac{x}{n}\biggr\rbrace
= x\cdot \int_{x/M}^x \frac{F(u)}{u^2}\,du - \sum_{k = 2}^{M} F\biggl(\frac{x}{k}\biggr)\,.$$
This can be estimated using the known asymptotics of $F(x)$, provided that $x/M$ is sufficiently large. The remaining part of the sum, for $n \leqslant \frac{x}{M}$ can be estimated using the bounds for $G(x)$. If $M$ tends to $\infty$ with $x$ in a suitable manner, the initial part of the sum is negligible and the asymptotics stated above result.
For $f(n) = \pi(n) - \pi(n-1)$ we have $F(x) = G(x) = x(\log x)^{-1} + o(x(\log x)^{-1})$ and consequently
$$\sum_{n \leqslant x} f(n)\biggl\lbrace \frac{x}{n}\biggr\rbrace = \sum_{p \leqslant x} \biggl\lbrace \frac{x}{p}\biggr\rbrace = (1-\gamma)\frac{x}{\log x} + o\biggl(\frac{x}{\log x}\biggr)$$
by this theorem.
