galois.kth_prime

galois.kth_prime(k: int) int

Returns the \(k\)-th prime.

Parameters
k: int

The prime index (1-indexed), where \(k = \{1,2,3,4,\dots\}\) for primes \(p = \{2,3,5,7,\dots\}\).

Returns

The \(k\)-th prime.

Examples

In [1]: galois.kth_prime(1)
Out[1]: 2

In [2]: galois.kth_prime(3)
Out[2]: 5

In [3]: galois.kth_prime(1000)
Out[3]: 7919

Last update: Apr 21, 2022