Identifying primes

Identifying primes

Identifying primes

different to factorising. We don’t care what the actual factors are, just see if it’s prime

Fermat’s primality test

Fermat’s little theorem recap

Fermat’s primality test

From Fermat’s little theorem we know

\(a^{n-1}=1 mod(n)\)

Where \(a\) is an integer and \(n\) is prime.