# 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
Commented Oct 28, 2018 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
Commented Oct 28, 2018 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$. Commented Oct 29, 2018 at 9:43
• @User Start from $s_0(n)=n$ (modulo 2). This one is equidistributed and the series converges. Now consider $X=\{2\lfloor n\log n\rfloor:n\ge 4\}$ and $Y=X\cup (X+1)$. Then $Y$ has density zero but $(1/n\log n)$ is already non-summable on $Y$, while the restriction of $(-1)^n/(n\log n)$ converges for partials sums restricted to $Y$. So, define $s(n)=s_0(n)$ for $n\notin Y$ and $s(n)=0$ for $n\in Y$. Since $s=s_0$ on a set of density 1, the equidistribution still holds. But the contribution on $Y$ (and convergence outside $Y$) will force divergence of the series $(-1)^{s(n)}/n\log n$.
– YCor
Commented Mar 3, 2022 at 10:34
• I was able to use the equivalence mentioned by the OP in a recent paper on this topic. arxiv.org/abs/2308.07205 Commented Sep 5, 2023 at 17:10