Primality testing in Python

There are a number of ways to test whether a number is prime. Miller-Rabin primality tests yields good accuracy with reasonable run times.

more ...