How to calculate
Test each candidate against earlier primes up to its square root. The first candidate with no prime divisor in that range is the next prime.
Worked example
Use Prime index from 1 through 1,000 1000. The result is 7919.
Input and result notes
The first prime is 2. Choose an index from 1 through 1,000.