2

If you plot the following function $$f(n) = \frac{(p_1+\ldots+p_{n})}{n} - \frac{(p_1+\ldots+p_{n-1})}{n-1}$$ you get a graph that is similar to $$f(x) = \frac{5}{4}\log(x) + \frac{1}{2}$$

From this we can state $$\frac{(p_1+\ldots+p_{n})}{n} - \frac{(p_1+\ldots+p_{n-1})}{n-1} \sim \frac{5}{4}\log(n) + \frac{1}{2}$$ $$(p_1+\ldots+p_{n}) - (p_1+\ldots+p_{n-1}) \sim \frac{5}{4}n\log(n) + \frac{1}{2}n$$ $$p_n \sim \frac{5}{4}n\log(n) + \frac{1}{2}n + \frac{(p_1+\ldots+p_{n-1})}{n-1}$$

Looking at the graph for $$\left|\frac{5}{4}n\log(n) + \frac{1}{2}n + \frac{(p_1+\ldots+p_{n-1})}{n-1} - p_n\right|$$ the maximum error seems to be $\log(n^2)^2$, which would be quite good for larger $n$'s (if it is indeed true)

Marijn
  • 1,037
  • You are overestimating, $p_n = n\log n + n\log \log n - n + o(n)$. – Daniel Fischer Sep 03 '15 at 12:33
  • 1
    Please show us your graphs, or at least tell us the range of $n$ they span. It's possible your approximation is reasonably good for $n$ "small," but as has been pointed out, it overestimates $p_n$ for large $n$. (A minor side remark: The running average of the primes is an increasing function of $n$, so there is no need for the absolute value sign in your formula defining $f(n)$.) – Barry Cipra Sep 03 '15 at 18:08

1 Answers1

6

First of all, notation: $f(x)\sim g(x)$ means that $$ \lim_{x\to\infty}\frac{f(x)}{g(x)}=1, $$ and $f(x)\approx g(x)$ means that the two functions are 'approximately' equal (which doesn't have a precise definition).

$p_1+\cdots+p_n \sim \tfrac12n^2\log n$ and so after a little fiddling we see that $$ \frac{p_1+\cdots+p_{n-1}}{n-1} \sim \tfrac12n\log n $$ so your formula is asymptotically $\tfrac74n\log n$ which is an overestimate by 75%.

Charles
  • 32,999
  • Thanks for the clarification. I thought I could use the $\sim$ symbol as 'roughly approximates', but perhaps I could have better used the $\approx$ symbol, as you mentioned. – Marijn Sep 06 '15 at 21:13
  • Note that $\frac{{p_1 + \ldots + p_{n - 1} }}{{n - 1}} \sim \frac{1}{2}n\log n$. – Gary Jan 03 '25 at 11:59
  • 1
    @Gary Indeed, and that makes it even worse! I’ve edited. – Charles Jan 04 '25 at 15:43