2

$$P_n \sim n\ln(n)\tag1$$

Where $P_n$ is the nth prime number

Equation $(2)$ is an improvement of $(1)$

$(2)$ comes about through trial and error using Wolfram alpha. $$ P_n \sim \frac{10^n[\ln(n)-\frac{1}{4}]}{2\operatorname{Li}(10^n)}\tag2$$ Where $\operatorname{Li}(n)$ is the Logarithmic integral

Example:

$(1):$

$$P_{10,000}\sim 10,000\ln(10,000)$$

$$104,729 \sim 92,103$$

Got an error of $12$%

$(2):$

$$P_{10,000} \sim \frac{10^{10,000}\left[\ln(10,000)-\frac{1}{4}\right]}{2\operatorname{Li}(10^{10,000})}$$

$$104,729\sim 103,155$$

Got an error of $1.5$%

Can anyone help to improve on $(2)$?

Gary
  • 31,845
Sibawayh
  • 1,353
  • The values you verified are still very small. Are you interested in good approximations for small $n$ or a general approximation ? In the latter case, the Dusart-bounds are already quite tight.For very small $n$, the best is probably to use the Meissel-Lehmer algorithm (computing the prime-counting function) to solve $\pi(x)=n$ – Peter Dec 28 '20 at 08:07
  • For a general approximation. I am curious does the above formula hold for large n – Sibawayh Dec 28 '20 at 08:20
  • Consider https://arxiv.org/abs/1203.5413 – Gary Dec 30 '20 at 18:11

1 Answers1

4

Your approximation is very bad because $\operatorname{Li}(x) \sim \frac{x}{\ln x}$ and so \begin{align*}\frac{10^n (\ln n-0.25)}{2 \operatorname{Li}(10^n)} &\sim \frac{10^n (\ln n-0.25)}{2 \frac{10^n}{\ln 10^n}} = \frac{\ln 10^ n (\ln n-0.25)}{2} \\ & = \frac{n \ln 10 (\ln n-\frac{1}{4})}{2} \sim \frac{n \ln n }{2} \ln 10 \approx 1.15129 n \ln n\end{align*} for large enough $n$.

M. Cipolla proved that there are arbitrarily better approximation for $p_n$, for example there are $ p_n \sim n \ln n$ and $ p_n \sim n(\ln n+\ln \ln n-1) $ and $p_n \sim n(\ln n+\ln \ln n-1+\frac{\ln \ln n-2}{\ln n}) $

Gary
  • 31,845
Ahmad
  • 1,380
  • 1
  • 18
  • 37