Fermat's little theorem
The last fact generalizes Fermat's little theorem. These facts are used in the Lucas–Lehmer primality test.