fermat_factor, a C code which uses Fermat's factorization method to decompose an integer N into the product of two factors, N = A^2-B^2 = (A+B)*(A-B).
The algorithm seeks to write N = A^2 - B^2 = ( A + B ) * ( A - B ).
The information on this web page is distributed under the MIT license.
fermat_factor 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.
is_prime, a C code which determines if a given integer n is prime, using various versions of the sieve of Eratosthenes.
prime_pi, a C code which evaluates Pi(n), the number of primes less than or equal to an integer n.