One series converges iff the other converges In Show that $\sum\limits_pa_p$ converges iff $\sum\limits_{n}\frac{a_n}{\log n}$ converges it is said that this sequence of  partial sums converges
$$
\begin{split}
\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)
\end{split}
$$  iff this sequence of partial sums converges
$$\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)∼ \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)$$ But I don't see why. I think this should be clear but I can't get it. Can someone explain? ($a_n$ is a non-increasing sequence of positive numbers.)
 A: Since $a_n$ is nonincreasing and nonnegative, $a_n$ converges to some real $a\ge0$. If $a>0$, then neither one of the two series converges. It remains to consider the case $a=0$. Then
\begin{equation*}
    a_n=\sum_{j\ge n}b_j  \tag{1}\label{1}
\end{equation*}
for some nonnegative $b_j$'s.
By the prime number theorem,
\begin{equation*}
    \sum_{k\le n} 1(k\in P)\sim \frac n{\ln n}\sim\sum_{k\le n}\frac1{\ln k}, \tag{2}\label{2}
\end{equation*}
where $P$ is the set of all prime numbers.
In view of \eqref{1},
\begin{equation*}
\begin{aligned}
    \sum_p a_p&=\sum_n 1(n\in P)\,a_n \\ 
    &=\sum_n 1(n\in P)\,\sum_{j\ge n}b_j \\ 
    &=\sum_j b_j\sum_{n\le j} 1(n\in P). 
\end{aligned}   
\tag{3}\label{3}
\end{equation*}
By \eqref{2},
\begin{equation}
    \sum_j b_j\sum_{n\le j} 1(n\in P)<\infty \iff 
    \sum_j b_j\sum_{k\le j}\frac1{\ln k}<\infty. 
    \tag{4}\label{4}
\end{equation}
But
\begin{equation*}
\begin{aligned}
    &\sum_j b_j\sum_{k\le j}\frac1{\ln k} \\ 
    &=\sum_k\frac1{\ln k}\sum_{j\ge k} b_j \\ 
        &=\sum_k\frac{a_k}{\ln k}. 
        \end{aligned}
        \tag{5}\label{5}    
\end{equation*}
It follows from \eqref{3}, \eqref{4}, and \eqref{5} that
\begin{equation}
    \sum_p a_p<\infty \iff 
\sum_k\frac{a_k}{\ln k}<\infty, 
\end{equation}
as desired.
