It is a theorem that states that for any prime number p and any integer a not divisible by p, a^(p-1) ≡ 1(mod p).