Why should I switch to Python? - Infinity of Primes

dave white dwhite2 at seas.upenn.edu
Sat Apr 8 00:00:10 CEST 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)

cheers,
david



More information about the Python-list mailing list