# 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)**:

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

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: