Maths WorkshopMaths problems with full solutions
Exercise 1131Number theory › PrimesL1Added 3 Nov 2026

Fermat's little theorem and compositeness

#Fermat#compositeness test#modular exponentiation

Statement

Use Fermat's little theorem to show that 1515 is composite.

Hint

Find aa coprime to 1515 with a14≢1(mod15)a^{14}\not\equiv1\pmod{15}.

Show solutionHide solution

Solution

Fermat test. If 1515 were prime, then a14≡1(mod15)a^{14}\equiv1\pmod{15} for all aa coprime to 1515.

Try a=2a=2. 24=16≡1(mod15)2^4=16\equiv1\pmod{15}, so 214=212⋅22=(24)3⋅4≡4(mod15)≠12^{14}=2^{12}\cdot2^2=(2^4)^3\cdot4\equiv4\pmod{15}\neq1.

Conclusion. 214≢1(mod15)2^{14}\not\equiv1\pmod{15}, so 1515 is composite.