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).

Denote $a=\lim a_n$. If $a\ne 0$, then obviously both series diverge.
So let further $a=0$. Then $a_n=b_n+b_{n+1}+\ldots$, where $b_n=a_n-a_{n+1}\geqslant 0$. We have $$\sum_p a_p=\sum_p (b_p+b_{p+1}+\ldots)=\sum_n \pi(n) b_n.$$)
Next, $$\sum \frac{a_n}{\log n}=\sum_n \left(\sum_{k\leqslant n} \frac1{\log k}\right)b_n.$$
It remains to observe that $$\pi(n)\sim \frac{n}{\log n}\sim \sum_{k\leqslant n}\frac1{\log k}.$$
