Using the Riemann hypothesis to predict $p_n$, the $n^{th}$ prime number

In this video, Terence Tao states that if you assume the Riemann hypothesis to be true, you can predict the $$n^{th}$$ prime number $$p_n$$ using

$$\int_2^{p_n} \frac{dt}{\text{log}(t)} = n+O\left(\sqrt{n\cdot\text{log}^3 n}\right)$$

which will have an error of about $$\sqrt{n}$$. He goes on to say that the error $$O\left(\sqrt{n\cdot\text{log}^3 n}\right)$$ predicted by the Riemann hypothesis is essentially the same type of error one would have expected if the primes were distributed randomly.

$$\bullet$$ Does this mean for a given value $$n$$, $$O\left(\sqrt{n\cdot\text{log}^3 n}\right)$$ cannot be calculated and acts as a random variable?

$$\bullet$$ How then could you use the formula

$$\int_2^{p_n} \frac{dt}{\text{log}(t)} = n+O\left(\sqrt{n\text{log}^3 n}\right)$$

to get a prediction for $$p_n$$? Would you ignore $$O(\cdot)$$ and numerically find $$p_n$$ such that

$$\int_2^{p_n} \frac{dt}{\text{log}(t)} = n$$

is satisfied?

$$\bullet$$ He shows here that the $$10^{12}-th$$ prime number is $$29,996,224,275,833$$ and that the Riemann hypothesis predicts it to be $$29,996,219,470,277$$ which gives an error of about $$4,805,556$$. However, he says the error will be about $$\sqrt{n}=\sqrt{10^{12}}=10^6$$ which is nearly $$5$$ times less than our error. Am I interpreting this statement incorrectly?

• I think you need the actual error term. $O()$ only shows its asymptotic growth – Shine On You Crazy Diamond Mar 22 at 3:17

For your last point, he seems to be showing $$\rm{Li}^{-1}(n)$$. At this size we can get even closer using $$\rm{R}^{-1}(n)$$, though I believe asymptotically it doesn't matter.
Add: "[...] the error will be about [...]". Not really. The bounds for the error are asymptotically that amount (as BananaCats mentions in a comment). Especially with R(x) they will fluctuate around the actual value, so at any given point it could be quite close. We have bounds (e.g. Dusart, Axler, etc.) that tell us it won't get terribly far away from Li(x). If the Riemann Hypothesis is true then we know the bounds are much tighter even for values we haven't checked. Some researchers such as Büthe and Axler have gone over empirical Riemann zero data and shown we can correctly use the much tighter Schoenfeld bound up to $$5.5 \cdot 10^{25}$$.
• So in other words, he is saying that as $n$ gets large enough, the absolute error will be less than $\sqrt{n}$? $10^{12}$ is already quite large so I guess that bound doesn't occur until much later on? – Remy Mar 22 at 18:48