# A problem of Erdős on convergence of $\sum (-1)^nn/p_n$ and equidistribution of $\pi(n)$ modulo 2

$$\sum_{n=1}^\infty \frac{(-1)^n n}{p_n}$$ converges.

Here, $$p_n$$ denotes the n-th prime. I can show that this series converges simultaneously with the series $$\sum_{m=2}^\infty \frac{(-1)^{\pi(m)}}{m \log m}$$ by using the prime number theorem and estimating the difference between $$\frac{n}{p_n}$$ and $$\frac{n+1}{p_{n+1}}$$ for odd and even $$n$$. Hence, the problem comes down to understanding the equidistribution of the parity of the prime counting function $$\pi(m)$$.

Let $$E_n = \{ m \leq n : \pi(m) \equiv 0 \mod 2 \}$$ and $$O_n = \{ m \leq n : \pi(m) \equiv 1 \mod 2 \}$$. Then one naturally asks:

Is $$\lim_{n \to \infty} \frac{|E_n|}{n} = \lim_{n \to \infty}\frac{|O_n|}{n}=\frac{1}{2}$$?

If this result is true, can we prove convergence?

1See, for example: Guy R.K. Unsolved problems in number theory (2nd ed., Springer, 1994), page 203, E7 or Steven R.Finch: Mathematical Constants (Cambridge University Press, 2003), page 96.

• @GerhardPaseman, Mustafa: I suggest to erase all previous comments, obsolete now – YCor Oct 28 '18 at 16:20
• The convergence cannot be formally deduced if the $1/2$ distribution result holds. To be more precise, it is an exercise that there exists a $\{0,1\}$-equidistributed (in the given sense) sequence $(s(n))$ such that $\sum \frac{(-1)^{s(n)}}{n\log n}$ does not converge. – YCor Oct 28 '18 at 16:24
• Intuitively, the convergence requires the sequence $(-1)^{\pi(n)}$ to be "close to" $(-1)^{n}$. So perhaps one should find a tight upper bound (probably an $O(1)$ ) for the quantity $\vert\vert E(n)\vert-\vert O(n)\vert\vert$. – Sylvain JULIEN Oct 29 '18 at 9:43
• @SylvainJULIEN $|E_n| - |O_n|$ is certainly not bounded, because there are arbitrarily large gaps in the primes. – Sean Eberhard Oct 29 '18 at 11:55