Home › Number Theory › Lesson 6

Primitive Roots and the Structure of (ℤ/nℤ)×

Lesson 6 of 13

Key idea of this section

(ℤ/nℤ)× is cyclic  ⟺  n = 1, 2, 4, pᵏ or 2pᵏ (p an odd prime, k ≥ 1).

Orders

For gcd(a, n) = 1, the order ordₙ(a) is the least k ≥ 1 with aᵏ ≡ 1 (mod n). Elementary group theory gives: aᵐ ≡ 1 iff ordₙ(a) | m; ordₙ(a) divides φ(n); and ordₙ(aʲ) = ordₙ(a)/gcd(j, ordₙ(a)). A primitive root modulo n is an a with ordₙ(a) = φ(n), that is, a generator of (ℤ/nℤ)×.

For example 3 is a primitive root modulo 7, since its powers 3, 2, 6, 4, 5, 1 run through all units, whereas 2 is not: 2³ = 8 ≡ 1, so ord₇(2) = 3.

Primes

Lemma 6.1 (Gauss). For every n ≥ 1, ∑d|n φ(d) = n.

Proof. Partition {1, …, n} according to the value of gcd(k, n) = n/d. The k with gcd(k, n) = n/d are k = (n/d)j with 1 ≤ j ≤ d and gcd(j, d) = 1, and there are φ(d) of them. ∎

Theorem 6.2 (Gauss). For every prime p, the group 𝔽ₚ× is cyclic; it has exactly φ(p − 1) generators. More generally, every finite subgroup of the multiplicative group of a field is cyclic.

Proof. Let G be a finite subgroup of K× of order m, and for d | m let ψ(d) be the number of elements of G of order d. If ψ(d) > 0, pick a of order d. Then 1, a, …, ad−1 are d distinct roots of xd − 1, which has at most d roots in the field K, so every element of order d is a power aʲ, and aʲ has order d iff gcd(j, d) = 1. Hence ψ(d) is 0 or φ(d). Now

m = ∑d|m ψ(d) ≤ ∑d|m φ(d) = m,

so ψ(d) = φ(d) for every d | m, and in particular ψ(m) = φ(m) ≥ 1. ∎

A practical test follows from Lagrange's theorem: g is a primitive root modulo p if and only if g(p−1)/q ≢ 1 (mod p) for every prime q dividing p − 1. Worked example: the smallest primitive root modulo 23. Here 22 = 2 · 11. For g = 2: 2¹¹ = 2048 = 89 · 23 + 1, so 2 fails; 3 and 4 fail too (3¹¹ ≡ 4¹¹ ≡ 1). For g = 5: 5² = 25 ≡ 2 ≢ 1 and 5¹¹ ≡ −1 ≢ 1, so 5 is the smallest primitive root modulo 23. The primitive roots modulo 13 are 2, 6, 7, 11, exactly φ(12) = 4 of them.

Odd prime powers

Theorem 6.3. Let p be an odd prime and g a primitive root modulo p. Then g or g + p is a primitive root modulo p², and any primitive root modulo p² is a primitive root modulo pᵏ for all k ≥ 2.

Proof sketch. Since (g + p)p−1 ≡ gp−1 + (p − 1)gp−2p (mod p²) and p ∤ (p − 1)gp−2, at most one of g, g + p satisfies xp−1 ≡ 1 (mod p²); choose one, h, that does not. The order of h modulo p² is a multiple of p − 1 (h is a primitive root mod p) and divides p(p − 1), and it is not p − 1, so it is p(p − 1) = φ(p²). For the second statement one shows by induction, using the binomial theorem, that if hp−1 = 1 + pu with p ∤ u then hpᵏ⁻²(p−1) = 1 + pᵏ⁻¹uₖ with p ∤ uₖ; this forces ordpᵏ(h) = pᵏ⁻¹(p − 1). ∎

For example 10 ≡ 3 (mod 7) is a primitive root modulo 7, and 10⁶ ≡ 8 (mod 49), not 1, so 10 is a primitive root modulo 49 and modulo every power of 7. Since ℤ/2pᵏℤ ≅ ℤ/2ℤ × ℤ/pᵏℤ with (ℤ/2ℤ)× trivial, an odd primitive root modulo pᵏ is also one modulo 2pᵏ.

Powers of 2

Theorem 6.4. For k ≥ 3, (ℤ/2ᵏℤ)× = {±5ʲ : 0 ≤ j < 2ᵏ⁻²} ≅ C₂ × C2ᵏ⁻². In particular it is not cyclic, and λ(2ᵏ) = 2ᵏ⁻².

Proof. By induction, 52ᵏ⁻³ ≡ 1 + 2ᵏ⁻¹ (mod 2ᵏ) for k ≥ 3: for k = 3 it reads 5 ≡ 5, and squaring 52ᵏ⁻³ = 1 + 2ᵏ⁻¹ + 2ᵏm gives 1 + 2ᵏ + 2ᵏ⁺¹(⋯) ≡ 1 + 2ᵏ (mod 2ᵏ⁺¹). Hence 5 has order exactly 2ᵏ⁻² modulo 2ᵏ. All powers of 5 are ≡ 1 (mod 4), so −1 is not among them, and the 2ᵏ⁻¹ elements ±5ʲ are distinct; this is all of (ℤ/2ᵏℤ)×. Every element has order dividing 2ᵏ⁻², which is less than φ(2ᵏ) = 2ᵏ⁻¹. ∎

The general structure theorem

Theorem 6.5. If n = 2ᵉ p₁e₁ ⋯ pᵣeᵣ with odd primes pᵢ, then

(ℤ/nℤ)× ≅ (ℤ/2ᵉℤ)× × Cφ(p₁e₁) × ⋯ × Cφ(pᵣeᵣ),

with (ℤ/2ᵉℤ)× trivial for e ≤ 1, C₂ for e = 2 and C₂ × C2ᵉ⁻² for e ≥ 3. The Carmichael function λ(n) is the lcm of the exponents of the factors, and (ℤ/nℤ)× is cyclic exactly for n = 1, 2, 4, pᵏ, 2pᵏ.

Proof. The decomposition is the CRT plus Theorems 6.2–6.4. For the cyclicity criterion: if n is not of the listed forms, then either 8 | n (and the 2-part is not cyclic), or n = ab with gcd(a, b) = 1 and a, b ≥ 3. In the latter case φ(a) and φ(b) are both even, so every element has order dividing lcm(φ(a), φ(b)) ≤ φ(a)φ(b)/2 < φ(n). ∎

For example (ℤ/15ℤ)× ≅ C₂ × C₄: the orders of 1, 2, 4, 7, 8, 11, 13, 14 are 1, 4, 2, 4, 4, 2, 4, 2, so λ(15) = 4 and no element has order 8.

Discrete logarithms and an open problem

If g is a primitive root mod p, every unit a is gᵏ for a unique k mod p − 1, the index or discrete logarithm of a. Indices convert multiplicative congruences into linear ones modulo p − 1, exactly as logarithms convert products into sums; Gauss and Jacobi published tables of them. No efficient classical algorithm for discrete logarithms in 𝔽ₚ× is known, and the Diffie–Hellman key exchange (1976) relies on this. Shor's algorithm (1994) would solve both discrete logarithms and factoring on a large quantum computer.

Artin's conjecture (1927) asserts that every integer a that is neither −1 nor a perfect square is a primitive root modulo infinitely many primes. Hooley proved it in 1967 assuming the generalised Riemann hypothesis; unconditionally, Heath-Brown showed (1986) that at most two primes are exceptions, but no specific a, not even a = 2, is known to satisfy it.

Exercise

  • (a)
    Find all primitive roots modulo 11.
  • (b)
    Show that 2 is a primitive root modulo 101.
  • (c)
    Compute λ(720) and the number of elements x of (ℤ/720ℤ)× with x⁴ = 1, given 720 = 2⁴ · 3² · 5.
Show solution

Answers: (a) 10 = 2 · 5, so g is a primitive root iff g² ≢ 1 and g⁵ ≢ 1. 2 works (2² = 4, 2⁵ = 32 ≡ −1), and the primitive roots are 2ʲ with gcd(j, 10) = 1: 2¹ = 2, 2³ = 8, 2⁷ ≡ 7, 2⁹ ≡ 6. So they are 2, 6, 7, 8, and there are φ(10) = 4 of them. (b) 100 = 2² · 5², so we need 2⁵⁰ ≢ 1 and 2²⁰ ≢ 1 (mod 101). 2¹⁰ = 1024 ≡ 14, so 2²⁰ ≡ 196 ≡ 95; and 2⁵⁰ = (2¹⁰)⁵ ≡ 14⁵ ≡ −1 (one can also see this from Lesson 7, since 101 ≡ 5 (mod 8) makes 2 a non-residue). (c) (ℤ/720ℤ)× ≅ (C₂ × C₄) × C₆ × C₄, so λ(720) = lcm(4, 6, 4) = 12. The number of x with x⁴ = 1 in a cyclic group of order m is gcd(4, m), so the count is (2 · 4) · 2 · 4 = 64.

V.3.1