Professional Documents
Culture Documents
Orders and Exponents: 1.1 Fermat's Little Theorem 1.2 Orders 1.3 Primitive Roots 1.4 Lifting The Exponent
Orders and Exponents: 1.1 Fermat's Little Theorem 1.2 Orders 1.3 Primitive Roots 1.4 Lifting The Exponent
Orders and Exponents: 1.1 Fermat's Little Theorem 1.2 Orders 1.3 Primitive Roots 1.4 Lifting The Exponent
We look at the definition and few applications of orders with some examples.
Contents
1 Theory 2
1.1 Fermat’s Little Theorem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.2 Orders . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.3 Primitive Roots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.4 Lifting the exponent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2 Example Problems 4
3 Problems 7
4 Solutions to Examples 10
4.1 Fermat Christmas Theorem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
4.2 Example 2.2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
4.3 Example 2.3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
4.4 Example 2.4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
4.5 Example 2.5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
4.6 Example 2.6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
4.7 Example 2.7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
4.8 Example 2.8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
1
Kazi Aryan Amin (INMOTC Karnataka, December 26th, 2023) Orders and Exponents
1 Theory
1.1 Fermat’s Little Theorem
Theorem 1.1
Let a, n be positive integers such that gcd( a, n) = 1. Let φ(n) denote the number of positive
integers at most n and relatively prime to it. Then:
a φ(n) ≡ 1 (mod n)
Proof. Let { a1 , a2 , · · · , a φ(n) } denote the set of positive integers at most n and relatively prime
to it. The main claim is as follows:
Claim — The sets { a1 , a2 , · · · , a φ(n) } and { aa1 , aa2 , · · · , aa φ(n) } are equivalent (mod n).
To see this, note that both the sets have the same number of elements, so it suffices to
show that all the elements in the second set are distinct modulo n. Note that if aai ≡ aa j
(mod n), then a( ai − a j ) ≡ 0 (mod n). However gcd( a, n) = 1, so this implies that n | ai − a j .
However | ai − a j | < n, so we have ai = a j as desired.
Having done this, we take the product of all the elements in both the sets:
∏ aai ≡ ∏ ai (mod n)
1≤ i ≤ φ ( n ) 1≤ i ≤ φ ( n )
=⇒ a φ(n) ≡ 1 (mod n)
(after dividing out by ∏ ai ).
1≤ i ≤ φ ( n )
This shows us that whenever gcd( a, n) = 1, there exists a positive integer d such that
n | ad − 1. (The above theorem says you can take d = φ(n).) This motivates the definition of
orders.
1.2 Orders
Orders
For relatively coprime positive integers a, n, we define the order of a (mod n), denoted
by ordn ( a), to be the smallest positive integer d such that n | ad − 1.
Lemma 1.2
Let d = ordn ( a). Then d | φ(n).
Proof. We show that if n | ae − 1, then d | e. Then the lemma follows from the previous
theorem. Let e = dq + r, where 0 ≤ r < d. So we get that 1 = ae = ( ad )q · ar (mod n), so that
ar = 1 (mod n). If r > 0, then this contradicts the minimality of d. Thus r = 0, and hence
d | e, as desired.
Corollary 1.3
For positive integers a, n, ord(an −1) ( a) = n.
2
Kazi Aryan Amin (INMOTC Karnataka, December 26th, 2023) Orders and Exponents
Fact 1.4. A primitive root (mod n) exists iff n = 2, 4, pk , 2pk for an odd prime p.
Corollary 1.5
For an odd prime p and a primitive root g (mod p), the elements {1, g, g2 , · · · , g p−2 }
represent all the distinct non-zero residues (mod p).
Lemma 1.6
p −1
We have ord p ( gk ) = gcd(k,p−1)
.
Proof. Suppose the order is e. Then we have gke ≡ 1 (mod p), so that ke ≡ 0 (mod p − 1).
p −1
The smallest positive integral solution of the last congruence is gcd(k,p−1) .
Exercise 1.7. Using the above lemma, show that the number of distinct residues having order d (mod p),
(for d | p − 1) is equal to φ(d).
As demonstrated in the previous proof, primitive roots are especially important as they
allow us to "transport" congruences (mod p) to (mod p − 1). Also we can write a = gb for
any residue a (mod p), which is super useful.
• νp ( xy) = νp ( x ) + νp (y)
3
Kazi Aryan Amin (INMOTC Karnataka, December 26th, 2023) Orders and Exponents
• p | a − b.
• p ∤ a, b.
• p ̸= 2.
Then we have:
νp ( a n − b n ) = νp ( a − b ) + νp ( n )
| {z }
>0
Fair word of warning : remember to verify ALL THREE CONDITIONS before using LTE.
2 Example Problems
Theorem 2.1 (Fermat Christmas Theorem)
For an odd prime p, show that there exists a positive integer n such that p | n2 + 1 iff p ≡ 1
(mod 4)
Walkthrough.
1. Say p | n2 + 1, then p | n4 − 1, thus you’re done. (why?)
2. Suppose 4 | p − 1. Find explicitly, some suitable k such that gk = n works. (Where g is
a primitive root modulo p).
Example 2.2
Find all positive integers n > 1 such that n | 2n − 1.
Walkthrough.
1. Suppose p | n. So p | 2n − 1, and hence p | 2gcd( p−1,n) − 1. So if gcd( p − 1, n) = 1, we
are through.
2. Find an appropriate prime divisor of p for which the above holds.
4
Kazi Aryan Amin (INMOTC Karnataka, December 26th, 2023) Orders and Exponents
Example 2.3
Let x > 1 be a positive integer. Prove that for all positive integers n, the smallest prime
n
divisor of xx−−11 is at least the smallest prime divisor of n
Walkthrough.
x n −1
1. Let p be the smallest prime divisor of x −1 . So p | x n − 1 and hence o := ord p ( x ) divides
n.
2. First solve the case o ≥ 2.
3. Now we turn to o = 1. What does LTE tell you?
Walkthrough.
1. Note that every n in the given interval can be expressed uniquely (by CRT), as a system of
congruences in a (mod 2017) and b (mod 2016), where 1 ≤ a ≤ 2017 and 1 ≤ b ≤ 2016.
Conversely, for every a, b as above, there exists a n such that 2017 ≤ n ≤ 20172 − 1 and
n = a (mod 2017) and n = b (mod 2016).
2. So now your congruence becomes ab = 1 (mod n). Setting a = gc for a primitive root
g, find number of possibilities of b depending on c.
3. Sum to finish. You should get a sum of the form ∑1≤i≤n , try to turn it into something of
the form ∑d|n .
Walkthrough.
1. WLOG assume gcd(m, 10) = 1. Otherwise divide out m by 2ν2 (m) 5ν5 (m) and nothing
changes. Do the same for c.
2. Given c, m both relatively prime to 10, note that t is exactly equal to ordcm (10). Find an
upper bound for S(m) with this. Suppose the bound obtained is N.
3. Now we want to find a m such that S(m) = N equals N. We somehow want to control
orders of 10 wrt m. What’s the best way to do this? Try imposing conditions on m such
that the order of 10 (mod m) is something very concrete.
4. For this choice of m, show that the order of 10 (mod cm) is c ordm (10). Conclude.
5
Kazi Aryan Amin (INMOTC Karnataka, December 26th, 2023) Orders and Exponents
Example 2.6
Show that the sum
1k + 2k + · · · + ( p − 1 ) k
equals 0 mod p if p − 1 ∤ k and −1 otherwise.
p −2
Walkthrough. The sum is ∑i≥0 gki . Use the sum of the geometric progression formula to
finish.
Walkthrough.
1. First consider the congruence modulo 43. By CRT, you can divide the integers 1 through
2021 into 47 blocks of {1, 2, · · · , 42}, and 47 multiples of 43.
2. Consider the power sum on each of the blocks for the first term. This should look
similar to what we have seen before.
3. Think about how to simplify the second term. As a hint, note that 47 and 43 are coprime.
Walkthrough.
1. We will use Lemma 1.13 extensively. First we show p | n. Assume that’s not the case.
Then gcd(m p − 1, mn − 1) = (m − 1).
6
Kazi Aryan Amin (INMOTC Karnataka, December 26th, 2023) Orders and Exponents
3 Problems
Problem 1. Find all primes p such that for a positive integer x, p | x3 − 1 ⇐⇒ p | x − 1
Problem 2. Show that 2 is a primitive root (mod 3k ) and (mod 5k ) for all positive integers
k ≥ 1.
Problem 3. Let p, q be distinct primes greater than 2 . Show that 2 pq − 1 has more than 2
different prime divisors.
Problem 4. Find all positive integers n1 , n2 , · · · , nk such that ni+1 | 2ni − 1 for all 1 ≤ i ≤ k
(where n1 = nk+1 ).
Problem 5 (Iran 3rd Round 2017 N1). Let x and y be integers and let p be a prime number.
Suppose that there exist realatively prime positive integers m and n such that
x m ≡ yn (mod p)
Problem 6. Find all primes p, q, such that 3pq | n3pq − n for all positive integers n
Problem 7 (Iran 3rd Round 2020 N1). Find all positive integers n such that the following
holds.
τ (n)|2σ(n) − 1
where τ (n) denotes the number of positive divisors of n, and σ(n) denotes the sum of
positive divisors of n.
Problem 8. Given two integers a and p (p is an odd prime). Find the number of functions
f : {0, 1, 2, 3, ..., p − 1} → {0, 1, 2, 3, ..., p − 1} satisfying
Problem 9 (Iran 3rd Round 2018 N1). n ≥ 2 is an integer.Prove that the number of natural
numbers m so that 0 ≤ m ≤ n2 − 1, x n + yn ≡ m (mod n2 ) has no solutions is at least (n2 )
7
Kazi Aryan Amin (INMOTC Karnataka, December 26th, 2023) Orders and Exponents
Problem 10 (USEMO 2019 P4). Prove that for any prime p, there exists a positive integer n
such that
1n + 2n−1 + 3n−2 + · · · + n1 ≡ 2020 (mod p).
Problem 11 (IZHO 2020 P1). Given natural number n such that, for any natural a, b number
2a 3b + 1 is not divisible by n. Prove that 2c + 3d is not divisible by n for any natural c and d
Problem 12 (OMO Fall 2019). Let p and q be prime numbers such that ( p − 1)q−1 − 1 is a
positive integer that divides (2q)2p − 1. Compute the sum of all possible values of pq.
Problem 13 (Iran 3rd Round 2020 N4). Let a, m be positive integers such that ordm ( a) is
odd and for any integers x, y so that
1. xy ≡ a (mod m)
2. ordm ( x ) ≤ ordm ( a)
We have either ordm ( x ) | ordm ( a) or ordm (y)| ordm ( a). Prove that ordm ( a) contains at most
one prime factor.
Problem 14 (IZHO 2017 P5). For each positive integer k denote C (k ) to be sum of its distinct
prime divisors. For example C (1) = 0, C (2) = 2, C (45) = 8. Find all positive integers n for
which C (2n + 1) = C (n).
Problem 15 (Balkan MO 2022 P2). Let a, b and n be positive integers with a > b such that
all of the following hold:
1. a2021 divides n
2. b2021 divides n
3. 2022 divides a − b.
Prove that there is a subset T of the set of positive divisors of the number n such that the
sum of the elements of T is divisible by 2022 but not divisible by 20222 .
Problem 16 (Iran TST 2018). Prove that for each positive integer m, one can find m consec-
utive positive integers like n such that the following phrase doesn’t be a perfect power:
13 + 20183 23 + 20183 · · · n3 + 20183
8
Kazi Aryan Amin (INMOTC Karnataka, December 26th, 2023) Orders and Exponents
Problem 17 (IMO SL 2017 N5). Find all pairs ( p, q) of prime numbers which p > q and
( p + q ) p+q ( p − q ) p−q − 1
( p + q ) p−q ( p − q ) p+q − 1
is an integer.
Problem 18 (Balkan MO 2018 P4). Find all primes p and q such that 3pq−1 + 1 divides
11 p + 17 p .
Problem 19 (DeuX MO 2020). Let n be a positive integer. Prove that there exists a finite set
S of positive integers greater than 1 with the following properties: 1. No element of S may
be expressed as ab with a, b > 1. 2. For any prime p there exists s ∈ S and x ∈ Z such that
x n ≡ s (mod p).
Problem 20 (IMO SL 2014 N6). Let a1 < a2 < · · · < an be pairwise coprime positive
integers with a1 being prime and a1 ≥ n + 2. On the segment I = [0, a1 a2 · · · an ] of the real
line, mark all integers that are divisible by at least one of the numbers a1 , . . . , an . These points
split I into a number of smaller segments. Prove that the sum of the squares of the lengths of
these segments is divisible by a1 .
9
Kazi Aryan Amin (INMOTC Karnataka, December 26th, 2023) Orders and Exponents
4 Solutions to Examples
4.1 Fermat Christmas Theorem
Solution. First assume p | n2 + 1, for some n. Since, p | n2 + 1, so p | n4 − 1. Thus we see that
ord p (n) | 4, so it equals 1, 2, 4. Note that it can’t equal 2 as then p | n2 + 1 − (n2 − 1) = 2. It
can’t be 1 as then n2 + 1 = 0 (mod p). Thus ord p (n) = 4 and hence 4 | p − 1.
p −1
Now assune p ≡ 1 (mod 4), and consider a primitive root g modulo p. Take n = g 4 . We
p −1
show thatp | n2 + 1. 2
that n + 1 = g
Indeed, note + 1. Also, since g p−1 − 1 = 0 (mod p),
2
p −1 p −1
we have g 2 −1 g 2+ 1 = 0 (mod p). However as ord p ( g) = p − 1, the first term
isn’t zero, yielding the result.
xn − 1
0 < νp = νp ( n )
x−1
We see that a ̸≡ 0 (mod 2017), so let a = gc , where g is a primitive root mod 2017. Thus
10
Kazi Aryan Amin (INMOTC Karnataka, December 26th, 2023) Orders and Exponents
For each value of b, there are gcd(2016, b) possibilities for c, giving us an answer of
2016
2016
∑ gcd(25 · 32 · 7, b) = ∑ dφ(
d
)
b =1 d|2016
Proof. This essentially follows by exponent lifting lemma. Indeed, the order of 10 (mod cM )
must be divisible by T. Now pick a prime p | c. If T ′ is the order of 10 (mod cM ), then T ′
must be divisible by T; now compute
′
νp (c) + νp ( M) ≤ νp (10T − 1)
′
= νp (10T )T /T − 1
= νp (10T − 1) + νp ( T ′ ) − νp ( T )
⇐⇒ νp ( T ′ ) ≥ νp (cT ).
g ( p −1) m − 1
1 + gk + g2k + · · · + g( p−2)m ≡ (mod p)
gm − 1
Note that the denominator isn’t zero, but the numerator is; which finishes.
11
Kazi Aryan Amin (INMOTC Karnataka, December 26th, 2023) Orders and Exponents
mp − 1 m pn − 1
=q= n
m−1 m −1
But, m p+n > (mn − 1)(m p − 1) = (m − 1)(mnp − 1) > mnp , implying that ( p − 1)(n − 1) =
pn − p − n + 1 < 1, a contradiction. So p | n.
k +1
m p · t −1
Let n = pk · t where gcd(t, p) = 1. We have k = q.
m p · t −1
p k +1 −1 k ·t mp
k + 1
−1 k +1
Since gcd( m k , mp − 1) = 1 and k | m p ·t − 1, this means that
m p −1 p
m −1
k +1 k +1
mp −1 m p ·t − 1
k
= q = k
mp − 1 m p ·t − 1
px
But since the function f ( x ) = ccx −−11 is increasing, this means t = 1.
But then by LTE, v p (( p − 1)n + 1) = 1 + v p (n) = k + 1, giving us pn = pk+1 | ( p − 1)n + 1,
as desired.
12