Read this lesson as text
Fermat's Discovery
Number Theory · Axiom Academy
Explore the mysterious pattern Pierre de Fermat found when raising numbers to prime powers. Let's start with something basic. Choose any number and raise it to a prime power, then find the remainder when divided by that prime. Does this pattern always work? Let's check multiple combinations. Click on each card to calculate a p mod p. Let's examine all possible bases for a fixed prime. Watch what happens with p = 7. There's an even more elegant version of this pattern. If a and p are coprime (share no common factors), we can refine the theorem. If a p ≡ a (mod p), and we know a is not divisible by p, then we can divide both sides by a: Pierre de Fermat noticed that raising any number to a prime power p and taking the remainder mod p always gives back the original number. General Form: a p ≡ a (mod p) for any integer a and prime p Refined Form: a p-1 ≡ 1 (mod p) when gcd(a,p) = 1 Fermat's Little Theorem is foundational in modern cryptography (especially RSA encryption), primality testing, and understanding the multiplicative structure of modular arithmetic.
This is the written version of the interactive lesson above. See the full Number Theory course.