Primitive Root — Definition, Formula & Examples
A primitive root modulo is an integer whose successive powers produce every integer that is coprime to , before the pattern repeats. In other words, is a generator of the multiplicative group of integers modulo .
An integer is a primitive root modulo if has multiplicative order modulo , meaning is the smallest positive integer such that , where denotes Euler's totient function.
Key Formula
Where:
- = A candidate primitive root
- = The modulus
- = The multiplicative order of g modulo n (smallest positive k with g^k ≡ 1 mod n)
- = Euler's totient function, the count of integers from 1 to n that are coprime to n
How It Works
To check whether is a primitive root modulo , compute modulo and verify that for any . A shortcut: you only need to check that for each prime factor of . Primitive roots exist modulo only when is , or for an odd prime and . Not every modulus has a primitive root — for instance, there is none modulo 8 or 12.
Worked Example
Problem: Show that 3 is a primitive root modulo 7.
Step 1: Compute Euler's totient: since 7 is prime, φ(7) = 6. A primitive root must have order 6.
Step 2: The prime factors of 6 are 2 and 3. Check that 3 raised to 6/2 and 6/3 is not congruent to 1 mod 7.
Step 3: Neither result is 1, so no smaller exponent gives 1. The order of 3 is 6, which equals φ(7).
Answer: 3 is a primitive root modulo 7. Its powers mod 7 cycle through all nonzero residues: 3, 2, 6, 4, 5, 1.
Why It Matters
Primitive roots underpin the Diffie-Hellman key exchange and other cryptographic protocols, where security relies on the difficulty of the discrete logarithm problem in cyclic groups. They also appear throughout number theory proofs, including the structure theorem for the multiplicative group modulo .
Common Mistakes
Mistake: Assuming every modulus has a primitive root.
Correction: Primitive roots exist only modulo 1, 2, 4, p^k, or 2p^k (odd prime p). For example, there is no primitive root modulo 8 because every odd number squared is ≡ 1 mod 8.
