Skip to main content

Discrete Mathematical Structures

Subsection 5.1.4 Primitive roots

Example 5.1.4.1. Powers of \(3\) modulo \(5\).

The powers of \(3\) modulo \(5\) are
\begin{align*} 3^0\bmod 5 \amp =1\bmod 5=1 \\ 3^1\bmod 5 \amp =3\bmod 5=3 \\ 3^2\bmod 5 \amp =9\bmod 5=4 \\ 3^3\bmod 5 \amp =27\bmod 5=2 \\ 3^4\bmod 5 \amp =81\bmod 5=1 \\ 3^5\bmod 5 \amp =243\bmod 5=3 \\ \amp \vdots \end{align*}
Thus all elements of \(\ZZ_5-\{0\}=\{1,2,3,4\}\) are powers of \(3\) modulo \(5\text{.}\)

Definition 5.1.4.2.

A primitive root modulo a prime \(p\) is an integer \(r\) in \(\ZZ_p\) such that every nonzero element of \(\ZZ_p\) is a power of \(r\text{.}\)

Remark 5.1.4.3.

Let \(m\in\NN\text{.}\) We have \(a\in\NN\) is a primitive root modulo \(m\) if and only if
\begin{equation*} \{(a^n)\bmod m \mid n\in\NN\cup\{0\}\} = \ZZ_m-\{0\}. \end{equation*}

Example 5.1.4.4. Is \(1\) a primitive root modulo \(5\) ?

We determine whether \(1\) is a primitive root modulo \(5\text{.}\) We have \(1^n=1\) for all \(n\in\NN\cup\{0\}\text{.}\) Thus there is no \(n\in\NN\cup\{0\}\) such that \(1^n=2\text{.}\) But for \(1\) to be a primitive root modulo \(5\text{,}\) all elements of \(\ZZ_5-\{0\}=\{1,2,3,4\}\) would have to be powers of \(1\text{.}\) Thus \(1\) is not a primitive root modulo \(5\text{.}\)

Example 5.1.4.5. Is \(2\) a primitive root modulo \(5\) ?

We determine whether 2 is a primitive root modulo 5. We have
\begin{align*} 2^0\bmod 5 \amp =1\bmod 5=1 \\ 2^1\bmod 5 \amp =2\bmod 5=2 \\ 2^2\bmod 5 \amp =4\bmod 5=4 \\ 2^3\bmod 5 \amp =8\bmod 5=3 \end{align*}
So all elements of \(\ZZ_5-\{0\}=\{1,2,3,4\}\) are powers of \(2\) modulo \(5\text{.}\) Thus 2 is a primitive root modulo 5.
We have already noticed in ExampleΒ 5.1.4.1 above that 3 is a primitive root modulo 5.

Example 5.1.4.6. Is \(4\) a primitive root modulo \(5\) ?

We determine whether 4 is a primitive root modulo 5.\\ We have
\begin{align*} 4^0\bmod 5 \amp =1\bmod 5=1 \\ 4^1\bmod 5 \amp =4\bmod 5=4 \\ 4^2\bmod 5 \amp =16\bmod 5=1 \\ 4^3\bmod 5 \amp =(4\cdot 4^2) \bmod 5 = (4\cdot 1)\bmod 5=4 \\ 4^4\bmod 5 \amp =(4\cdot 4^3) \bmod 5 = (4\cdot 4)\bmod 5=1 \end{align*}
We observe that the powers of \(4\) modulo 5 alternate between \(1\) and \(4\text{.}\)
But for \(4\) to be a primitive root modulo \(5\text{,}\) all elements of \(\ZZ_5-\{0\}=\{1,2,3,4\}\) would have to be powers of \(4\text{.}\) For example, \(2\) is not a power of \(4\text{.}\) So \(4\) is a not primitive root modulo \(5\text{.}\)
Thus we have found that \(2\) and \(3\) are primitive roots modulo \(5\) while \(1\) and \(4\) are not primitive roots modulo \(5\text{.}\)

Definition 5.1.4.7.

Let \(m\in\NN\text{,}\) \(b\in\ZZ_m\text{,}\) and \(a\in\ZZ_m\text{.}\)
We call the smallest \(n\in\NN\cup\{0\}\) such that \(b^n\bmod m=a\) the discrete logarithm of \(a\) to the base \(b\) provided such an \(n\) exists.
If \(b^n\bmod m=a\) we write \(\log_b^{\otimes_m} a=n\text{.}\)

Problem 5.1.4.8. Find \(\glog{7}{9}{\otimes}\text{.}\).

Let \(a\otimes b=(a\cdot b)\bmod 11\text{.}\) Find \(\glog{7}{9}{\otimes}\text{.}\)
Solution.
We need to find \(n\in\NN\cup\{0\}\) such that \(\gexp{7}{n}{\otimes}=9\text{.}\) We compute
\(\gexp{7}{1}{\otimes}=7\) \(\gexp{7}{2}{\otimes}=(7\cdot 7)\bmod 11=5\)
\(\gexp{7}{3}{\otimes}=5\otimes 7 =(5\cdot 7)\bmod 11=2\) \(\gexp{7}{4}{\otimes}=(2\otimes 7)=(2\cdot 7)\bmod 11=3\)
\(\gexp{7}{5}{\otimes}=3\otimes 7 =(3\cdot 7)\bmod 11=10\) \(\gexp{7}{6}{\otimes}=(10\otimes 7)=(10\cdot 7)\bmod 11=4\)
\(\gexp{7}{7}{\otimes}=4 \otimes 7 = (4\cdot 7)\bmod 11=6\) \(\gexp{7}{8}{\otimes}=(6\otimes 7)=(6\cdot 7)\bmod 11=9\)
Thus \(\glog{7}{9}{\otimes}=8\text{.}\)

Remark 5.1.4.9.

Let \(m\in\NN-\{1\}\) and \(b\in\ZZ_m\text{.}\)
Then \(\log_b^{\otimes_m}a\) exists for all \(a\in\ZZ_m-\{0\}\) if and only if \(b\) is a primitive root modulo \(m\text{.}\)