Show that $\sum\limits_pa_p$ converges iff $\sum\limits_{n}\frac{a_n}{\log n}$ converges

I am going through A. J. Hildebrand's lecture notes on Introduction to Analytic Number Theory. I'm currently stuck at the exercises at the end of Chapter 3 (Distribution of Primes I - Elementary Results). The problem statement is:

Let $$(a_n)$$ be a nonincreasing sequence of positive numbers. Show that $$\sum\limits_p a_p$$ converges if and only if $$\sum\limits_{n=2}^{\infty}\frac{a_n}{\log n}$$ converges.

The way I was trying to go about the proof is using the integral convergence test and the Prime Number Theorem, by saying that $$\int_1^\infty a(p(x))dx = \int_2^\infty a(t)\pi'(t)dt$$ where $$p(x)$$ is an interpolated version of the n-th prime sequence, and $$\pi(t)$$ is the prime counting function. Then by the PNT, we know that $$\pi(t) = \frac{t}{\log t} + O\left(\frac{t}{\log^2 t}\right)$$. By a leap of logic, I'd hope that $$\pi'(t) = \frac{1}{\log t} + o\left(\frac{1}{\log t}\right)$$, which would make the last integral equal to $$\int_{2}^{\infty}\frac{a(t)}{\log t} dt + \text{terms of lower order}$$ This would then converge if and only if $$\sum\limits_{n=2}^{\infty}\frac{a_n}{\log n}$$ converges. The problem is that differentiating the Big-O estimate doesn't seem valid, and I am unable to come up with good enough estimates to prove this relationship (if it is even true).

By partial summation we have $$\sum_{1 and $$\sum_{p\leq N}a_{p}=\pi\left(N\right)a_{N}+\sum_{k\leq N-1}\pi\left(k\right)\left(a_{k}-a_{k+1}\right)$$ which is, from PNT, $$\sim\frac{Na_{N}}{\log\left(N\right)}+\sum_{k\leq N-1}\frac{k}{\log\left(k\right)}\left(a_{k}-a_{k+1}\right)$$ now note that $$\log\left(k+1\right)-\log\left(k\right)=\log\left(1+\frac{1}{k}\right)=o\left(1\right)$$ as $$k\rightarrow\infty$$, so the first series converges iff the second does.
• Nice! I did not think of using partial summation in this way. Just one thing I'm not sure about: I know that $\pi(k) \sim \frac{k}{\log k}$, but wouldn't the error terms in the RHS sum accumulate? How to be sure that the total error term will be of smaller order than the two sums we're comparing? Oct 1 '15 at 22:05
• If you use $f(x) \sim g(x)$ it's not necessary consider the error terms since it's sufficient control the $g(x)$. In this case if you want put out the error term, write $\pi(k)=k/\log(k)+O(k/\log^{2}(k)$ instead of $\sim$. But since $$\sum_{k\leq N-1}\frac{k}{\log^{2}(k)}(a_{k}-a_{k-1})\leq\sum_{k\leq N-1}\frac{k}{\log(k)}(a_{k}-a_{k-1})$$ then if the RHS converges, then LHS converges. Oct 2 '15 at 8:10