Asymptotic expansion of $\sum_{\substack{p \in \mathbb{P}\\ p\le x}}{\frac{\log(p)}{p-1}}$ I am trying to determine the asymptotic expansion of the following series:
$$\sum_{\substack{p \in \mathbb{P}\\ p\le x}}{\frac{\log(p)}{p-1}} $$
First I did that :
$$ \frac{\log(p)}{p-1} = \sum_{k=1}^{\infty}{\frac{\log(p)}{p^k}} = \frac{\log(p)}{p} + \sum_{k=2}^{\infty}{\frac{\log(p)}{p^k}} \label{eq:eq1} \tag{1} $$
To lead to :
$$\sum_{\substack{p \in \mathbb{P}\\ p\le x}}{\frac{\log(p)}{p-1}} = \sum_{\substack{p \in \mathbb{P}\\ p\le x}}{\frac{\log(p)}{p}} + \sum_{k=2}^{\infty}{\sum_{\substack{p \in \mathbb{P}\\ p\le x}}{\frac{\log(p)}{p^k}}} \tag{2}$$
The second sum of the RHS is clearly converging. Also, its limit can can be expressed in term of the derivative of the prime zeta function ($P(s)$ which is absolutely convergent for $\Re(s)\gt 1$).
The problem is coming from the first sum as it is divergent. However, from the Prime Number theorem we have (Approximations for the nth prime number : Wikipedia FR):
$$\frac{n}{p_n} = \frac{1}{\log(p_n)}+\frac{1}{\left(\log(p_n)\right)^2} + \frac{2}{\left(\log(p_n)\right)^3} + \frac{6}{\left(\log(p_n)\right)^4} + o\left(\frac{1}{\left(\log(p_n)\right)^4}\right) \tag{3}$$
Giving :
$$\frac{\log(p_n)}{p_n} = \frac{1}{n}+\frac{1}{n\log(p_n)} + \frac{2}{n\left(\log(p_n)\right)^2} + \frac{6}{n\left(\log(p_n)\right)^3} + o\left(\frac{1}{n\left(\log(p_n)\right)^3}\right)$$
And
$$\frac{1}{n\log(p_n)} = \frac{1}{p_n}-\frac{1}{n\left(\log(p_n)\right)^2} - \frac{2}{n\left(\log(p_n)\right)^3} - \frac{6}{n\left(\log(p_n)\right)^4} + o\left(\frac{1}{n\left(\log(p_n)\right)^4}\right)$$
Finally:
$$\frac{\log(p_n)}{p_n} = \frac{1}{n}+\frac{1}{p_n} + \frac{1}{n\left(\log(p_n)\right)^2} + \frac{4}{n\left(\log(p_n)\right)^3} + o\left(\frac{1}{n\left(\log(p_n)\right)^3}\right) \tag{4}$$
Summing that, we have :
$$\sum_{\substack{p_n \in \mathbb{P}\\ p_n\le x}}{\frac{\log(p)}{p}}  = \sum_{n=1}^{\pi(x)}{\frac{1}{n}} + \sum_{\substack{p_n \in \mathbb{P}\\ p_n\le x}}{\frac{1}{p_n}} + O(1)$$
Which gives, using appropriate asymptotic expansions:
$$ \sum_{\substack{p_n \in \mathbb{P}\\ p_n\le x}}{\frac{\log(p)}{p}} = \log(\pi(x)) + \log(\log(x)) + O(1) $$
The problem here is the $\log(\pi(x))$ as the asymptotic expansion of $\pi(x)$ is quite bad for my use.
Do you see a way to improve this bound ? Or another way to express it ?
 A: The PNT in the form $\sum_{n=1}^N \Lambda(n) = N+O(\frac{N}{\log^2 N})$ and a summation by parts gives that $$\sum_{p^k\le x} \frac{\log p}{p^k} = \frac{\sum_{n\le x}\Lambda(n)}{x} + \sum_{n\le x-1} (\sum_{m\le n} \Lambda(m))(\frac1n-\frac1{(n+1)})$$ $$ = 1+o(1)+\sum_{n\le x-1} (n+O(\frac{n}{\log^2 n}))(\frac1{n^2}+O(\frac1{n^3}))= \log x + C+ o(1)$$
$\int_1^\infty x^{-s-1}dx = 1/s$, differentiating wrt $s$ gives $\int_1^\infty \log(x) x^{-s-1}dx = 1/s^2$.
Then write $$\int_1^\infty (C+o(1))x^{-s-1}dx= \int_1^\infty (\sum_{p^k\le x} \frac{\log p}{p^k}-\log x)x^{-s-1}dx = \frac1s \frac{-\zeta'(s+1)}{\zeta(s+1)}-\frac1{s^2}$$
From that $\zeta(s)=\frac1{s-1}-\gamma+O(s-1)$ at $s=1$ we know that $
\frac{-\zeta'(s)}{\zeta(s)}= \frac{1}{s-1}-\gamma+O(s-1)$ as $s\to 1^+$ so that $\frac1s \frac{-\zeta'(s+1)}{\zeta(s+1)}-\frac1{s^2}- \frac{\gamma}s$ is bounded as $s\to 0^+$.
This implies that $C=-\gamma$.
Finally $$\sum_{p\le x} \frac{\log p}{p-1}=o(1)+\sum_{p^k\le x} \frac{\log p}{p^k}= \log x-\gamma+o(1)$$
It can be shown that improving $\log x+O(1)$ (the Mertens theorem) to $\log x + C+o(1)$ is equivalent to the PNT, so there is no simpler way.
