Assume we had an exact formula for $\pi (n)$, how could we get from that formula an exact expression for the $n$th prime?
I tried looking at approximations we have of $\pi (n)$ like $\frac {n}{\ln (n)}$, and from that I was able to state an approximation for the $n$th prime as $n \ln (n)$, which, with the previous definition, could be expressed as $\frac{n^2}{\pi (n)}$ but this does not seem correct.
If we had a correct expression for $\pi (n)$, how could we calculate the $n$th prime as a function of $\pi (n)$?
2026-03-26 09:19:42.1774516782
How to calculate the $n$ prime from $\pi (n)$?
612 Views Asked by Bumbble Comm https://math.techqa.club/user/bumbble-comm/detail At
1
Maybe it's too late, But I think I should answer this.
Now if you're trying to compute the nth prime, it has been proven that the nth prime must be greater than
nlog(n)+n(loglog(n))−1)
and less than
nlog(n)+nlog(log(n))
When n≥6. So if you're searching for the nth prime, you can use these ranges to search the nth prime number. Here you can use binary search to get the nth Prime number.
so m will me the prime number you are looking for.
where pi(m) is prime count function (number of primes less than m).
I use above concept to solve on SPOJ problem. http://www.spoj.com/problems/NTHPRIME/