On this page
Pick two coprime whole numbers, say a = 2 and b = 1, and list a^n − b^n for n = 1 to 8: 1, 3, 7, 15, 31, 63, 127, 255. Almost every term brings a prime that has not appeared before: 3, then 7, then 5, then 31, then 127, then 17. Apart from the starting 1, which has no prime factors at all, only 63 = 3² × 7 breaks the pattern. Zsigmondy's theorem says this is no accident, and that 63 is one of only two ways it can fail.
What does Zsigmondy's theorem say?
A prime p is a primitive prime divisor of a^n − b^n if p divides a^n − b^n but divides no a^k − b^k with 1 ≤ k < n (Wikipedia: Zsigmondy's theorem).
Zsigmondy's theorem states that if a > b ≥ 1 are coprime integers and n ≥ 2, then a^n − b^n has a primitive prime divisor, with two exceptions: 2^6 − 1^6, and n = 2 with a + b a power of 2 (Wolfram MathWorld).
Karl Zsigmondy published the result in 1892 as "Zur Theorie der Potenzreste" in Monatshefte für Mathematik und Physik, volume 3, pages 265-284 (DOI 10.1007/BF01692444). It generalises Bang's theorem, which A. S. Bang published in 1886 for the case a = 2, b = 1 (Wikipedia).
There is a companion for sums: a^n + b^n has a primitive prime divisor except for 2^3 + 1^3 = 9 (MathWorld).
Why are 63 and a + b = 2^k the exceptions?
Check both by hand; it takes a minute.
2^6 − 1 = 63 = 3² × 7. But 3 already divides 2^2 − 1 = 3, and 7 already divides 2^3 − 1 = 7. Nothing new.
n = 2: a^2 − b^2 = (a − b)(a + b). If a + b is a power of 2, a and b are both odd, so every odd prime factor of a^2 − b^2 lies in a − b, and 2 already divides a − b. Example: 5^2 − 3^2 = 16, and 2 already divides 5 − 3 = 2. The same happens with 3^2 − 1 = 8.
Everywhere else a new prime turns up. 3^3 − 1 = 26 = 2 × 13 brings 13; 3^4 − 1 = 80 = 2^4 × 5 brings 5.
Why: p cannot divide b, so b⁻¹ exists mod p; then (a·b⁻¹)^n ≡ 1 mod p and no smaller power is, so its order is n, and by Fermat's little theorem that order divides p − 1. If orders feel shaky, our explainer on primitive roots modulo a prime builds the idea up with small examples.
How do olympiad problems use Zsigmondy's theorem?
The theorem turns "these numbers only use a few primes" into a contradiction. Here is a worked example.
Problem. Find all positive integers n and m with 2^n − 1 = 3^m.
Set up: a = 2, b = 1, coprime. The only prime allowed on the right is 3.
Check the small cases and the exception by hand: n = 1 gives 1, so no m ≥ 1 works; n = 2 gives 3 = 3^1, a solution; n = 6 gives 63, not a power of 3.
For every other n ≥ 3, Zsigmondy gives a prime p that divides 2^n − 1 but not 2^2 − 1 = 3. So p ≠ 3, and 2^n − 1 is not a power of 3.
Answer: n = 2, m = 1.
An LTE argument also works (see our guide to the lifting the exponent lemma), but Zsigmondy settles it in one step. The same idea leaves only finitely many n to check whenever 2^n − 1 may use only a fixed finite set of primes, because each n beyond the exceptions brings a prime of its own.
A second use: there are infinitely many primes p ≡ 1 (mod n). Take a primitive prime divisor of 2^(nk) − 1 for k = 1, 2, 3 and so on, skipping the exceptions. Each one is ≡ 1 (mod nk), so ≡ 1 (mod n), and different k give different primes, because a primitive divisor of 2^m − 1 has order exactly m. This is a special case of Dirichlet's theorem on primes in arithmetic progressions.
At the top level, IMO 2000 Problem 5 asks whether some n with exactly 2000 distinct prime divisors divides 2^n + 1. Evan Chen's solution notes build such a number one prime at a time, each time taking "any primitive prime divisor p of 2^{2n} − 1, which exists by Zsigmondy theorem" (IMO 2000 solution notes).
When should you reach for it in a contest?
You see a^n − b^n or a^n + b^n equal to something built from few primes.
Make a and b coprime first.
Test the exceptions by hand: n = 1 (where a − b = 1 gives 1), n = 2 with a + b a power of 2, 2^6 − 1, and 2^3 + 1 for sums.
Use one property of the primitive prime p: it divides no earlier term, or p ≡ 1 (mod n).
In a written solution, name the theorem and its exceptions; if a short route through orders or LTE exists, give it too.
To practise this pattern, the Fermi Problem Library has worked problems with a step-by-step solver that explains the reasoning rather than printing an answer, so you can see where an argument slipped. If orders modulo p are the gap, the Fermi Concept Library gives every mathematics concept its own lesson.



