Fermat's Little Theorem
For prime p and a not divisible by p, a^(p-1) = 1 mod p.
Multiples, Powers, Pascal: 3 to the 6 mod 7
3^6 = 5 x 3 mod 7 = 15 mod 7 = 1. Exponent 6 lands on 1, as Fermat promised.
Cost
- Space
- O(1)
Before this
Leads to
Topics that need this one first.
Taught by the same lesson
Multiples, Powers, Pascal covers these too, in the same run.