Maths WorkshopMaths problems with full solutions
Exercise 1961Number theory › Divisibility and gcdOlympiadAdded 4 Nov 2026

Prime factors of Fermat numbers

#order#Fermat numbers#Fermat's little theorem

Statement

Let Fk=22k+1F_k=2^{2^k}+1. Prove that every prime divisor pp of FkF_k satisfies p≡1(mod2k+1)p\equiv1\pmod{2^{k+1}}. Deduce that every prime divisor of F5=232+1F_5=2^{32}+1 is of the form 64m+164m+1, and verify that 641∣F5641\mid F_5.

Hint

Compute the order of 22 modulo pp. It divides 2k+12^{k+1}, but does not divide 2k2^k.

Show solutionHide solution

Solution

Idea. The order of 22 modulo pp is exactly 2k+12^{k+1}, and orders divide p−1p-1.

Proof. Let p∣Fkp\mid F_k. Then pp is odd and 22k≡−1(modp)2^{2^k}\equiv-1\pmod p. Squaring, 22k+1≡1(modp)2^{2^{k+1}}\equiv1\pmod p, so the order dd of 22 divides 2k+12^{k+1}, hence d=2jd=2^j with j≤k+1j\le k+1. If j≤kj\le k, then 22k≡12^{2^k}\equiv1 (as d∣2kd\mid2^k), but we know 22k≡−1≢1(modp)2^{2^k}\equiv-1\not\equiv1\pmod p since p>2p>2. Thus d=2k+1d=2^{k+1}. By Fermat's little theorem d∣p−1d\mid p-1, so p≡1(mod2k+1)p\equiv1\pmod{2^{k+1}}.

Case k=5k=5. The primes dividing F5F_5 are among 64m+164m+1: 193,257,449,577,641,…193,257,449,577,641,\dots Only 641=10⋅64+1641=10\cdot64+1 is needed.
We use two expressions for 641641: 641=5⋅27+1641=5\cdot2^7+1 and 641=24+54641=2^4+5^4. The first gives 5⋅27≡−1(mod641)5\cdot2^7\equiv-1\pmod{641}, so 54⋅228≡15^4\cdot2^{28}\equiv1. The second gives 54≡−245^4\equiv-2^4. Substituting, −24⋅228≡1-2^4\cdot2^{28}\equiv1, i.e. 232≡−1(mod641)2^{32}\equiv-1\pmod{641}, so 641∣F5641\mid F_5 ✓.

Remark. F5=641⋅6 700 417F_5=641\cdot6\,700\,417. Euler found 641641 in 1732 using exactly this restriction on divisors, refuting Fermat's belief that all FkF_k are prime.

Lesson. Compute the exact order of an element from a congruence like am≡−1a^m\equiv-1; it restricts the possible primes to an arithmetic progression.