Maths WorkshopMaths problems with full solutions
Exercise 2240Number theory › CongruencesOlympiadAdded 5 Nov 2026

Primitive roots exist modulo every prime

#primitive root#order#totient#polynomial roots

Statement

Let pp be a prime. Prove that there exists an integer gg whose multiplicative order modulo pp is p−1p-1 (a primitive root).

Hint

For d∣p−1d\mid p-1 let ψ(d)\psi(d) be the number of residues of order dd. Show ψ(d)≤φ(d)\psi(d)\le\varphi(d) using that a polynomial of degree dd has at most dd roots modulo pp, and compare ∑ψ(d)\sum\psi(d) with ∑φ(d)\sum\varphi(d).

Show solutionHide solution

Solution

Setup. Work in the field Fp\mathbb F_p. Every nonzero residue has an order dividing p−1p-1 (Fermat), so
∑d∣p−1ψ(d)=p−1.\sum_{d\mid p-1}\psi(d)=p-1.

Claim: ψ(d)≤φ(d)\psi(d)\le\varphi(d) for all d∣p−1d\mid p-1. If ψ(d)=0\psi(d)=0 there is nothing to prove. Otherwise let gg have order dd. The dd numbers 1,g,…,gd−11,g,\dots,g^{d-1} are pairwise distinct and all satisfy xd=1x^d=1. A polynomial of degree dd over a field has at most dd roots, so these are *all* the roots of xd−1x^d-1. Any element of order dd is a root of xd−1x^d-1, hence of the form gjg^j with 0≤j<d0\le j<d. The order of gjg^j is dgcd⁡(j,d)\frac d{\gcd(j,d)}, which equals dd iff gcd⁡(j,d)=1\gcd(j,d)=1. So ψ(d)=φ(d)\psi(d)=\varphi(d) in this case.

Comparison. We know ∑d∣p−1φ(d)=p−1\sum_{d\mid p-1}\varphi(d)=p-1 (the sum of φ\varphi over the divisors of p−1p-1). Combined with ψ(d)≤φ(d)\psi(d)\le\varphi(d) and ∑ψ(d)=p−1\sum\psi(d)=p-1, equality must hold for every dd:
ψ(d)=φ(d)for all d∣p−1.\psi(d)=\varphi(d)\quad\text{for all }d\mid p-1.
In particular ψ(p−1)=φ(p−1)≥1\psi(p-1)=\varphi(p-1)\ge1: a primitive root exists.

Example. p=7p=7: 33 is a primitive root (3,2,6,4,5,13,2,6,4,5,1), and there are φ(6)=2\varphi(6)=2 of them (33 and 55).

Lesson. Count elements of each order, bound each count by a polynomial-root argument, and use ∑d∣mφ(d)=m\sum_{d\mid m}\varphi(d)=m to force equality.