I have issues understanding properly partial summation when prime numbers are involved, in particular to go from one estimate to another (either in Merten's estimates or more generally).
Here is an example. Assume $$ \sum_{p < y} \frac{a_p}{p} = -\log y + O(1) $$ where the sum is over primes. Can we deduce that $$ \sum_{p < \sqrt{x}} \frac{a_p}{p} \frac{\log(x/p^2)}{\log(x)} = -\log \log x \quad ? $$
Apparently this is so, but nothing relevant arises when I try to write the partial summation down: making the $\sum a_p/p$ appear seems to break a lot the desired result, since this would amount for a $\log x$, which is much larger than the claim.
Failed attemp. I would naturally write the following integration by parts argument ($x = \sqrt{x}$ here) \begin{align} \sum_{p<z} \frac{a_p}{p} \log(x/p^2) & = \sum_{n<z} \frac{a_n}{n} \log(x/n^2) (\pi(n) - \pi(n-1)) \\ & = \sum_{n<z} \left( \sum_{k<n} \frac{a_k}{k} (\pi(k) - \pi(k-1))\right) (\log(x/(k+1)^2)-\log(x/k^2)) \\ & = \sum_{n<z} (-\log n + O(1)) (-2/n + O(1/n^2)) \\ & = 2\sum_{n<z} \frac{\log n}{n} + O(1) = \frac14 \log(x)^2 + O(1) \end{align}
But this is far from what it should apparently be. Did I get something wrong?