[][src]Crate primecount

Functions

nth_prime

Find the nth prime using a combination of the prime counting function and the sieve of Eratosthenes. @pre n <= 216289611853439384 Returns -1 if an error occurs.

phi

Partial sieve function (a.k.a. Legendre-sum). phi(x, a) counts the numbers <= x that are not divisible by any of the first a primes. Returns -1 if an error occurs.

pi

Count the number of primes <= x using Xavier Gourdon's algorithm. Uses all CPU cores by default. Returns -1 if an error occurs.