# Sum of the first n Prime numbers

Let $P_i$ denote the i-th prime number. Is there any formula for expressing

$$S= \sum_{i=1}^m P_i.$$

We know that there are around $\frac{P_m}{\ln(P_m)}$ prime numbers less than or equal to $P_m$. So, we have:

$$S\le m\times P_m\le \frac{P_m^2}{\ln(P_m)}.$$

I want to know, if there is a better bound for $S$, in the litrature.

• – fan Jul 9 '13 at 1:04
• Answered at MO mathoverflow.net/questions/63412/… – Zander Jul 9 '13 at 1:13
• @Zander: Thanks. It's nice to know that my approach is good. – robjohn Jul 10 '13 at 20:30

Summation by parts gives \begin{align} \sum_{p\le n}p &=\sum_{k=1}^n(\pi(k)-\pi(k-1))\,k\\ &=n\,\pi(n)+\sum_{k=1}^{n-1}\pi(k)(k-(k+1))\\ &=n\,\pi(n)-\sum_{k=1}^{n-1}\pi(k)\tag{1} \end{align} We have that $\pi(k)=\dfrac{k}{\log(k)}\left(1+O\left(\frac1{\log(k)}\right)\right)$ and so using the Euler-Maclaurin Sum Formula, we get that $$\sum_{k=1}^{n-1}\pi(k)=\frac12\frac{n^2}{\log(n)}+O\left(\frac{n^2}{\log(n)^2}\right)\tag{2}$$ Therefore, we get $$\sum_{p\le n}p=\frac12\frac{n^2}{\log(n)}+O\left(\frac{n^2}{\log(n)^2}\right)\tag{3}$$ Setting $n=P_m$ should give you a closer estimate.