Zsigmondy's Theorem And Its Applications
Number-theory
Olympiad-Number-theory
]
I am very happy to share with everyone that my article on has appeared in Mathematical Reflections - Issue 2 of 2025. Here is the pdf. Mathematical Reflections is a free online journal run by Awesomemath aimed primarily at high school students, undergraduates, and everyone interested in mathematics. Through articles and problems, they seek to expose readers to a variety of interesting topics that are fully accessible to the target audience. To the people who have heard the name Titu Andreescu ( or Titu’s inequality), Awesomemath was founded by him.
I am extremely grateful that Awesomemath and the mathematical reflections team gave me this opportunity :). I have made sure to make the article as self-contained as possible. The only prerequisite is comfort with modular arithmetic. I hope this article helps students interested in olympiad math and also in higher math.
Contents
- Introduction
- Zsigmondy’s Theorem
- Lifting the Exponent Lemma
- The $n=2$ case
- Cyclotomic Polynomials
- Cyclotomic Polynomials in Two Variables
- Orders and Cyclotomic Polynomials
- LTE on Cyclotomic Polynomials
- Final Proof of Zsigmondy’s Theorem
- Sum Version of Zsigmondy’s Theorem
- Some Olympiad problems
Introduction
This is a more refined and self-contained version of Yan Sheng’s blog post, Bart Michels’s paper and this AoPS post.
Zsigmondy’s Theorem states that if $a > b \geq 1$ are coprime integers and $n \geq 2$, then there exists a prime divisor of $a^n - b^n $ that does not divide $a^k - b^k$ for all $1 \leq k < n$, except when $ n = 2 $ and $ a + b $ is a power of $ 2 $ or when $(a, b, n) = (2,1,6) $.
In this document, we will go through the proof of this theorem and some applications of this theorem in math olympiad problems.
Zsigmondy’s Theorem
We essentially want to find prime divisors of $a^n-b^n$ which LTE can handle to some extent.
Lifting the Exponent Lemma
We state and prove LTE first.
Proof: We use induction on $v_p(n).$ We show for $v_p(n)=0, v_p(n)=1$ and then use induction.
-
We show it for $v_p(n)=0.$ That is show $v_p(x^n-y^n)=v_p(x-y)$, for $v_p(n)=0$. To prove this, we will show,\(v_p\left(\frac{x^n-y^n}{x-y}\right)=v_p(x^{n-1}+yx^{n-2}+y^2x^{n-3}+\dots+y^{n-1})=0.\) As $x\equiv y\pmod p$, so, \(x^{n-1}+yx^{n-2}+y^2x^{n-3}+\dots+y^{n-1}\equiv nx^{n-1}\pmod p.\) And $p\nmid nx^{n-1}$
-
We show it for $v_p(n)=1.$ That is show $v_p(x^n-y^n)=v_p(x-y)+1$ To show this is true, we will show, \(v_p\left(\frac{x^n-y^n}{x-y}\right)=v_p(x^{n-1}+yx^{n-2}+y^2x^{n-3}+\dots+y^{n-1})=1.\) As $x\equiv y\pmod p\implies x=y+pk$, so, \(x^{n-1}+yx^{n-2}+y^2x^{n-3}+\dots+y^{n-1}\pmod {p^2}\) \(\equiv (pk+y)^{n-1}+(pk+y)^{n-2}y+(pk+y)^{n-3}y^2+\dots+y^{n-1}\pmod {p^2}\) \(\equiv (y^{n-1}+pk\cdot (n-1)y^{n-2})+(y^{n-1}+ypk\cdot (n-2)y^{n-3})+\dots+y^{n-1}\pmod {p^2}\) \(\equiv n\cdot y^{n-1}+pky^{n-2}\frac{(n-1)(n)}{2} \pmod {p^2}\) Since $(n,p^2)=p.$ Let $n’=n/p.$ \(\equiv n'\cdot y^{n-1}+ky^{n-2}\frac{(n-1)(n)}{2} \pmod {p}.\) We have $p$ odd, so above is equivalent to \(\equiv n'\cdot y^{n-1}n'\pmod {p}\) but $p \nmid n’,y$. So done!
-
Let’s assume it’s true for $v_p=0,1,\dots, j-1.$ Now, we will show it’s true for $v_p(n)=j.$ Then let $n=p^j\cdot c.$ Then \(v_p(x^n-y^n)=v_p(x^{p^j\cdot c}-y^{p^j\cdot c})=v_p((x^{p})^{p^{j-1}\cdot c}-(y^{p})^{p^{j-1}\cdot c})\) \(=v_p(x^p-y^p)+v_p(p^{j-1}\cdot c)=v_p(x-y)+1+j-1=v_p(x-y)+v_p(n)\)
The $n=2$ case
So from now we assume that $n\geq3$.
Cyclotomic Polynomials
Note that there are precisely $\varphi(n)$ many primitive $n$-th roots of unity.
Note that the $n$-th roots of unity are precisely the union of the primitive $d$-th root of unity for $d\mid n$, so
\(X^n-1=\prod_{d\mid n}\Phi_d(X).\) Thus, we obtain that \(\sum_{d\mid n}\varphi(d)=n.\)
Now, we shall prove some properties about it.
Note that these polynomials are also irreducibles.
Cyclotomic Polynomials in Two Variables
Now we will see why we are dealing with cyclotomic polynomials.
Note that $\Phi_n(a,b)$ is an integer. Moreover, \(\begin{aligned} \prod_{d\mid n}\Phi_n(a,b)&=\prod_{d\mid n}b^{\varphi(d)}\Phi_d\left(\frac ab\right)\\ &=\prod_{d\mid n}b^{\varphi(d)}\cdot \prod_{d\mid n}\Phi_d\left(\frac ab\right)\\ &=b^n\left[\left(\frac ab\right)^n-1\right]\\ &=a^n-b^n. \end{aligned}\) Similarly to the previous sections, the following two propositions follow.
Orders and Cyclotomic Polynomials
Let $p\geq3$ be a prime such that $p\nmid a,b$. Let $n\geq1$, and let $k\geq1$ be minimal such that $p\mid a^k-b^k$. Then note that $k$ is order of $a/b$ modulo $p$. Thus, $k\mid p-1$.
Moreover, note that $\Phi_n(a,b)\mid a^n-b^n$.
LTE on Cyclotomic Polynomials
Proof: We begin with cases.
Case 1 : Note that if $k=n$ then $p\nmid a^n-b^n$. Hence \(\begin{aligned} v_p(a^k-b^k)&=v_p(a^n-b^n)=v_p(\Phi_n(a,b))+\sum_{d\mid n,\,d\neq n}v_p(\Phi_d(a,b))\\ &=v_p(\Phi_n(a,b)) \end{aligned}\)
Note that \(\sum_{d\mid n,d\neq n}v_p(\Phi_d(a,b))=0\) because of the minimality of $k$ we assumes. If $v_p(\Phi_d(a,b))>0$ for some $d$, then $p\mid a^d-b^d$. Not possible.
So this proves the first statement.
Case 2: For $n=p^{\beta}k$ then we get
\[\begin{aligned} v_p(a^k-b^k)+\beta&=v_p(a^{p^\beta k}-b^{p^\beta k})\\ &=\sum_{d\mid p^\beta k}v_p(\Phi_d(a,b))\\ &=\sum_{d\mid k}v_p(\Phi_d(a,b))+ v_p(\Phi_{pk}(a,b))+v_p(\Phi_{p^2k}(a,b))+\dots + v_p(\Phi_{p^{\beta}k}(a,b))\\ &=v_p(a^k-b^k)+ v_p(\Phi_{pk}(a,b))+v_p(\Phi_{p^2k}(a,b))+\dots + v_p(\Phi_{p^{\beta}k}(a,b)) \end{aligned}\] \[\implies \beta=v_p(\Phi_{pk}(a,b))+v_p(\Phi_{p^2k}(a,b))+\dots + v_p(\Phi_{p^{\beta}k}(a,b)).\]So, this implies $v_p(\Phi_{p^{j}k}(a,b))=1$.
Case 3.1: If $k\nmid n$, then $ p\nmid a^n-b^n$. So $p\nmid \Phi_n(a,b)\implies v_p(\Phi_n(a,b))=0$.
Case 3.2: If $k\mid n$, then $n=p^\beta mk$ for some $p\nmid m$ (so $\beta=v_p(\frac nk)$). We have dealt with the case $m=1$. If $m>1$ then $\Phi_n(a,b)$ is a factor of \(\frac{\prod_{d\mid n}\Phi_d(a,b)}{\prod_{d\mid p^\beta k}\Phi_d(a,b)}=\frac{a^n-b^n}{a^{p^\beta k}-b^{p^\beta k}}.\)
But note that LTE gives $v_p(a^n-b^n)=v_p(a^{p^\beta k}-b^{p^\beta k})$, so $p$ does not divide $\Phi_n(a,b)$. So done.
Left to the readers!
Final Proof of Zsigmondy’s Theorem
Suppose that $a^n-b^n$ has no primitive prime divisors.
If $\Phi_n(a,b)>1$. Let $p$ be a prime factor of $\Phi_n(a,b)$. Then $p\mid a^n-b^n$, so there exists a minimal $1\leq k< n$ such that $p\mid a^k-b^k$. ( since we assumed that $a^n-b^n$ has no primitive prime divisors).
Case 1: If $p\geq3$, since $k<n$ and $p\mid\Phi_n(a,b)$. We get that $v_p(\Phi_n(a,b))=1$ by the lemma 7.1. So $n$ is of the forms $p^{\beta}k$.We also know that $k\mid n$ and $k\mid p-1\implies k<p$. So note that $p$ is the largest prime factor of $n$. Suppose $q\ne p$ divides $\Phi_n(a,b)$. By similar reasoning, we get that $q$ is the largest prime factor of $n$. This is a contradiction, as we established $p$ as the largest prime factor. Hence $\Phi_n(a,b)$ is $p$.
Case 2: If $p=2$ then $n\geq3$ is a power of $2$, so $4\mid n$ implies ( as $n\ge3$). So \(\Phi_n(a,b)=a^{n/2}+b^{n/2}\equiv2\pmod 4.\)
So $v_p(\Phi_n(a,b))=1$.
So we get \(p\geq\Phi_n(a,b)\geq(a-b)^{\varphi(n)}\geq(a-b)^{p-1}.\)
If $a-b\geq2$, then $p=2$ and $n=2$ as we get $p\ge 2^{p-1}$ which fails for $p>2$.
If $a-b=1$, write $n=p^\beta k$.
Case 1: If $\beta\geq2$ then
\(\begin{aligned} p\geq\Phi_n(a,b)&=\Phi_{pk}(a^{p^{\beta-1}},b^{p^{\beta-1}})\\ &\geq(a^{p^{\beta-1}}-b^{p^{\beta-1}})^{\varphi(pk)}\\ &\geq a^p-b^p=(b+1)^p-b^p\\ &=pb^{p-1}+\cdots+1 \end{aligned}\) Not possible.
Case 2: $\beta=1$, so $n=pk$. Note $p\nmid k$. Infact $k<p$.
\[\begin{aligned} p\geq\Phi_n(a,b)&=\frac{\Phi_k(a^p,b^p)}{\Phi_k(a,b)}\\ &\geq\left(\frac{a^p-b^p}{a+b}\right)^{\varphi(k)}\\ &\geq\frac{(a^p-b^p)^{\varphi(k)}}{a+b}\\ &\geq\frac{2^p-1}3. \end{aligned}\]Here, equality can only hold when $p=3$ and $b=1$ (so $a=2$). Also, since $k< p$, we have $k\in{1,2}$, so $n\in {3,6}$. But $2^3-1^3$ has $7$ as a primitive divisor. Note that $2^6-1^6$ has no primitive divisors. Hence we get the exception case.
This concludes the proof of Zsigmondy’s Theorem.
Sum Version of Zsigmondy’s Theorem
The sum version follows from above
Some Olympiad problems
Walkthrough:
- You would like to use zsigmondy here, but how?
- Take an arbitrary $d\mid p_1p_2\dots p_n$
- Can you now find distinct prime factors of $2^{p_1p_2\cdots p_n}+1$
Walkthrough:
- It’s just Zsigmondy
Walkthrough:
- I will spoil it for you! Answer is yes.
- Start with $9$ and then inductively find the next primes using Zsigmondy’s theorem.
Walkthrough:
- Check the edge cases of Zsigmondy!
One obvious solution is $(a,n)=(1,n)$. Assume $a>1$. We just have to check the exceptions of Zsigmondy which are $(a,n)=(2,6), (2^k-1,2)$.
Case 1: $(2,6)$ does not work by brute force checking
Case 2: If $(a, n)=(2^k-1, 2)$. Then note $(2^k-1)^2-1=(2^k)(2^k-2)=(2^{k+1})(2^{k-1}-1)$. So the primes divide $2^{k-1}-1$ and $2$. So $m=1$ works as $(2^k-1)-1=2^k-2=2(2^{k-1}-1)$.
So this was it! I hope you liked the post :)