Maths WorkshopMaths problems with full solutions
Exercise 1335Number theory › PrimesOlympiadAdded 5 Nov 2026

Prime divisors of 2ᵖ − 1

#Mersenne numbers#order#primality testing

Statement

Let pp be an odd prime and qq a prime dividing 2p−12^p-1.

  1. Prove that q≡1(mod2p)q\equiv1\pmod{2p}.
  2. Use this to show that 8191=213−18191=2^{13}-1 is prime.
Hint

The order of 22 modulo qq divides pp. It cannot be 11.

Show solutionHide solution

Solution

1. qq is odd. From 2p≡1(modq)2^p\equiv1\pmod q, the order dd of 22 modulo qq divides pp, so d∈{1,p}d\in\{1,p\}. If d=1d=1 then 2≡1(modq)2\equiv1\pmod q, impossible. So d=pd=p. By Fermat's little theorem 2q−1≡12^{q-1}\equiv1, hence p∣q−1p\mid q-1. Since q−1q-1 is even and pp is odd, 2p∣q−12p\mid q-1.

2. Suppose 81918191 is composite. Then it has a prime factor q≤8191<91q\le\sqrt{8191}<91, and by part 1, q≡1(mod26)q\equiv1\pmod{26}. The numbers ≡1(mod26)\equiv1\pmod{26} below 9191 are 27,53,7927,53,79. Among them 2727 is not prime. Check: 8191=53⋅154+298191=53\cdot154+29 and 8191=79⋅103+548191=79\cdot103+54, so neither divides 81918191. Contradiction: 81918191 is prime.

Another check. 211−1=2047=23⋅892^{11}-1=2047=23\cdot89, and 23=1+2⋅1123=1+2\cdot11, 89=1+8⋅1189=1+8\cdot11 ✓.

Lesson. The multiplicative order of aa modulo a prime q∣ap−1q\mid a^p-1 is pp, so q≡1(modp)q\equiv1\pmod p.