1

I have attempted to put together an approximation for the sum of primes.

I've used the much simplified $$\operatorname{li}(x)=\frac{x}{\log(x)-1}$$ combined with $$\frac{x}{2}$$ to give:

$$\frac{x^2}{2(\log(x)-1)}$$

The only thing is it is not accurate so:

1) I wonder if I've gone wrong? or does it get accurate with numbers $> 10000$?

2) Suggestions for better approximations but not depending on many iterations.

3) $$x/ \log x$$ pointed out by @mixedmath is the usual way to introduce the prime number theorem but wouldn't using the approximation to $\operatorname{li}(x)$ above be better with $x/2$?

onepound
  • 1,365
  • How did you combine the first equation with the second to get the third? It seems that you replaced $x \to x^2$ – MrYouMath Sep 30 '17 at 20:22
  • What sum of primes? – gammatester Sep 30 '17 at 20:23
  • You should better use $\text{Li}(x) =\int_2^x \frac{dt}{\log t}= \sum_{2 \le n \le x} \frac{1}{\log n}+ \mathcal{O}(1)$ and $\sum_{p \le x} f(p)\sim \sum_{2 \le n \le x} \frac{f(n)}{\log n}$ for $f$ nice enough – reuns Sep 30 '17 at 20:27
  • @ reuns how would they combine? – onepound Sep 30 '17 at 21:06
  • Interestingly, although $\operatorname{li}(x)$ is a better approximation to $\pi(x)$ than either of $\frac{x}{\log x}$ or $\frac{x}{\log x - 1}$, the approximation $\frac{x^2}{2(\log x - 1)}$ to $\sum_{p \leqslant x} p$ is better than either of $\frac{x^2}{2\log x}$ or $\frac{x}{2}\operatorname{li}(x)$. – Daniel Fischer Oct 08 '17 at 16:15

2 Answers2

2

If you look here, you will see that, as a first approximation $$S_n=\sum_{i=1}^n p_i \approx \frac 12 n^2 \log(n)$$ If you look at sequence $A007504$ at $OEIS$, you will see that for $n\geq 3$ $$\frac 12 (n-1)^2 \, \left(\log(n-1) -\frac 12\right) \leq S_n \leq \frac 12 n (n+1)\,\left(\log(n) + \log(\log(n))+ 1\right)$$ making $$S_n =\frac 12 n^2 \, \log(n) + O\left(n^2 \log(\log(n))\right)$$

You could be interested by this very recent paper.

1

I'm not sure why you're using $x/(\log x - 1)$ instead of $x/ \log x$ (which is what's given in the standard prime number theory), but if you were to use $x/\log x$ you would actually get the correct asymptotic: $x^2 / 2 \log x$. This is a pretty slowly converging asymptotic: the error term is on the order of $O(x^2/\log^2 x)$.

  • I was wondering if you had any book or paper or web were $O(x^2/\log^2 x)$ comes from so that I can understand it better? – onepound Oct 13 '17 at 11:14