Concepts3
∑MathIntermediate
Fermat's Little Theorem
Fermat's Little Theorem says that for a prime p and integer a not divisible by p, a^{p-1} ≡ 1 (mod p).
#fermat's little theorem#modular inverse#binary exponentiation+11
∑MathIntermediate
Fast Exponentiation
Fast exponentiation (binary exponentiation) computes a^n using repeated squaring in O(log n) multiplications.
#binary exponentiation#fast power#modular exponentiation+11
⚙️AlgorithmIntermediate
Matrix Exponentiation
Matrix exponentiation turns repeated linear transitions into a single fast power of a matrix using exponentiation by squaring.
#matrix exponentiation#binary exponentiation#companion matrix+11