Maths WorkshopMaths problems with full solutions
Exercise 847Number theory › CongruencesL1Added 3 Nov 2026

Fermat's little theorem

#Fermat#prime#modular exponentiation

Statement

State Fermat's little theorem and use it to compute 2100(mod13)2^{100}\pmod{13}.

Hint

For prime pp and gcd⁡(a,p)=1\gcd(a,p)=1: ap−1≡1(modp)a^{p-1}\equiv1\pmod p.

Show solutionHide solution

Solution

Theorem. If pp is prime and p∤ap\nmid a, then ap−1≡1(modp)a^{p-1}\equiv1\pmod p.

Application. p=13p=13, a=2a=2, p−1=12p-1=12. So 212≡1(mod13)2^{12}\equiv1\pmod{13}.

Compute. 100=12⋅8+4100=12\cdot8+4, so 2100=(212)8⋅24≡24=16≡3(mod13)2^{100}=(2^{12})^8\cdot2^4\equiv2^4=16\equiv3\pmod{13}.

Conclusion. 2100≡3(mod13)2^{100}\equiv3\pmod{13}.