The Nth Prime Number and the Prime Number Theorem

The Nth Prime Calculator

The Prime Number Theorem describes how prime numbers occur less frequently as numbers get larger. By defining the pi function, π(x) as the number of primes less than or equal to x, we get the following approximation for π(x):

Approximation for the π(x) Function

As a consequence, it is possible to determine the approximate location of the nth prime, as follows

Approximation for the nth Prime

The Prime Number Theorem and the approximation can be empirically demonstrated - the following graph of the predicted, and actual, number of primes per million numbers as determined from the Stats Fiddle database of Prime Numbers: