Primitive_Roots___Modular_Arithmetic
Primitive_Roots___Modular_Arithmetic
Modular Arithmetic
by Equation Tracker
1 Orders
Definition 1.1 (Orders). Let a, p ∈ N such that p is a prime and a ̸≡ 0 (mod p).
Then the smallest positive integer k such that ak ≡ 1 (mod p) is called Order of
a modulo p. We will denote it as Op (a) = k.
We can see that if an ≡ 1 (mod p) then Op (a) | n. Also the converse is true.
As p is prime and gcd (a, p) = 1, by Fermet’s little theorem, we always have that
ap−1 ≡ 1 (mod p). Hence, there always exist Op (a) for every a coprime to p.
Now suppose an ≡ 1 (mod p). Assume for contrary, Op (a) ∤ n. Then n = k·Op (a)+r
where 0 < r < Op (a). So,
k
n k·Op (a)+r Op (a)
a =a = a · ar ≡ ar ≡ 1 (mod p)
but 0 < r < Op (a) which is a contradiction. And therefore Op (a) | n as desired.
Corollary 1.2 (Orders are Multiplicative). Let a, b ∈ N such that Op (a) = x and
Op (b) = y. If gcd(x, y) = 1, then
Op (ab) = xy
Proof. It’s not hard to check that (ab)xy ≡ 1 (mod p). So, Op (ab) = n | xy. But
gcd(x, y) = 1. Therefore we conclude that, n = x′ y ′ where x′ | x and y ′ | y. We
have
x
x′ y ′ x′ y ′ x′ ′ ′ ′ ′
(ab) ≡ 1 (mod p) =⇒ (ab) = (ab)xy ≡ (ax )y · bxy ≡ bxy ≡ 1 (mod p)
1
Corollary 1.3. We always have,
Op (a) | p − 1
2 Primitive Roots
Primitive roots are really interesting. We’ve already talked about orders. What if
Op (a) = p − 1? If order of a mod p is p − 1, then a is called a primitive root modulo
p. This means none of {a1 , a2 , . . . , ap−2 } is congruent to 1 mod p. In fact, we can
say more. They all are different.
Definition 2.1 (Primitive Roots). Let a, p ∈ N with p be a prime and a ̸= 1. If
Op (a) = p − 1, then such a is called a Primitive Root modulo p.
Lemma 2.1.1. Let b be a primitive root mod p. Then
2
Problem 2.1: Sum of Powers
Let p > 2 be a prime. then for any integer x
(
−1 if p − 1 | x
1x + 2x + · · · + (p − 1)x ≡ (mod p)
0 if p − 1 ∤ x
Problem 2.2
Let x be a primitive root modulo an odd prime p. If p = 2k + 1, prove that
xk ≡ −1 (mod p)
Now we are going to finish this note, but before that, let’s see some properties
more.
Corollary 2.2. Let a be a primitive root mod p and x be any integer such that p ∤ x.
Then x ≡ ak (mod p) where 1 ≤ k ≤ p − 1.
Proof. Let
(g k )x = g kx ≡ 1 (mod p) =⇒ Op (g) = p − 1 | kx
p−1 kx p−1
=⇒ | =⇒ |x
gcd(p − 1, k) d gcd(p − 1, k)
Again
p−1 p−1
(g k ) d = g (p−1)n = (g p−1 )n ≡ 1 (mod p) =⇒ x |
gcd(p − 1, k)
p−1
Combining these two results give us, x = Op (g k ) = gcd(p−1,k) as desired.
Problem 2.3
Show that there are exactly φ(p − 1) primitive roots modulo p.