Groups
Category
Level
Fermat's Little Theorem says that for a prime p and integer a not divisible by p, a^{p-1} ≡ 1 (mod p).
Fast exponentiation (binary exponentiation) computes a^n using repeated squaring in O(log n) multiplications.