# Summary

In today's class we finished proving a critical result concerning the number of elements of order *d* modulo *p*, where *p* is a prime number. This let's us conclude that primitive roots do exist modulo *p*. We then spent the second half of the class discussing integers for which primitive roots do not exist. We finished the class by classifying exactly those integers which do have primitive roots.

# Counting elements of order d modulo p

Last class period we talked about primitive roots modulo *p*, where *p* was an odd prime number. The key result was a proof of the following

Theorem: If $d \mid p-1$, then there are precisely $\phi(d)$ elements of order

dmodp.

We start today by giving a proof of this result

Proof: For a given divisor *d*, let $f(d)$ be the number of elements of order *d* mod *p*. We saw last class period that there are exactly *d* solutions to $x^d-1 \equiv 0 \mod{p}$. Therefore we have

But notice that if $a^d - 1 \equiv 0 \mod{p}$ then we get $a^d \equiv 1 \mod{p}.$ This in turn tells us that $\mbox{ord}_p(a) \mid d$. Hence any element $a$ in the set above must be an element of order *c*, where *c* is a divisor of *c*. Hence we have

By counting the number of elements on the left- and right-hand sides, we get

(3)On the other hand, we saw long ago that

(4)Hence we can combine (3) and (4) to give

(5)Translated into convolutions, this says $(P_0 * f)(d) = (P_0*\phi)(d)$. Convolving by $\mu$ then gives

(6)$\square$

As a consequence of this result, we see that primitive roots exist for any prime modulus.

Corollary: For any prime

p, there are exactly $\phi(p-1)$ many primitive roots.

Proof: Take $d = p-1$ in the above result, and remember that a primitive root mod *p* is an element of order $p-1$. $\square$

#### Example: Orders of Elements mod 17

Let's find out how many elements of each order exist modulo 17 (just to confirm the result we proved). Notice that an element mod 17 must have order from the set $\{1,2,4,8,16\}$, since these are the divisors of $\phi(17) = 16$. Using this fact, notice that we have

(7)Hence 3 is a primitive root. This will make computing the orders of other elements easier.

$3^j$ | $\mbox{gcd}(16,j)$ | $\mbox{ord}_{17}(3^j)$ | $3^j$ | $\mbox{gcd}(16,j)$ | $\mbox{ord}_{17}(3^j)$ |
---|---|---|---|---|---|

3^{1} |
1 | 16 | 3^{9} |
1 | 16 |

3^{2} |
2 | 8 | 3^{10} |
2 | 8 |

3^{3} |
1 | 16 | 3^{11} |
1 | 16 |

3^{4} |
4 | 4 | 3^{12} |
4 | 4 |

3^{5} |
1 | 16 | 3^{13} |
1 | 16 |

3^{6} |
2 | 8 | 3^{14} |
2 | 8 |

3^{7} |
1 | 16 | 3^{15} |
1 | 16 |

3^{8} |
8 | 2 | 3^{16} |
16 | 1 |

Notice that we have $\phi(16) = 8$ elements of order 16, $\phi(8) = 4$ elements of order 8, $\phi(4) = 2$ elements of order 4, $\phi(2)=1$ element of order 2, and $\phi(1) = 1$ element of order 1.

# Moduli Without Primitive Roots

Now that we've spent some time talking about moduli *m* which do have primitive roots, let's find a few that don't have primitive roots. We've already seen in class that 8 has no primitive roots. What about higher powers of 2?

Proposition: There is no primitive root modulo $2^m$, where $m \geq 3$.

Proof: We'll prove this result by induction. The base case ($m=3$) was done in class some time ago. Now let *a* be a given integer relatively prime to $2^m$. This means that *a* is an odd number. We'll show that

Since $\phi(2^m) = 2^{m-1}$, this will prove that there is no primitive root mod $2^m$.

Now by induction we know $a^{2^{m-3}} \equiv 1 \mod{2^{m-1}}$. Hence

(9)Squaring both sides of this equation gives

(10)$\square$

This rules out an infinite class of integers from having primitive roots. This next result will cut out even more.

Proposition: There are no primitive roots modulo

mnifm,nare relatively prime integers greater than 2.

Proof: Since *m,n* are relatively prime, this implies $\phi(mn) = \phi(m)\phi(n)$. Hence a primitive root mod *mn* would need to have order $\phi(m)\phi(n)$. Instead, we'll show that if $(a,mn) = 1$, then we have

This means that no element mod *mn* can be a primitive root, and so it gives the result we want.

Now since $m,n>2$ we know that 2 is a common divisor of $\phi(m)$ and $\phi(n)$. Now we'll compute *a* raised to $\frac{\phi(m)\phi(n)}{2}$ mod *m* and *n*, then stitch these results together. We have

Putting these together with CRT, we see that Equation (11) is true. $\square$

The two previous results together tells us that

Corollary: If

mhas a primitive root, thenmis either 1,2,4, a power of an odd prime, or twice a power of an odd prime.

In the next class period, we'll show that — in fact — all these values of *m* which *might* have primitive roots *do*, in fact, have primitive roots.