Fermat's little theorem states that if p is a prime number, then for any integer a, the number a p − a is an integer multiple of p.
In the notation of modular arithmetic, this is expressed as

For example, if a = 2 and p = 7, 27 = 128, and 128 − 2 = 7 × 18 is an integer Read More →