Fermat's little theorem
- Olympiad · IOQM
Fermat's little theorem says that if p is prime and p does not divide a, then aᵖ⁻¹ leaves remainder 1 on division by p.
In the language of congruence, aᵖ⁻¹ ≡ 1 (mod p). For example, take p = 5 and a = 2. Then 2⁴ = 16, and 16 leaves 1 when divided by 5. Take p = 7 and a = 3. Then 3⁶ = 729, which is 7 × 104 + 1.
The theorem is useful for finding the remainder of a very large power. You never have to work out the power itself. Both conditions matter: p must be prime, and a must not be a multiple of p.
A small example
Find the remainder when 3¹⁰⁰ is divided by 7. Here p = 7 is prime and 3 is not a multiple of 7.
- By the theorem, 3⁶ ≡ 1 (mod 7).
- Divide the power by 6: 100 = 6 × 16 + 4.
- So 3¹⁰⁰ = (3⁶)¹⁶ × 3⁴, which is 1 × 3⁴ in remainders.
- 3⁴ = 81 = 7 × 11 + 4. The remainder is 4.
The same steps work for any prime. For a divisor that is not prime, a wider rule uses Euler's totient function.
Where it fits
This goes beyond the Class 10 board syllabus. HBCSE's syllabus for the Mathematical Olympiad names it under number theory. The Mathematics Teachers' Association (India), MTA(I), conducts IOQM, the first stage of the Mathematical Olympiad Programme that HBCSE organises for NBHM.
Sources
Facts last checked against these sources on 30 September 2026.
- Syllabus for Mathematical Olympiad (Number Theory) · HBCSE, TIFR
- Mathematical Olympiad 2026-2027: stages of selection · HBCSE, TIFR
- Brochure: Mathematical Olympiads 2026-2027 · HBCSE, TIFR
About the author

Chief Architect
An engineer (B.Tech, Computer Science) with over 20 years of preparing students for entrance exams, including as Dean at FIITJEE and Vice-President at Aakash. He is the chief architect of the TRUpreBoards evaluation engine.
Mohit Sardana on LinkedIn