prime_pi, a Python code which evaluates Pi(n), the number of primes less than or equal to an integer n.
The information on this web page is distributed under the MIT license.
prime_pi is available in a C version and a C++ version and a Fortran90 version and a MATLAB version and an Octave version and a Python version.
euclid, a Python code which investigates various versions of Euclid's algorithm for computing the greatest common divisor (GCD) of two integers.
i4lib, a Python code which contains many utility routines, using integer arithmetic.
is_prime, a Python code which implements various versions of the sieve of Eratosthenes to determine whether a given integer is prime.
lucas_lehmer, a Python code which determines whether a Mersenne number 2^n-1 is prime by applying the Lucas-Lehmer test.
polpak, a Python code which evaluates a variety of mathematical functions, polynomials, and sequences, including Bell, Benford, Bernoulli, Bernstein, Cardan, Catalan, Charlier, Chebyshev, Collatz, Delannoy, Euler, Fibonacci, Gegenbauer, Gudermannian, Harmonic, Hermite, Hofstadter, Jacobi, Krawtchouk, Laguerre, Lambert, Legendre, Lerch, Meixner, Mertens, Moebius, Motzkin, Phi, Stirling, Tau, Tribonacci, Zernike.
prime_factors, a Python code which returns a list of the prime factors of an integer.
prime_fermat, a Python code which applies Fermat's primality test to an integer n, which always correctly identifies primes, but sometimes also accepts nonprimes. Nonetheless, the test is useful for weeding out most nonprimes. The accuracy of the test can be improved by running it for several bases.
prime_plot, a Python code which displays a box plot of the prime and composite numbers.