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

Pseudoprimes

#pseudoprime#Fermat#compositeness

Statement

Define a Fermat pseudoprime to base aa, and show that 341341 is a pseudoprime to base 22.

Hint

Show 2340≡1(mod341)2^{340}\equiv1\pmod{341} with 341=11⋅31341=11\cdot31.

Show solutionHide solution

Solution

Definition. A composite nn with an−1≡1(modn)a^{n-1}\equiv1\pmod n for some aa coprime to nn.

Compute. 341=11⋅31341=11\cdot31.
- mod 1111: 210≡12^{10}\equiv1, 340=34⋅10340=34\cdot10, so 2340≡12^{340}\equiv1.
- mod 3131: 25=32≡12^5=32\equiv1, 340=68⋅5340=68\cdot5, so 2340≡12^{340}\equiv1.

CRT. 2340≡1(mod341)2^{340}\equiv1\pmod{341}.

Conclusion. 341341 is a Fermat pseudoprime to base 22.