# Summary

Today we continued our discussion of the order of an integer *a* modulo *m*. We discussed many arithmetic properties of order, including its relationship to $\phi(m)$ as well as how one can predict the order of a power of an integer based on the order of the integer itself. We also discussed primitive roots more deeply, counting the number of primitive roots when they exist.

# More Properties of Order

Last class period we finished with the following

Lemma: For integers

mandawith $(a,m) = 1$, an integernsatisfies $a^n \equiv 1 \mod{m}$ if and only if $\mbox{ord}_m(a) \mid n$.

One of the important consequences of this result is the following

Corollary: For integers

mandawith $(a,m) = 1$, the order ofamodmis a divisor of $\phi(m)$.

Proof: From the last lemma we know that whenever $a^n \equiv 1 \mod{m}$ then we have $\mbox{ord}_m(a) \mid n$. Since Euler's Theorem tells us that $a^{\phi(m)} \equiv 1 \mod{m}$, this gives us the desired result. $\square$

#### Example: Calculating an order mod 11

Suppose that you want to calculate $\mbox{ord}_{11}(2)$. Normally we'd need to calculate $2^j \mod{11}$ for all *j* in the range $1 \leq j \leq 10$, but according to the last corollary we don't need to hit all these *j*: it's enough to try out those *j* which are divisors of 10. So let's do it:

Hence we see that $\ord_9(2) = 10$. $\square$

#### Example: Calculating an order mod 47

Let's use the same idea to calculate $\mbox{ord}_{47}(2)$. To do this, we need to know that the prime factorization of $\phi(47)$ is $\phi(47) = 2\cdot 23$. Then we only need to check the value of $2^j \mod{47}$ when $j \in \{1,2,23,47\}$.

(2)Hence we see that $\mbox{ord}_{47}(2) = 23$. Notice that this means that 2 is not a primitive root for this prime number. $\square$

# Primitive Roots as Generators

This is not the only useful corollary to come out of our lemma.

Corollary: For integers

mandawith $(a,m) = 1$, then $a^i \equiv a^j \mod{m}$ if and only if $i \equiv j \mod{\mbox{ord}_m(a)}$.

Proof: Suppose first that $i \equiv j \mod{\mbox{ord}_m(a)}$. This tells us that

(3)for some integer *k*. Hence we get

On the other hand, suppose that we know $a^i \equiv a^j \mod{m}$. Without loss of generality, assume additionally that $i>j$. Then we have

(5)Now since $(a,m) = 1$ we know $(a^j,m) = 1$, and hence we can "cancel" the appearance of $a^j$ from both sides of the above equation to conclude

(6)But our previous corollary says that this is only possible if $\mbox{ord}_m(a) \mid i-j$, which is what we wanted to prove. $\square$

This lemma doesn't wind up being especially useful for computing the order of a given element, since typically one doesn't have access to two integers *i* and *j* so that $a^i \equiv a^j \mod{m}$. It is, however, quite useful from a theoretical standpoint, as we're abou to see.

Lemma: Suppose that

ais a primitive root modm. Then the set $\{a,a^2,\cdots,a^{\phi(m)}\}$ is a complete set of reduced residues modm.

Recall that a residue *r* is said to be reduced mod *m* if $(r,m) = 1$. Hence the content of the above corollary is that for any number *n* which has $(n,m) =1$ there is some exponent $1 \leq k \leq \phi(m)$ so that

Proof: Certainly since $(a,m) = 1$ we know that $(a^k,m) =1$ for all $k \geq 1$. Hence we only need to show that if *i* and *j* are integers between 1 and $\phi(m)$, then $a^i \not\equiv a^j \mod{m}$. To do this, suppose instead that we had distinct *i* and *j* between 1 and $\phi(m)$ such that $a^i \equiv a^j \mod{m}$. According to the previous result, this would imply that $\mbox{ord}_m(a) \mid i-j$. But since $\mbox{ord}_m(a) = \phi(m)$, this means $\phi(m) \mid i-j$. This, however, is impossible because $1 \leq |i-j| \leq \phi(m)-1$. $\square$

This theorem is really quite powerful, because it tells us that if we can get a hold of a primitive root mod *m*, then we can use this element to express all other reduced residues. This is especially useful in light of the following

Lemma: Suppose that

mandaare integers satisfying $(a,m) = 1$. Then we have$\displaystyle \mbox{ord}_m(a^i) = \frac{\mbox{ord}_m(a)}{(\mbox{ord}_m(a),i)}$

Proof: Let's write *d* in place of $(\mbox{ord}_m(a),i)$. We'll also write $\mbox{ord}_m(a) = d \cdot b$ and $i = d\cdot k$. Notice that when we do this, we have $(b,k) = 1$. Now to compute the order of $a^i$, we need to find the smallest exponent which send this element to 1 mod *m*.

To start, notice that we have

(8)This implies that we have

(9)On the other hand, we know that

(10)by definition. Hence we know that $\mbox{ord}_m(a) \mid i \mbox{ord}_m(a^i).$ Considering $bd = \mbox{ord}_m(a)$ and $kd = i$, this means we get $bd \mid (kd)\mbox{ord}_m(a^i).$ Canceling the "d" on both sides then gives $b \mid k \mbox{ord}_m(a^i)$, and since $(b,k) = 1$ we conclude that

(11)Putting together Equations (9) and (11) gives $b = \mbox{ord}_m(a^i)$. $\square$

#### Example: Computing orders modulo 11

We already know that 2 is a primitive roots mod 11, so let's use this fact to compute the order of other elements mod 11.

$j$ | $2^j \mod{11}$ | $\mbox{gcd}(\mbox{ord}_{11}(2),j)$ | $\mbox{ord}_{11}(2^j)$ |
---|---|---|---|

1 | 2 | 1 | 10 |

2 | 4 | 2 | 5 |

3 | 8 | 1 | 10 |

4 | $2\cdot 8 \equiv 5$ | 2 | 5 |

5 | $2\cdot 5 \equiv 10$ | 5 | 2 |

6 | $2\cdot 10 \equiv 9$ | 2 | 5 |

7 | $2\cdot 9 \equiv 7$ | 1 | 10 |

8 | $2\cdot 7 \equiv 3$ | 2 | 5 |

9 | $2\cdot 3 \equiv 6$ | 1 | 10 |

10 | $2\cdot 6 \equiv 1$ | 10 | 1 |

# Counting Primitive Roots

A nice consequence of the previous result is that we can count primitive roots — at least when they exist.

Corollary: Suppose that a primitive root exists mod

m. Then there are $\phi(\phi(m))$ many primitive roots.

Proof: Let *a* be a primitive root. We already know that all reduced residues take the form $a^k$ where $1 \leq k \leq \phi(m)$, and the previous result tells us that

Hence we see that $a^k$ has order equal to $\phi(m)$ precisely when $(\phi(m),k) = 1$. By the definition of the $\phi$ function, there are precisely $\phi(\phi(m))$ many choices for *k* that satisfy this criterion. $\square$

One of the questions that was asked in class was: why do we need to assume there is a primitive root to prove this theorem? The answer is that in order to write an equation like

(13)we need to know that there really is an element *a* that has $\mbox{ord}_m(a) = \phi(m)$. It is worth nothing that not all *m* have a primitive root.

#### Example: A Modulus without Primitive Root

Let $m = 12$. Then the reduced residues are $\{1,5,7, 11\}$. Notice that $1^1 \equiv 1 \mod{12}$, and that

- $5^2 \equiv 25 \equiv 1 \mod{12}$
- $7^2 \equiv 49 \equiv 1 \mod{12}$
- $11^2 \equiv (-1)^2 \equiv 1 \mod{12}$

Hence we have

$a$ | $\mbox{ord}_{12}(a)$ |
---|---|

1 | 1 |

5 | 2 |

7 | 2 |

9 | 2 |

You can see that in this case there is no primitive root. $\square$