What is the rough upper bound to find nth prime? Also give the maximum error.

348 Views Asked by At

At first please don't mark this as duplicate. I couldn't get a satisfactory answer in previous questions.

I want a simple upper bound calculating formula for n-th prime which should not have integration or other complex thing. I also need the maximum error it can produce. The error can be high but the thing I need is formula must be simple.. I need this formula to write an algorithm.

1

There are 1 best solutions below

0
On BEST ANSWER

For explicit bounds we have

$$ p_n \le n\bigg(\log n + \log\log n - 1 + \frac{\log\log n - 2.1}{\log n}\bigg) \text{ for $x \ge 3$} $$ and $$ p_n \ge n\bigg(\log n + \log\log n - 1 + \frac{\log\log n - 2}{\log n}\bigg) \text{ for $x \ge 688,383$} $$ and for an error estimate, we have $$ p_n = n\bigg(\log n + \log\log n - 1 + \frac{\log\log n - 2}{\log n} + \frac{\log\log^2 n - 6\log\log x + 11}{2\log^2 n} \bigg) \\ + O\bigg(\frac{\log\log^3 n}{\log^3 n}\bigg) $$

Reference: https://arxiv.org/PS_cache/arxiv/pdf/1002/1002.0442v1.pdf