Fact10.3.1
There is no primitive root for \(n=12\).
Recall your experimentation in Subsection 10.1.3. You should have discovered that there is not always a primitive root.
There is no primitive root for \(n=12\).
This is also the case for \(n=8\) (Exercise 10.6.3).So, when do we have primitive roots?
We'll start this investigation by proving that most powers of 2 do not have primitive roots. The following should give you an error.
For \(k> 2\), there are no elements of \(U_{2^k}\) that have order \(\phi(2^k)=2^{k-1}\), because the highest order they can have \(2^{k-2}\).
It turns out that \(\pm 5\) have order \(2^{k-2}\) in \(U_{2^k}\).
There follow two important lemmas 1 for working with primitive roots, whose proofs are valuable exercises.
Suppose \(p\) is prime and the order of \(a\) modulo \(p\) is \(d\). If \(b\) and \(d\) are coprime, then \(a^b\) also has order \(d\) modulo \(p\).
Suppose \(p\) is prime and \(d\) divides \(p-1\) (and hence is a possible order of an element of \(U_p\)). There are at most \(\phi(d)\) incongruent integers modulo \(p\) which have order \(d\) modulo \(p\).
Before using them a lot, we should unpack these results a little bit. Here is a first taste.
If there is one primitive root of \(n\), then there are actually \(\phi(\phi(n))\) of them.
It works; let's check this out.
To continue, let's pick a non-prime number we know something about to see how many numbers we have with a given order.
We saw in Proposition 10.3.2 that powers of 2 don't have cyclic groups of units, but they do have lots of elements with the next smallest possible order. So, for example, for \(n=32\) we can look at whether powers \(b\) coprime to that order of such an element are in fact also elements with the same order.
The interact confirms that it works; indeed, Lemma 10.3.4 should be true whether \(p\) is prime or not, though I won't ask you to prove it.
Lemma 10.3.5 also seems to be working; there are exactly \(\phi(8)=4\) powers here, which have order eight.
The problem in deciding if there are primitive roots, though, is that there might be some element of the same order as the ones above which is not actually one of them! This code finds them.
In some sense there are ‘extra’ elements with order \(8\) when \(n=32\). If you have eight elements of order eight, and obviously at least one element of order 1, in \(U_{32}\), then it is impossible to have the required eight elements of order sixteen one would need for there to be a primitive root modulo \(32\). (Why? Because \(8+1+8>16=|U_{32}|\).) In essence, the fact that this can't happen for a prime modulus is why primitive roots do exist in that case.