Primitive Roots
Let be a positive integer. A primitive root mod is an integer such that every integer relatively prime to is congruent to a power of mod . That is, the integer is a primitive root (mod ) if for every number relatively prime to there is an integer such that
is a primitive root mod , because for every number relatively prime to 5, there is an integer such that .
All the numbers relatively prime to 5 are 1, 2, 3, 4, and each of these (mod 5) is itself for instance 2 (mod 5) = 2
- , so
- , so
- , so
- , so
For every integer relatively prime to there is a power of that is congruent.
is not a primitive root mod , because for every number relatively prime to 5 (again, 1, 2, 3, 4) there is not a power of that is congruent. Powers of 4 (mod 5) are only congruent to 1 or 4. There is no power of 4 that is congruent to 2 or 3:
and the pattern continues...
When primitive roots exist, it is often very convenient to use them in proofs and explicit constructions; for instance, if is an odd prime and is a primitive root mod , the quadratic residues mod are precisely the even powers of the primitive root. Primitive roots are also important in cryptological applications involving the discrete log problem, most notably the Diffie-Hellman key exchange protocol.
Contents
Terminology and a Formal Definition
Define
So has elements, where is Euler's totient function.
A primitive root mod is an element whose powers generate all of . That is, every element can be written as mod , for some integer .
Background and Motivation
The set has an important property: it is closed under multiplication mod . That is, if , and is the positive integer less than which is congruent to mod , then as well. This is because and have no common factor (by unique factorization), so and have no common factor either because if and , then as well, because for some integer
This property, together with other basic properties of multiplication mod , implies that is a group under multiplication.
For any element , consider the sequence of its powers mod . All of the powers of are in the finite set , so the sequence of powers of repeats eventually. In fact, Euler's theorem implies that it repeats with period
So another characterization of primitive roots in terms of this sequence is this: Primitive roots are the elements for which the sequence of powers of has minimum period .
The minimum period of the sequence of powers of is called the order of . So is a primitive root mod if and only if the order of is .
- The powers of are . The order of is .
- The powers of are . The order of is .
- The powers of are . The order of is .
- The powers of are . The order of is .
- The powers of are . The order of is .
- The powers of are . The order of is .
So the primitive roots mod are and .
Existence of Primitive Roots
Primitive roots do not necessarily exist mod for any . Here is a complete classification:
There are primitive roots mod if and only if or where is an odd prime.
Finding Primitive Roots
The proof of the theorem (part of which is presented below) is essentially non-constructive: that is, it does not give an effective way to find a primitive root when it exists. Once one primitive root has been found, the others are easy to construct: simply take the powers where is relatively prime to . But finding a primitive root efficiently is a difficult computational problem in general.
There are some special cases when it is easier to find them. Here is an example:
Suppose is a prime such that is also prime. (Such are called Sophie Germain primes.) Show that if mod , then is a primitive root mod .
The point is that the list of possible orders of elements of is very short: the order of divides , so it is either or . It can't be or , so we only need to rule out . But mod , where is the Legendre symbol; this is by Euler's criterion. But by the second supplement to quadratic reciprocity, because mod .
So the only remaining possibility is that the order of mod is .
For instance, this shows that is a primitive root mod .
Applications
When there is a primitive root mod , the elements of can be written as . Multiplying two elements corresponds to adding their exponents mod That is, the multiplicative arithmetic in reduces to additive arithmetic in .
Let be an integer and an odd prime number. How many nonzero powers are there mod
The question certainly depends on the relationship between and . When the answer is (see quadratic residues), but when the answer is (by Fermat's little theorem).
As an illustration, take . Then it's easy to check that is a primitive root mod . The ninth powers mod are , but we can consider the exponents mod because . So we get
so there are four powers mod . The exponents are multiples of , which is gcd. There are of these.
In general, since every nonzero element of can be written as mod for some integer , the equation mod can be rewritten or mod . Because is a primitive root, this happens if and only if , so mod .
So the question becomes, "As ranges over , how many values can mod take on?" In fact, the extended Euclidean algorithm implies that is the set of multiples of gcd. There are exactly
such values, so this is the answer.
Here is another problem where it can help to write the elements of as powers of a primitive root.
Find the smallest positive prime divisor of
Partial Proof of the Theorem
One half of this theorem is not hard to prove: Suppose where and are relatively prime and . Suppose is relatively prime to . Then since mod and mod , it follows that mod .
But and are both even, so their LCM is strictly less than their product. So the order of is strictly less than . So there is no primitive root mod .
The only that cannot be written in this way are and higher powers of . But for any odd ,
which can be proved by the LTE lemma (or by induction). Since , there is no primitive root mod for .
Some of the proof of the other direction can be found in the wiki on orders.