# simple prime formula $\sum_{i=0}^{\infty}\left\lfloor \frac{2n}{\pi(i)+n+1} \right\rfloor=P_n$

$\pi(n)$ is the prime counting function

$\lfloor x\rfloor$ is the floor function

$P_n$ is the nth prime number

Mathematical experiment with wolfram calculator yield:

No messy radical or power involve here

We need a proof to verify that this formula is correct.

Can anybody help us?

$$\sum_{i=0}^{\infty}\left\lfloor \frac{2n}{\pi(i)+n+1} \right\rfloor=P_n$$

Just wonder if this formula can be simplify more further.

• Can you tell us a little bit about how you guessed such a formula? – Ravi May 5 '16 at 21:11
• I was observing Martin Sebastian Ruiz and wallah formulas – user334593 May 5 '16 at 21:20

The proof is simple: partition the sum to whenever $\pi(i)$ jumps up by 1, i.e. when $i=P_j$ , the $j$'th prime. Then your sum is just:
$$2+\sum_{j=1}^\infty\left[\frac{2n}{j+n+1}\right](P_{j+1}-P_j)=2+\sum_{j=1}^{n-1}(P_{j+1}-P_j)=P_n.$$
Where we noticed that the floored term is always 1 until $j$ exceeds $n-1$, where it becomes 0. So your sum telescopes and the result follows.