Theorem. Fermat’s Little Theorem [01BK]

For all natural numbers i and primes p, we have the following:

  1. i^p \equiv i \mod p
  2. i^{p-1}\equiv 1 \mod p unless i is a multiple of p