FiSGO.PrimesHandler.nth_prime

nth_prime(n, primes_path='/home/docs/checkouts/readthedocs.org/user_builds/fisgo/checkouts/latest/FiSGO/PrecomputedData/BuiltinPrimes.txt')[source]

Given an integer n, returns the nth prime number.

Caution

the function starts counting at 1, so the prime 2 correspons to n = 1, 3 to n = 2 etc.

The function uses FiSGO.PrimesHandler.primes(), Refer to the documentation of FiSGO.PrimesHandler.primes() for additional information.

Parameters:
  • n (int) – Positive integer, position of the prime to search.

  • primes_path – Path to a file with an ordered list of prime numbers.

Return type:

int

Returns:

Integer, the nth prime number.