We have shown in previous sections that the order of each element must divide \(\phi(n)\). Elements that achieve this largest possible value are special:
Let \(p\) be prime and \(\bar a \in\mathbb{Z}_p\). We say that \(\bar a\) is a primitive root in \(\mathbb{Z}_p\), or a primitive root modulo \(p\), if \(ord(\bar a) = p - 1\).
If \(\bar a\) is a primitive root, then \(1,\bar a, \bar a^2,\ldots, \bar a^{p-2}\) are all distict elements, all reduced residues, and since there are \(\phi(p) = p - 1\) of them they must be all the reduced residues. We say that the primitive root generates all reduced residues.
The main result of this section will be that there is always a primitive root, a very nontrivial result.
Find primitive roots modulo 17 and modulo 19.
The Primitive Root Theorem is fairly straightforward:
Let \(p\) be a prime. Then there exists a primitive root modulo \(p\).
Its proof will take many steps. The two main steps are as follows:
Suppose \(p\) is prime and \(q^s|p-1\). Then there is an element of order \(q^s\) in \(\mathbb{Z}_p\).
Let us proceed with the proof:
Let us do a demonstration of this:
Consider \(p = 37\). Then \(p-1 = 36 = 2^2 3^2\). This lemma tells us that there must be elements of each of the order \(1\), \(2\), \(2^2=4\), \(3\), \(3^2=9\).
We focus on orders \(2\) and \(2^2\) for now. \(36 = -1\) is of course of order \(2\). Note that \(6^2 = 36\), so \(6\) has order \(4\). The four solutions to the equation \(x^4=1\) would therefore be \(1, 36=-1,6,-6=31\).
Now we want to look for elements of orders \(3\) and \(3^2\). A simple way to do so is to take any element and raise it to the \(4\)-th power. Since \(a^{36} = 1\), then for each element we have \((a^4)^9=1\). So if \(a^4\neq 1\) this is a good place to start.
To do this, we start with \(2\), then \(2^4=16\). We know for sure that \(16^9=1\), so we check \(16^3 = 4096 = 26\). This is not 1. Therefore we found an element \(16\) of order \(9\). We also found an element, \(26\), of order \(3\).
So in total we have:
a | ord |
1 | 1 |
36 | 2 |
6 | 4 |
16 | 9 |
26 | 3 |
Now we proceed to the second claim.
Let \(\bar a, \bar b\in\mathbb{Z}_n\) be reduced residues whose orders \(ord(\bar a)\) and \(ord(\bar b)\) are relatively prime. Then the order of \(\bar a \bar b\) is equal to \(ord(\bar a)\cdot ord(\bar b)\) i.e.:
\[ord(\bar a \bar b) = ord(\bar a)\cdot ord(\bar b)\]
Let us proceed with the proof:
Let us continue our illustration from before. We have that \(6\) has order \(4\) and \(16\) has order \(9\), therefore \(6\cdot 16 = 22\) must have order \(6\cdot 9 = 36\). And we just found our primitive root! To confirm that, you will need to verify that \(ord(22) = 36\) by excluding all other possibilities.
It should be noted that this is not the only primitive root, in fact there are exactly \(\phi(36) = 12\) primitive roots. But that's a topic for later.
We now bring it all together.
Now that we know primitive roots exist, we can determine exactly how many there are. From previous sections, we have:
Let \(p\) be prime and \(\bar a\) be a primitive root modulo \(p\). Then:
- For any \(j\) we have \(\bar a^j = \frac{p-1}{\gcd(j, p-1)}\).
- \(\bar a^j\) is a primitive root if and only if \(j\) is relatively prime to \(p-1\).
- There are exactly \(\phi(p-1)\) primitive roots.
Let us demonstrate this in our example with \(p=37\). We already found one primitive root, \(22\). We now find all primitive roots. They would be all the elements of the form \(22^j\) where \(\gcd(j,36)=1\). Let us find some of these elements:
j | x |
1 | 22 |
5 | 13 |
7 | 2 |
11 | 18 |
There is a total of \(\phi(36) = \phi(2^2)\phi(3^2) = 12\) such elements.