Definition: If p is a prime and gcd(a,p)=1, then ap−1≡1(mod p). if p is a prime, then for all a, ap≡a(mod p)