We are going to work module \(m\) where \(m\) is an integer. Now, recall that the order of \(a \pmod{m}\) is the smallest positive integer \(n\) such that
Also recall Euler’s theorem which says that if \((a,m) = 1\), then
where \(\varphi(m)\) is Euler’s Totient function. From this we learned that the order of \(a\) must divide \(\varphi(m)\).
So the maximum possible order of \(a\) is \(\varphi(m)\) (why? because the group of units modulo \(m\) has size \(\phi(m)\)). Based on this, we have the following definition
This condition is equivalent to the following statement
This happens because \(\varphi(m)\) itself is the number of integers less than \(m\) that are coprime to \(m\). So if \(a\)’s order is exactly \(\varphi(m)\), then all the powers of \(a\) will be residue classes coprime to \(m\).
Today’s lecture will be about which numbers have primitive roots? how many primitive roots do they have if any? and how do we find them? Instead of starting with theorems, we will do this through computing the primitive roots for many integers
Primitive Roots of \(1\) to \(8\)
We’ll start by computing the primitive roots for the integers (1) through (8) by hand as follows
\(m\) | coprime to \(m\) | \(\varphi(m)\) | Primitive Roots |
\(1\) | \(0\) | \(1\) | \(0\) |
\(2\) | \(1\) | \(1\) | \(1\) |
\(3\) | \((o(1)=1),(o(2)=2)\) | \(2\) | \(2\) |
\(4\) | \((o(1)=1), (o(3)=2)\) | \(2\) | \(3\) |
\(5\) | \((o(1)=1), (o(2)=4), (o(3)=4), (o(4)=2))\) | \(4\) | \(2,3\) |
\(6\) | \((o(1)=1), (o(5)=2)\) | \(2\) | \(5\) |
\(7\) | \((o(1)=1), (o(2)=3), (o(3)=6)\),\((o(4)=3), (o(5)=6), (o(6)=2)\) | \(6\) | \(3,5\) |
\(8\) | \((o(1)=1), (o(3)=2)\),\((o(5)=2), (o(7)=2)\) | \(4\) | \(-\) |
We notice that \(8\) is the first number with no primitive roots and we notice that one of the obstructions to \(8\) not having primitive roots is that \(8\) has \(4\) solutions to
Why is this an issue here? Observe that if \(g\) was a primitive root, then it generates the group of units modulo \(m\) root. Then, if we want to find the solutions to \(x^2 \equiv 1 \pmod{m}\), then any solution can be written as some power of \(g\). So write \(x\) as \(g^k\) for some integer \(k\). Then
But \(g\) has order \(\varphi(m)\) so we must have that \(\varphi(m) \mid 2k\). But since \(0 \leq k \leq \varphi(m)\) (why? because we have \(\phi(m)\) elements in the group), then \(k\) must either be \(0\) or \(\varphi(m)/2\). So the solutions are
Therefore, when \(g\) is a primitive root modulo \(m\), then there are only two solutions to \(x^2 \equiv 1 \pmod{m}\). In fact, this turns out to be a necessary condition for knowing whether an element has primitive roots or not. Since \(8\) here has \(4\) elements of order \(2\), then we know it can’t have a primitive root.
Primitive Roots of \(9\) to \(13\)
Let’s now look at more integers and their primitive roots
\(m\) | coprime to \(m\) | \(\varphi(m)\) | Primitive Roots |
\(9\) | \((o(1)=1), (o(2)=6)\),\((o(4)=3), (o(5)=6), (o(7)=3), (o(8)=2)\) | \(6\) | \(2,5\) |
\(10\) | \((o(1)=1), (o(3)=4)\),\((o(7)=4), (o(9)=2)\) | \(4\) | \(3,7\) |
\(11\) | \(\) | \(10\) | \(\geq 2\) |
\(12\) | \(o(1)=5, o(5)=2, o(7)=2, o(11)=2\) | \(4\) | \(-\) |
\(13\) | \(\) | \(12\) | \(\) |
For \(9\), well \(9\) is \(3^2\). We know \(3\) has one primitive root which is \(2\) so we should only look at \(2, 5\) and \(8\). From this list, we can find out that only \(2\) and \(5\) have order \(6\). Therefore, \(9\) has those two primitive roots only.
For \(10\), we know there are \(4\) candidates: \(1, 3, 7, 9\). We could compute their orders manually but we could also observe that \(10 = 5 \cdot 2\). By CRT, the numbers modulo \(10\) can be identified with numbers modulo \(5\) and numbers modulo \(2\). We know that the primitive roots of \(5\) are \(2\) and \(3\). So we can check these. Also, if \(g\) is a primitive root modulo \(n\), then either \(g\) or \(g+n\) (whichever is odd) is a primitive root modulo \(2n\).
For \(11\), first notice that the order of \(a\) must divide \(\varphi(11) = 10\). So the order of \(a\) must be in \(\{1,2,5,10\}\). But \(11\) is prime so the number solutions to
is at most \(d\) (We showed this last lecture). Therefore, we can workout the number of elements of each order. For example, there are at most \(1\) element of order \(1\) since \(g^1 \equiv 1 \pmod{11}\) can have at most \(1\) solution. Similarly, \(g^2 \equiv 1 \pmod{11}\) can have at most \(2\) solutions and \(g^5 \equiv 1 \pmod{11}\) can have at most \(5\) solutions. Therefore, we have at most \(1+2+5 = 8\) elements of order \(1\), \(2\) or \(5\). This implies that we must at least have \(2\) elements of order \(10\). Thus, there are at least \(2\) primitive roots modulo \(11\). So by carefully counting, we can sometimes figure out if an integer has primitive roots without calculating the order of each element.
For \(12\), we have \(4\) numbers that are coprime to \(12\) and we notice that all of them have order \(2\) except for \(1\) so there are no primitive roots. Why were there no primitive roots? Notice that \(12 = 4 \cdot 3\). So now we can count the number of solutions to
When \(m = 4\), there are exactly \(2\) solutions and when \(m = 3\), there are at least 2 solutions. So there are at least \(4\) solutions. So this leads us to having no solutions. In fact, if \(m = 4 \cdot \text{ odd number}\), then we don’t get any primitive roots.
Primitive Roots of \(13\)
What about \(13\)? \(13\) is prime. \(\varphi(13) = 12\). Then, the order of any element \(g\) must divide \(12\) and so it must be in \(\{1,2,3,4,6,12\}\). The number of elements of each order is at most
\(d\) | \(1\) | \(2\) | \(3\) | \(4\) | \(6\) |
elements of this order (at most) | \(1\) | \(2\) | \(3\) | \(4\) | \(6\) |
Therefore, there are at most \(1 + 2 + 3 + 4 + 6 = 16 > 12\) elements. But this doesn’t give us information to conclude whether we have elements of order \(12\) or not so this method fails for us. However, we can count more accurately. How? Let’s look at the elements of order \(6\). Suppose we have an element \(g\) of order \(6\). Then are the elements
are all roots of \(x^6 \equiv 1 \pmod{13}\) (we proved this last lecture and also if you take any of these elements, then \((g^k)^n \equiv 1 \pmod{13}\). Now, out of these \(6\) roots, only two of them have order \(6\). This is because the order of \(g^k\) is
So we can only have at most two elements of order \(6\). In fact, the limit on the number of roots is not just \(d\), it is in fact \(\varphi(d)\). So if we go back
\(d\) | \(1\) | \(2\) | \(3\) | \(4\) | \(6\) |
elements of this order (at most) | \(\varphi(1)=1\) | \(\varphi(2)=1\) | \(\varphi(3)=2\) | \(\varphi(4)=2\) | \(\varphi(6)=2\) |
Therefore, we have at most \(1+1+2+2+2=8\) elements of order less than \(12\). Thus, we have at least \(4\) elements of order \(12\).
Primitive Roots when \(p\) is Prime
The previous argument works for all primes. Based on this, we can then prove the following theorem.
But first a side note:
Proving this theorem depends on two facts:
- \(x^d \equiv 1 \pmod{p}\) has at most \(d\) roots when \(p\) is prime.
- For any \(n\), \(\sum_{d \mid n} \varphi(d) = n \)
Proof
Since \(p\) is prime, then \(\varphi(p) = p-1\). We want to show that there exists an element \(g\) such that the order of \(g\) is exactly \(p-1\).
Let \(n = p-1\). We know that the order of any element modulo \(p\) must divide \(n\). Define \(N_d\) to be the number of elements of order exactly \(d\). Since we exactly have \(p-1=n\) elements less than \(p\), then
Now, using fact (1), we know that for any order \(d\), the number of the elements of that order \(N_d\) must be at most \(\varphi(d)\). That is
If we sum over all divisors \(d\), then
But using fact \(2\), we know that the right hand side is exactly \(n\)
Using the first equation we know that the left hand side is also \(n\). Therefore, all inequalities are equalities. so
In particular, if we take \(d = p-1\) combined with the fact that \(\phi(n) \geq 1\) for any \(n\), then
Therefore, we must have a primitive root when \(p\) is prime. \(\blacksquare\)
We still need to prove fact \(2\)
Proof
Let \(S = \{1,2,\cdots,n\}\). Partition \(S\) by \(d = gcd(k,n)\). For each divisor of \(d \mid n\)
TODO ….
Primitive Roots of \(14\) to \(15\)
When \(n = 14\), then \(14 = 7 \cdot 2\). \(7\) is an odd prime so it has a primitive root. Therefore, \(14\) has a primitive root.
When \(n = 15\), we have no primitive roots. One way to see this is to notice that \(15 = 3 \cdot 5\). Let’s count the solutions to
There are two solutions modulo \(3\) and two solutions modulo \(5\) so there are \(2 \cdot 2 = 4\) solutions modulo \(15\). So there are no primitive roots modulo \(15\). In general, if
Then we don’t have primitive roots.
For \(n = 16\). We know \(16 = 8 \cdot 2\). Recall that if \(ab\) has a primitive root, then so does \(a\). Then because \(8\) has no primitive roots, then \(16\) can’t have primitive roots.
How to Find Primitive Roots?
So to summarize again, we saw that \(m\) doesn’t have primitive roots when (m) is divisible by \(8\), \(4p\), \(pq\) where \(p\) and \(q\) are odd primes and \(p \neq q\). So what numbers are left?
We showed above that \(1, 2\) and \(4\) have primitive roots. We also showed that \(p\) when \(p\) is prime has primitive roots. \(p^n\) also has a primitive root (why? next lecture covers this). \(2p^n\) also has a primitive root. This is because if \(p\) has a primitive root and \(p\) is odd, then \(2p\) has a primitive root (Proof?)