Functions

Find the nth prime using a combination of the prime counting function and the sieve of Eratosthenes.

Partial sieve function (a.k.a. Legendre-sum).

Counts the number of primes <= x using Xavier Gourdon’s algorithm. Uses all CPU cores by default.