# Is there a monotonic $f$ such that $\sum f(n)$ diverges but $\sum f(p)$ converges?

(where the former summation is over natural numbers $n$ and the latter is over prime numbers $p$, and $f: \mathbb{N} \to \mathbb{R}$ is a monotonic function.)

For the class of functions $f_s(n) = \frac 1 {n^s}$, the sum over the primes converges iff the sum over $\mathbb{N}$ does (and this question perturbs this class of functions by asking about the case $f(n) = \frac 1 {n^{1+\frac 1 n}}$, but again both sums diverge). Indeed, the fact that $\sum \frac 1 p$ diverges is often viewed as a strengthened version of the fact that there are infinitely many primes, saying that the primes are "not too far" from being dense in $\mathbb{N}$.

But since the primes are not dense in $\mathbb{N}$, I'd expect that there should be reasonable functions $f$ whose sum over the primes converges while the sum over $\mathbb{N}$ diverges. (The monotonicity condition I've imposed on $f$ is meant to rule out "stupid" examples such as the characteristic function of the composite numbers. But if there are "non-stupid" non-monotonic examples, I'd be interested to hear about that too.)

I haven't thought about this question enough to see whether the prime number theorem will be all that matters or whether more refined information will be relevant.

• This question was asked over on MO here: mathoverflow.net/questions/30818/… Jan 16, 2015 at 23:39
• Wow. And even with with the same nondegeneracy requirement. I should have noticed this before asking. I especially like Pietro Majer's answer over there, which makes it clear just how little we need to know about the primes to answer the question. Density 0 indeed suffices. Jan 17, 2015 at 0:00

Since the $n$'th prime $p_n \approx n \log n$, we should have $p_n \log p_n \approx n (\log n)^2$, so $\sum_p 1/(p \log p)$ should converge, but $\sum_{n \ge 2} 1/(n \log n)$ diverges.
If you let $f(n)=\frac{1}{p_n}$, where $p_n$ is the $n$th prime, the sum on the reciprocals of the primes: $$\sum_{k=1}^\infty{\frac{1}{p_k}}$$ Diverges, but for $f(p_n)$ the sum over the reciprocal of the super-primes: $$\sum_{k=1}^\infty{\frac{1}{p_{p_k}}}=.958...$$ Converges, as well as the function being strictly decreasing.
A function such as $\frac{1}{n\ln{n}}$ should work. Proving that it works might require some heavy machinery like the prime number theorem.