# Why is $p_n \sim n\ln(n)$?

I know that the prime number theorem states that the number of primes less than $x$ is approximately $\frac{x}{\ln(x)}$. However, why does this mean that $p_n \sim n\ln(n)$? (where $p_n$ is the $n$-th prime). If we replace $x$ with $p_n$ in the original equation, we have that $\pi(p_n) \ln({p_n})\sim p_n$, and $\pi(p_n)$ is just $n$, but what about the $\ln({p_n})$?

• there are precise versions in Rosser and Schoenfeld (1962) – Will Jagy Aug 28 '15 at 23:28
• projecteuclid.org/euclid.ijm/1255631807 – Will Jagy Aug 28 '15 at 23:35
• Given one statement, we get the other by noticing that $\frac{x}{\ln(x)}$ and $x \ln(x)$ are "approximate inverses". With $x \gg 1$, you get $\frac{x \ln(x)}{\ln(x \ln(x))}=\frac{x \ln(x)}{\ln(x) + \ln(\ln(x))}=\frac{x}{1+\ln(\ln(x))/\ln(x)} \approx x(1-\ln(\ln(x))/\ln(x))$. So you have a rapidly decaying multiplicative error. – Ian Aug 29 '15 at 0:00
• Concretely, with $x=e^{e^4} \approx 5.1 \cdot 10^{23}$, $\frac{x}{1+\ln(\ln(x))/\ln(x)}=\frac{e^{e^4}}{1+4/e^4} \approx 4.8 \cdot 10^{23}$. – Ian Aug 29 '15 at 0:06
• Changing notation slightly, $p(n)$ is the solution to $\pi(m) = n$ i.e. $\pi^{-1}(n)$. So if $\pi(m)$ is essentially $\frac{m}{\ln(m)}$ then $\pi^{-1}(n)$ is essentially $n \ln(n)$. – Ian Aug 29 '15 at 0:30

made a jpeg, see if it comes out readable: Theorem 3 says that putting in the extra $\log \log n$ term is quite good. 