Orders and Exponents: 1.1 Fermat's Little Theorem 1.2 Orders 1.3 Primitive Roots 1.4 Lifting The Exponent

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 12

Orders and Exponents

Kazi Aryan Amin

INMOTC Karnataka, December 26th, 2023

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

1.3 Primitive Roots


Primitive Roots
We say g is a primitive root (mod n), if ordn ( g) = φ(n).

Fact 1.4. A primitive root (mod n) exists iff n = 2, 4, pk , 2pk for an odd prime p.

Here’s a series of useful results about primitive roots:

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.

1.4 Lifting the exponent


Defining prime valuation
For a non-zero integer n, and a given prime p, define νp ( a) to be the unique non-negative
integer k such that pk | a, but pk+1 ∤ a. We say pk "fully divides" n, and write pk || a.

Lemma 1.8 (Basic Properties of νp (•))

• νp ( x ) ≥ 0 for all positive integers x.

• νp ( xy) = νp ( x ) + νp (y)

• νp ( x + y) ≥ min νp ( x ), νp (y). Equality is only possible when νp ( x ) ̸= νp (y).

Remark 1.9. So a | b for integers a, b iff νp ( a) ≤ νp (b) for all primes p.

3
Kazi Aryan Amin (INMOTC Karnataka, December 26th, 2023) Orders and Exponents

Remark 1.10. We may extend the function νp : N 7→ Z≥0 to νp : Q̸=0 7→ Z by defining νp ( ba ) =


νp ( a) − νp (b) for a, b coprime integers a, b.

Now we are ready to present the exponent-lifting lemma.

Theorem 1.11 (The exponent-lifting lemma(LTE))


Let a, b be positive integers and p be a prime. Assume that:

• 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.

Exercise 1.12. Find a version of LTE for p = 2.

Lemma 1.13 (Small Tidbit you should remember)


For positive integers x, a, b, we have gcd( x a − 1, x b − 1) = xgcd(a,b) − 1

Having done this, we move on to examples.

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?

Example 2.4 (Pumac NT A P7)


For how many integers 2017 ≤ n ≤ 20172 − 1 do we have 2017 | nn − 1?

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 .

Example 2.5 (IMO SL 2017 N4)


Call a rational number short if it has finitely many digits in its decimal expansion. For
a positive integer m, we say that a positive integer t is m−tastic if there exists a number
10t − 1 10k − 1
c ∈ {1, 2, 3, . . . , 2017} such that is short, and such that is not short for any
c·m c·m
1 ≤ k < t. Let S(m) be the set of m−tastic numbers. Consider S(m) for m = 1, 2, . . . . What
is the maximum number of elements in S(m)?

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.

Example 2.7 (Putnam 2021 A5)


Let A be the set of all integers n such that 1 ≤ n ≤ 2021 and gcd(n, 2021) = 1. For every
nonnegative integer j, let
S( j) = ∑ n j .
n∈ A

Determine all values of j such that S( j) is a multiple of 2021.

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.

4. Finish using the last example

Example 2.8 (Turkey TST 2019 Problem 5)


m pn −1
Let p > 2 be a prime number, m > 1 and n be positive integers such that m n −1 is a prime
number. Show that:
pn | ( p − 1)n + 1

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).

2. If you find a factor of m pn − 1 coprime to mn − 1, then it must equal q! Find an


appropriate term using the last item.

3. Derive a size contradiction using the above equality.

4. So now consider n = pk .t, where p ∤ t. Prove that t = 1 by doing something similar to


above.

5. So n is a power of p and conclude by LTE.

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)

Prove that there exists an unique integer z modulo p such that

x ≡ zn (mod p) and y ≡ zm (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

f (kx mod p) ≡ k · f ( x ) (mod p).

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)

3. ordm (y) ≤ 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.

4.2 Example 2.2


Solution. We show that no such n exists. Assume otherwise and let p denote the smallest
prime dividing n. Note that p | n | 2n − 1 and p | 2 p−1 − 1. Thus, ord p (2) divides n and p − 1,
so it must divide their gcd. Since p is the smallest prime dividing n, the gcd must equal 1.
Thus we get p | 21 − 1 = 1. Absurd.

4.3 Example 2.3


x n −1
Solution. Note that, if p is the smallest prime divisor of x −1 , then p must divide x n − 1 as
well. Thus o := ord p ( x ) divides n.

1. Suppose o = 1. Then p | x − 1, and hence by LTE, we have:

xn − 1
 
0 < νp = νp ( n )
x−1

So, p | n and therefore p is at least the smallest prime divisor of n.

2. If o ≥ 2 then since o | n, o is at least the smallest prime factor of n. By noting that


p > p − 1 ≥ r, we are done.

4.4 Example 2.4


Solution. (by shendrew7 on aops) Clearly we can reduce our problem to just the interval
2017 ≤ n ≤ 20172 − 1. Then each n in this range can be uniquely expressed as a system of
congruences as a (mod 2016) and b (mod 2017), so

nn ≡ ab ≡ 1 (mod 2017), 0 ≤ a ≤ 2016, 1 ≤ b ≤ 2016.

We see that a ̸≡ 0 (mod 2017), so let a = gc , where g is a primitive root mod 2017. Thus

gbc ≡ 1 (mod 2017) =⇒ 2016 | bc.

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

This is multiplicative, so we compute it to be equal to 112 · 21 · 13 = 30576 .

4.5 Example 2.5


Solution. (by Evan Chen) The answer is 807.
We restrict our attention to c and m such that gcd(c, 10) = gcd(m, 10) = 1, since stripping
factors of 2 or 5 doesn’t change anything. In that case, since t is determined by c and m in a
fantastic triple (the order of 10 (mod cm)), we have

#S(m) ≤ #{1 ≤ c ≤ 2017 | gcd(c, 10) = 1}


     
2017 2017 2017
= 2017 − − +
2 5 10
= 807.

The main point of the problem is to achieve this bound.


Let T be a large composite integer such that M = 10T − 1 is divisible by every primes at
most 2017 other than 2 and 5. (Thus T is the order of 10 (mod M).)

Claim — The order of 10 (mod cM ) is cT.

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 ).

This completes the proof. ■


Hence, the relevant fantastic triples are (cT, c, M ) for each c ≤ 2017 relatively prime to
10.

4.6 Example 2.6


Solution. It suffices to consider the case when p − 1 ∤ n, as the other case is obvious. Let g be
a primitive root (mod p), so the given sum rewrites as:

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

4.7 Example 2.7


Solution. (by blacksheep2003 on aops) We show that j works iff 42 ∤ j and 46 ∤ j. First, we
consider the equation modulo 43. Partition {1, 2, · · · , 2021} into 47 reduced residue classes
modulo 43, and 47 multiples of 43. Therefore, S( j) ≡ 47(1 j + 2 j + · · · + 41 j ) − ((47 · 1) j +
(47 · 2) j + · · · + (47 · 42) j ) mod 43 (this follows from the multiples of 47 not being included
in A), and since 47 · 1, 47 · 2, · · · , 47 · 42 also comprises a reduced residue class modulo 43,
this simplifies to S( j) ≡ 46(1 j + 2 j + · · · + 41 j ) mod 43. As seen before, this is zero iff 42 ∤ j.
Do the other case similarly.

4.8 Example 2.8


Solution. (by hakN on aops) Repeatedly use the fact that gcd(m x − 1, my − 1) = mgcd( x,y) − 1
for any m > 1 and x, y ∈ N.
np
Let mmn −−11 = q where q is a prime.
p
Now if p ∤ n, then gcd(m p − 1, mn − 1) = m − 1. Now, mm−−11 divides m pn − 1 and also
p
gcd(mn − 1, mm−−11 ) = 1. So these two imply that

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

You might also like