Fermat's probabilistic primality test