Primitive roots and cyclic unit groups
Recognize when one residue generates every unit and certify a primitive root by testing prime divisors of the group size.
On this page
The question for today
What you’ll understand
- Define a primitive root through maximal multiplicative order.
- Certify a generator using prime-factor exponent tests.
- State the precise classification of moduli with cyclic unit groups.
A unit can return to one without visiting every other unit along the way. A primitive root is a residue whose powers do visit them all, making multiplicative arithmetic describable by a single cyclic coordinate. This changes multiplication into addition of exponents, although finding the exponent of a given residue may still be difficult. Not every modulus permits such a description. We will learn how to certify a generator, why prime moduli do permit one, and where the pattern fails.
One generator enumerates the units
For modulus m at least two, a primitive root g is a unit of order φ(m). Its first φ(m) powers are all distinct: equality between two earlier powers would give a smaller return to one. Since there are exactly φ(m) units, those powers enumerate every unit. Conversely, a unit whose powers enumerate all units must have that order. This is the meaning of saying the unit group is cyclic.
If g is a primitive root, the order of g to the power k is φ(m) divided by gcd(k, φ(m)). Indeed, its t-th power returns when φ(m) divides kt, and reducing by the gcd gives the smallest possible positive t. Thus the powers that remain generators are exactly the exponents coprime to φ(m), giving φ(φ(m)) primitive roots whenever the group is cyclic.
A short certificate replaces a complete power table
Let N = φ(m) and assume a candidate g is a unit. Its order divides N. To prove the order equals N, it is enough to test that g to the power N/q is not one for every distinct prime q dividing N. If the order d were a proper divisor, N/d would contain a prime q, and d would divide N/q, contradicting that test. Testing all integers below N is unnecessary.
For prime modulus p, the nonzero residues do have a primitive root. One proof uses the fact that a nonzero polynomial of degree d over a field has at most d roots, together with the possible element orders. The field assumption matters: the same root bound need not hold over a composite modulus. We use the existence theorem here while checking concrete candidates directly, so the certificate for a particular generator remains fully inspectable.
Know where the cyclic description stops
For m at least two, primitive roots exist exactly for m = 2, m = 4, odd prime powers p to the power k, and twice those odd prime powers, with k positive. The modulus one is outside our convention; if one includes its trivial unit group, cyclicity can be treated separately. In particular, the unit group modulo eight is not cyclic, even though its four elements form a perfectly valid group.
The obstruction is visible in a tiny table: each unit modulo eight squares to one, so no unit has order four. More generally CRT decomposes unit information over coprime factors, and the combined orders are least common multiples rather than automatically products. A primitive root also gives discrete logarithms as coordinates, but existence of those coordinates is not an efficient algorithm for finding them. Separate a structural theorem from a computational procedure and from an application’s security assumptions.
Work it through
Certify a generator modulo seventeen
Show that 3 is a primitive root modulo 17 without listing all sixteen nonzero powers.
The modulus 17 is prime, so the unit group has size 16. The only distinct prime dividing 16 is 2, so the primitive-root certificate requires testing 3⁸, in addition to knowing 3 is nonzero modulo 17.
Square successively: 3² ≡ 9, 3⁴ ≡ 81 ≡ 13, and 3⁸ ≡ 13² ≡ 169 ≡ 16 ≡ −1 modulo 17.
Because 3⁸ is not one, the order cannot divide 8. Every proper divisor of 16 divides 8, while Fermat guarantees the order divides 16. Therefore the order is exactly 16.
The residue 3 generates all sixteen nonzero residues modulo 17 and is a primitive root.
The living notebook
Explore the model
Interactive lab · waves
Cyclic coordinates and their limitations
Hold amplitude ratio at one and sweep the phase between −180° and 180°. Predict which endpoints represent the same phase and which middle setting reinforces the two waves. This continuous cyclic coordinate is an analogy for powers of a finite generator. The lab cannot choose a modulus, enumerate units, or establish that a unit group is cyclic.
- Sum at x = 0
- 0.866
- Resultant amplitude
- 1.732
- Phase difference
- 60°
Two waves share the same frequency and wave number. Playback advances t in sin(2x − t) + a sin(2x − t + phase). Parameter changes pause playback and recompute the model at the current elapsed time. Reset restores both parameters and returns time to zero. Playback starts paused. Adjust either parameter, then choose Play or Step.
Look forCyclic coordinates simplify a structure only after one proves that the chosen generator reaches every allowed state.
Pause & reason
Check your understanding
Your turn
Try it yourself
Show that 2 is a primitive root modulo 11, then find the order of 2⁴ modulo 11.
Take a moment to make a prediction or work it out on paper. Open a hint when you need one.
Give me a hint
The unit group has size ten. Test the exponents ten divided by its distinct prime divisors.
Compare with the solution
The prime divisors of ten are two and five. Compute 2⁵ = 32 ≡ −1 modulo 11 and 2² = 4, so neither required test equals one. Therefore 2 has order ten and is a primitive root. The order of 2⁴ is 10/gcd(4, 10) = 5. Thus a power of a generator need not itself generate the whole group; its exponent must be coprime to the original order to do so.
Keep the idea
Take it with you
- A primitive root has order equal to the number of units.
- Prime-divisor exponent tests certify maximal order efficiently once φ(m) is known.
- Only 2, 4, odd prime powers, and twice odd prime powers admit primitive roots for moduli at least two.
Read further
Original sources and deeper explanations to follow at your own pace.
Optional progress, saved in this browser when available. Revisit any lesson at any time.
Lesson not marked complete.