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


Solution 1:

By partial summation we have $$ \sum_{1<n\leq N}\frac{a_{n}}{\log\left(n\right)}=\sum_{1<n\leq N}1\cdot\frac{a_{n}}{\log\left(n\right)}=\frac{\left(N-1\right)a_{N}}{\log\left(N\right)}+\sum_{k\leq N-1}\left(k-1\right)\left(\frac{a_{k}}{\log\left(k\right)}-\frac{a_{k+1}}{\log\left(k+1\right)}\right)$$ 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.