Why should I switch to Python? - Infinity of Primes

dave white dwhite2 at seas.upenn.edu
Fri Apr 7 18:00:10 EDT 2000

Since we're on the subject of primes...  I've heard that there's a nice
probabilistic algorithm for computing large primes using Fermat's Little
Theorem.  Python seems like it would be well suited for this since
bignums are built into the language.  Does anyone know this algorithm?  

Fermat's Little Theorem:
Let p be a prime which does not divide the integer a, then a^(n-1) =
1(mod p)


More information about the Python-list mailing list