Fermat’s Little Theorem
For prime p, aᵖ ≡ a mod p.
Key idea
For prime p, aᵖ ≡ a mod p.
In depth
If p is prime and p ∤ a, then aᵖ⁻¹ ≡ 1 (mod p). Equivalent: aᵖ ≡ a (mod p) for all a. It follows since multiplication by a permutes the non-zero residues.
Worked example
3⁶ = 729 ≡ 1 (mod 7). And 2¹⁰⁰ mod 7: 100 ≡ 4 (mod 6), so 2⁴ = 16 ≡ 2.
Formula
Real-world uses
- Testing whether a huge number is likely prime and simplifying modular powers in cryptography
Common mistake
Using it when p is not prime.
How to learn this
- Read the key idea and say it in your own words.
- Work through the worked example, then try a similar problem.
- Use the interactive lesson’s visual and mini-quiz to check the pattern.
Frequently asked questions
What is Fermat’s Little Theorem?
For prime p, aᵖ ≡ a mod p. It is a topic at the expert level in Discrete Math & Number Theory.
What is the formula for Fermat’s Little Theorem?
The key formula is aᵖ⁻¹ ≡ 1 (mod p).
Where is Fermat’s Little Theorem used in real life?
Real-world examples: Testing whether a huge number is likely prime and simplifying modular powers in cryptography.
What should I learn before Fermat’s Little Theorem?
Make sure you are comfortable with Chinese Remainder Theorem, the previous topic in Discrete Math & Number Theory.
What is a common mistake with Fermat’s Little Theorem?
Using it when p is not prime.
How can I practise Fermat’s Little Theorem?
Open the interactive lesson, play with the visual, then answer the three-question mini-quiz. Getting two right marks the topic complete.
What comes after Fermat’s Little Theorem?
Move on to Euler’s Totient Function next.
Related expert topics in Discrete Math & Number Theory
- Strong Induction – Assume all earlier cases to prove the next.
- Well-Ordering Principle – Every nonempty set of positive integers has a least element.
- Partial Orders – Reflexive, antisymmetric, transitive relations.
- Cardinality of Sets – Comparing sizes of infinite sets.
- Countable and Uncountable Sets – ℕ and ℚ are countable; ℝ is not.
- Cantor’s Diagonal Argument – Proof that real numbers are uncountable.