prime_miller_rabin


prime_miller_rabin, a Python code which applies the Miller-Rabin primality test to an integer n, which always correctly identifies primes, but sometimes also accepts nonprimes. bases.

Licensing:

The information on this web page is distributed under the MIT license.

Languages:

prime_miller_rabin is available in a Python version.

Related Data and Programs:

is_prime, a Python code which determines if a given integer n is prime, using various versions of the sieve of Eratosthenes.

prime, a Python code which counts primes between 1 and N, intended as a starting point for the creation of a parallel version.

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_pi, a Python code which evaluates Pi(n), the number of primes less than or equal to an integer n.

prime_plot, a Python code which displays a box plot of the prime and composite numbers.

Reference:

  1. Thomas Cormen, Charles Leiserson, Ronald Rivest, Clifford Stein,
    Introduction to Algorithms,
    Section 31.8: Primality testing,
    MIT Press; McGraw-Hill, 2001.

Source Code:


Last revised on 29 September 2024.