0% found this document useful (0 votes)
39 views

7-euler-lecture

Uploaded by

Ajay Singh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
39 views

7-euler-lecture

Uploaded by

Ajay Singh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 42

Euler’s Theorem

Lecture 7

Justin Stevens

Justin Stevens Euler’s Theorem (Lecture 7) 1 / 42


Outline

1 Primes
Fermat’s Little Theorem Challenge Problems
Pseudoprimes
Prime Number Theorem
Wilson’s Theorem

2 Chinese Remainder Theorem

3 Euler’s Totient Theorem

Justin Stevens Euler’s Theorem (Lecture 7) 2 / 42


Fermat’s Little Theorem Review

Theorem. If p is prime and a is an integer with p - a, then

ap−1 ≡ 1 (mod p).

Alternatively, for every integer a, ap ≡ a (mod p).

Justin Stevens Euler’s Theorem (Lecture 7) 3 / 42


Challenge Problems

Example 1. (IMO 2005) Determine all positive integers relatively


prime to all the terms of the infinite sequence 2n + 3n + 6n − 1, n ≥ 1
Example 2. (NIMO) Let p = 2017 be a prime. Find the remainder
when  p  p  p
1 2 3 2015p
 
+ + + ··· +
p p p p
is divided by p. Here b·c denotes the greatest integer function.

Justin Stevens Euler’s Theorem (Lecture 7) 4 / 42


IMO Problem

Example. (IMO 2005) Determine all positive integers relatively prime


to all the terms of the infinite sequence 2n + 3n + 6n − 1, n ≥ 1
Solution. I claim the answer is 1, therefore, every prime p divides a term in
the sequence. For p = 2, n = 1 works and for p = 3, n = 2 works. By
Fermat’s Little Theorem for n = p − 2,
 
6 2p−2 + 3p−2 + 6p−2 − 1 ≡ 3 · 2p−1 + 2 · 3p−1 + 6p−1 − 6
≡3+2+1−6
≡0 (mod p).

Therefore, for p 6= 2, 3, when n = p − 2, we have p | 2n + 3n + 6n − 1.

Justin Stevens Euler’s Theorem (Lecture 7) 5 / 42


NIMO Sum

Example. (NIMO) Let p = 2017 be a prime. Find the remainder when


 p  p  p
1 2 3 2015p
 
+ + + ··· +
p p p p

is divided by p. Here b·c denotes the greatest integer function.


p np −n
Solution. By FLT, np ≡ n (mod p), so b np c = p and the sum is
p−2 p−2
X kp − k 1X p
= (k − k) .
k=1
p p k=1

From the Binomial Theorem, j p + (p − j)p ≡ 0 (mod p 2 ) for all j, so


p−2 p−2
X
p p
X (p − 2)(p − 1) p(3 − p)
(k − k) ≡ 1 − k ≡1− ≡ (mod p 2 ).
k=1 k=1
2 2
3−p −2014
Substituting p = 2017, 2 ≡ 2 ≡ −1007 ≡ 1010 (mod p).
Justin Stevens Euler’s Theorem (Lecture 7) 6 / 42
Pseudoprimes

Over 25 centuries ago, Chinese mathematicians believed n is prime iff


2n ≡ 2 (mod n). The counterexample n = 341 was discovered in 1819.
Fermat’s primality test says to pick a number a with 1 < a < p − 1. If
an−1 6≡ 1 (mod n), then we can conclude that a is composite. However, if
the congruence holds, then we assign a high probability to n being prime.
Composite n with an−1 ≡ 1 (mod n) are called pseudoprimes to base a.

Example. Prove that if n is a base-2 pseudoprime, then Mn = 2n − 1


is a larger one.

Justin Stevens Euler’s Theorem (Lecture 7) 7 / 42


Mersenne Pseudoprimes

Composite n with an−1 ≡ 1 (mod n) are called pseudoprimes to base a.

Example. If n is a base-2 pseudoprime, then Mn = 2n − 1 is a larger one.

Proof.
Since n is a base-2 pseudoprime, 2n−1 ≡ 1 (mod n), so 2n ≡ 2 (mod n).
Therefore, there exists an integer k with 2n − 2 = kn. Substituting, we have

2Mn −1 − 1 = 2kn − 1
 
= (2n − 1) 2n(k−1) + 2n(k−2) + · · · + 2n + 1
≡ 0 (mod Mn ).

Since n is composite, Mn is composite and the conclusion follows.

Justin Stevens Euler’s Theorem (Lecture 7) 8 / 42


Carmichael Numbers

A Carmichael number is an integer n that is a pseudoprime for every


coprime base a. In other words, an−1 ≡ 1 (mod n) for every gcd(a, n) = 1.

Example. Prove that 561 is a Carmichael number.


Proof. Factoring shows 561 = 3 · 11 · 17. Therefore, for every a coprime to
3, 11, and 17, using Fermat’s Little Theorem,
a2 ≡ 1 (mod 3), a10 ≡ 1 (mod 11), a16 ≡ 1 (mod 17).
Using these congruences, we see that
 280
a560 ≡ a2 ≡ 1 (mod 3)
 56
a560 ≡ a10 ≡ 1 (mod 11)
 35
a560 ≡ a16 ≡ 1 (mod 17).

Therefore a560 ≡ 1 (mod 561) for all a relatively prime to 561.


Justin Stevens Euler’s Theorem (Lecture 7) 9 / 42
Korselt’s Criterion

The previous example establishes the intuition for the below theorem.

Theorem. (Korselt’s Criterion) A number n is Carmichael if and only if


n = p1 p2 · · · pr , where the pi are distinct primes and pi − 1 | n − 1 for
every 1 ≤ i ≤ r .

Justin Stevens Euler’s Theorem (Lecture 7) 10 / 42


Primality Tests

One way to test primality is trial division: if d - n for 2 ≤ d ≤ n − 1, then n


is prime. This can be improved by observing that factors come in pairs:

48 = 1 · 48 = 2 · 24 = 3 · 16 = 4 · 16 = 6 · 8.

The divisors flip around and repeat, so we only check 2 ≤ d ≤ b nc.

Theorem. (Eratosthenes)
√ Write the numbers 1 to N in a grid. For all
primes p ≤ N, cross out the multiples 2p, 3p, 4p, · · · from. The numbers
that remain are the primes less than N.

Example. Find all primes less than or equal to 100.

Justin Stevens Euler’s Theorem (Lecture 7) 11 / 42


Primes less than 100

Example 3. Find all primes less than or equal to 100.


Solution. We show the completed grid using the Sieve of Eratosthenes:
2 3 4 5 6 7 8 9 10
11 12 13 14 15 16 17 18 19 20
21 22 23 24 25 26 27 28 29 30
31 32 33 34 35 36 37 38 39 40
41 42 43 44 45 46 47 48 49 50
51 52 53 54 55 56 57 58 59 60
61 62 63 64 65 66 67 68 69 70
71 72 73 74 75 76 77 78 79 80
81 82 83 84 85 86 87 88 89 90
91 92 93 94 95 96 97 98 99 100

Justin Stevens Euler’s Theorem (Lecture 7) 12 / 42


π Function

Definition. The number of primes less than or equal to a number n is


defined as π(n). For example, in our grid above, π(100) = 25.

Example 4. Find an exact formula for π(n) if p1 , p2 , · · · , pt are the



primes ≤ n. Hint: Use Principle of Inclusion-Exclusion!

Justin Stevens Euler’s Theorem (Lecture 7) 13 / 42


Exact Formula

Example. Find a formula for π(n) if p1 , p2 , · · · , pt are the primes ≤ n.

Solution. We start with n and subtract off the numbers ≤ n divisible by at


least one pi . We then add back the primes p1 , p2 , · · · , pt and subtract 1.
From Principle of Inclusion-Exclusion,
X n X n X n √ 
π(n) = n − b c+ b c− b c + · · · + π n − 1.
i
pi i<j
pi pj i<j<k
pi pj pk

For small n, this gives a very compact way to compute π(n). However, for
larger values of n, computing the sum above isn’t reasonable.

Theorem. (Prime Number Theorem) The number of primes less than or


equal to n is asymptotic to n/ ln(n). In other words,
π(n)
lim = 1.
n→∞ n/ ln(n)

Justin Stevens Euler’s Theorem (Lecture 7) 14 / 42


History behind Theorem

We show a table of π(n) for several powers of 10.


n π(n) n/ ln(n)
1000 168 145
10000 1229 1086
100000 9592 8686
1000000 78498 72382
10000000 664579 620420
In 1798 Legendre published the first significant conjecture on the size of
π(n) in his book “Essai sur la Théie des Nombres”.
Tchebycheff made the first real progress towards proving the theorem in
1850 by showing that there exists constants a ≤ 1 ≤ b with
a (n/ ln(n)) < π(n) < b (n/ ln(n)) .
In 1896, Hadamard and de la Vallée Poussin completely proved the prime
number theorem using Riemann’s complex zeta function.
Justin Stevens Euler’s Theorem (Lecture 7) 15 / 42
Other Estimates

While studying prime tables in 1791, Gauss came up with another estimate:
Z x
dt
π(x ) ≈ = Li(x ).
2 ln(t)
In his proof, de la Vallée Poussin proved that Gauss’ Li function is always a
better estimate than n/ ln(n). He also showed that the best estimate of the
form n/(ln(n) − a) is when a = 1. Consider the following table:

n π(n) Gauss’ Li n/(ln(n) − 1)


1000 168 178 169
10000 1229 1246 1218
100000 9592 9630 9512
1000000 78498 78628 78030
10000000 664579 664918 661459
Table 1: Gauss’ estimate of π(n)

Justin Stevens Euler’s Theorem (Lecture 7) 16 / 42


Consequences of the Prime Number Theorem

One consequence is that the nth prime is approximately pn ≈ n ln(n).


Bertrand’s Postulate states that there is always a prime between n and
2n for n ≥ 2. He showed this for all integers up to 3 million by consider

2, 3, 5, 7, 13, 23, 43, 83, 163, 317, 631, 1259, 2503, 4001, · · ·

This is a sequence of primes, each less than twice the predecessor.

Tchebycheff proved the result in 1852 using methods similar to the prime
number theorem. In fact, the number of primes in the range is asymptotic
to n/ ln n. “Proofs from the book" features an elementary method.
An unsolved problem is Legendre’s conjecture that states there is always
a prime between n2 and (n + 1)2 . This conjecture would imply that for any

prime p, the gap between the next prime is in the order of p.

Justin Stevens Euler’s Theorem (Lecture 7) 17 / 42


Wilson’s Theorem

Theorem. (Wilson) (p − 1)! ≡ −1 (mod p) for all odd primes p.


Solution. When p = 7, 6! = 720 ≡ −1 (mod 7). Alternatively,
6! = 1 · (2 · 4) (3 · 5) · 6 ≡ 1 · 1 · 1 · 6 ≡ −1 (mod 7).
We find groups of terms that multiply to 1 mod p. Observe that
x2 ≡ 1 mod p ⇐⇒ (x − 1) (x + 1) ≡ 0 mod p ⇐⇒ x ≡ ±1 mod p.
Since p is odd, this implies we can pair the inverses off into (p − 3)/2 pairs,
say (x1 , y1 ), (x2 , y2 ), (x3 , y3 ), · · · (x(p−3)/2 , y(p−3)/2 ). Therefore,
h i
(p − 1)! ≡ 1 · (x1 y1 ) (x2 y2 ) · · · x(p−3)/2 y(p−3)/2 · (p − 1) (mod p)
≡ 1 · 1 · 1 · · · 1 · (p − 1) (mod p)
≡ −1 (mod p).

Justin Stevens Euler’s Theorem (Lecture 7) 18 / 42


Quadratic Residue

Theorem. For an odd prime p, x 2 ≡ −1 (mod p) iff p ≡ 1 (mod 4).

Proof. If x 2 ≡ −1 (mod p), then raising this to the power of (p − 1)/2:


  p−1 p−1 p−1
x2 2
≡ (−1) 2 =⇒ x p−1 ≡ (−1) 2 (mod p).

By Fermat’s Little Theorem the LHS is 1, therefore p ≡ 1 (mod 4).


By Wilson’s Theorem, (p − 1)! ≡ −1 (mod p). Furthermore,

(p − 1)! = [1 · (p − 1)] [2 · (p − 2)] · · · [(p − 1)/2 · (p + 1)/2]


≡ (1 · −1) (2 · −2) · · · [(p − 1)/2 · (−(p − 1)/2))] (mod p)
 2
p−1

p−1
≡ (−1) 2 ! (mod p)
2
 
p−1
If p ≡ 1 (mod 4), then x = 2 ! solves x 2 ≡ −1 (mod p).
Justin Stevens Euler’s Theorem (Lecture 7) 19 / 42
Outline

1 Primes

2 Chinese Remainder Theorem


General Solution to Linear Congruences

3 Euler’s Totient Theorem

Justin Stevens Euler’s Theorem (Lecture 7) 20 / 42


Linear Congruences Review

The inverse of a mod m exists iff gcd(a, m) = 1.


If the Diophantine equation ax + by = c has particular solution (x0 , y0 )
and d = gcd(a, b), then the set of ordered integer solutions is

b a 
 
S= x0 + · k, y0 − · k k ∈ Z .
d d

If ca ≡ cb (mod m), then a ≡ b (mod m/d), where d = gcd(c, m).

Justin Stevens Euler’s Theorem (Lecture 7) 21 / 42


Example

Example. Find all solutions to the congruence 18x ≡ 30 (mod 42).

Solution. We can divide the congruence by gcd(18, 42) = 6:

3x ≡ 5 (mod 7).

Listing numbers that are 5 mod 7, 5, 12, 19, we see x ≡ 4 (mod 7):

x ≡ 4, 11, 18, 25, 32, 39 (mod 42).

Notice there are d = gcd(18, 42) = 6 solutions to the congruence.

Justin Stevens Euler’s Theorem (Lecture 7) 22 / 42


Solutions to General Congruence

Theorem. ax ≡ b (mod m) has d = gcd(a, m) mutually incongru-


ent solutions if d | b.
Let a particular solution to the Diophantine equation ax + my = b have x
value x0 . Then consider the d solutions
m m m
x0 , x0 + , x0 + 2 , · · · , x0 + (d − 1) .
d d d
We begin by showing the solutions are unique. Assume for the sake of
contradiction that two are the same. Therefore, there exists integers t1 and
t2 such that 0 ≤ t1 , t2 ≤ d − 1 and
m m
x0 + t1 ≡ x0 + t2 (mod m).
d d
Since gcd( m m m
d , m) = d , we subtract x0 and divide by d :

t1 ≡ t2 (mod d),
which is a contradiction. Therefore, the solutions are mutually incongruent.
Justin Stevens Euler’s Theorem (Lecture 7) 23 / 42
Every Solution

Theorem. ax ≡ b (mod m) has d = gcd(a, m) mutually incongru-


ent solutions if d | b.
We now show that every number of the form x0 + t · m d is congruent to one
of the d solutions above. Let t = dq + r , 0 ≤ r ≤ d − 1 by the division
algorithm. Therefore,
m m m m
x0 + t = x0 + (dq + r ) = x0 + qm + r ≡ x0 + r · (mod m).
d d d d
Since 0 ≤ r ≤ d − 1, this is a listed solution.

Justin Stevens Euler’s Theorem (Lecture 7) 24 / 42


System of Linear Congruences

Since we solved a single linear congruence, we now consider the system:

a1 x ≡ b 1 mod m1 , a2 x ≡ b2 mod m2 , · · · , ar x ≡ br mod mr .

Assume that the moduli mk are pairwise relatively prime. The system will
have no solution unless each individual congruence has a solution, therefore
dk | bk for each k, where dk = gcd(ak , mk ).
If this is the case, then dk can be cancelled in the kth congruence to
produce the system with the same solution:

a10 x ≡ b10 mod n1 , a20 x ≡ b20 mod n2 , · · · , ar0 x ≡ br0 mod nr .

Observe that nk = mk /dk and the moduli nk are pairwise relatively prime.
Furthermore, gcd(ai0 , ni ) = 1, so the congruences have solutions

x ≡ c1 mod n1 , x ≡ c2 mod n2 , · · · , xr ≡ cr mod nr .

Justin Stevens Euler’s Theorem (Lecture 7) 25 / 42


Chinese Remainder Theorem

Theorem. Let n1 , n2 , · · · , nr be pairwise relatively prime integers. Then

x ≡ c1 mod n1 , x ≡ c2 mod n2 , · · · , xr ≡ cr mod nr

has a unique solution modulo n1 n2 · · · nr .


Proof. Let N = n1 n2 · · · nr and Nk = N/nk = n1 · · · nk−1 nk+1 · · · nr .
Since the moduli are pairwise relatively prime, gcd(Nk , nk ) = 1 for every k.
The congruence Nk xk ≡ 1 (mod nk ) then has a unique solution. Consider

x = c1 N1 x1 + c2 N2 x2 + · · · + cr Nr xr .

Observe that Nk ≡ 0 (mod nj ) for k 6= j, so x ≡ cj Nj xj ≡ cj (mod nj ).


Therefore, x is a solution to our original system of congruences.
We now must prove that the solution is unique.

Justin Stevens Euler’s Theorem (Lecture 7) 26 / 42


Uniqueness of Solution

Theorem. Let n1 , n2 , · · · , nr be pairwise relatively prime integers. Then

x ≡ c1 mod n1 , x ≡ c2 mod n2 , · · · , xr ≡ cr mod nr

has a unique solution modulo n1 n2 · · · nr .


Assume that x 0 is another integer that satisfies the system, so:

x 0 ≡ ck ≡ x (mod nk ).

However, then nk | x 0 − x for every k. Since the nk are pairwise relatively


prime, this implies n1 n2 · · · nr | x 0 − x . In other words, x 0 ≡ x (mod N),
contradiction. We have thus proven the Chinese Remainder Theorem

Justin Stevens Euler’s Theorem (Lecture 7) 27 / 42


Sun-Tsu Puzzle

One example is due to the first-century Chinese mathematician Sun-Tsu:


Example. Solve the system of linear congruences
x ≡2 (mod 3), x ≡ 3 (mod 5), x ≡2 (mod 7).

Solution. Using the notation from our proof, N = 3 · 5 · 7 = 105 and


N N N
N1 = = 35, N2 = = 21, N3 = = 15.
3 5 7
We furthermore see that the linear congruences
35x1 ≡ 1 (mod 3), 21x2 ≡ 1 (mod 5), 15x3 ≡ 1 (mod 7)
are solved by x1 = 2, x2 = 1, and x3 = 1. Therefore, a solution is
x = c1 N1 x1 + c2 N2 x2 + c3 N3 x3 = 2 · 35 · 2 + 3 · 21 · 1 + 2 · 15 · 1 = 233.
Taking this modulo 105, our unique solution is x ≡ 233 ≡ 23 (mod 105).
Justin Stevens Euler’s Theorem (Lecture 7) 28 / 42
Least Common Multiple Puzzle

Example. Solve the system of linear congruences

x ≡ 6 (mod 7), x ≡ 10 (mod 11), x ≡ 12 (mod 13).

Solution. Observe that adding 1 to every congruence, we have

x + 1 ≡ 0 (mod 7), x +1≡0 (mod 11), x + 1 ≡ 0 (mod 13).

Therefore, we see that 7 · 11 · 13 | x + 1, so x ≡ 1000 (mod 1001).

Justin Stevens Euler’s Theorem (Lecture 7) 29 / 42


Outline

1 Primes

2 Chinese Remainder Theorem

3 Euler’s Totient Theorem


Formula
Euler’s Totient Theorem
Challenge Problems

Justin Stevens Euler’s Theorem (Lecture 7) 30 / 42


Fermat’s Omissions

Fermat occasionally omitted proofs of theorems he stated. When he


proposed Fermat’s Last Theorem, which claimed that there are no solutions
to the diophantine equation x n + y n = z n for n > 2, he famously wrote
“It is impossible to separate a cube into two cubes, or a fourth
power into two fourth powers, or in general, any power higher
than the second, into two like powers.I have discovered a truly
marvelous proof of this, which this margin is too narrow to
contain.” - Fermat in Arithmetica (1637)

Fermat’s Last Theorem was not finally proved until Andrew Wiles did so in
1993 (and later revised his proof in 1994): link to the proof.
Fermat also failed to prove his little theorem, therefore, a Swiss
mathematician by the name of Leonhard Euler published a proof in 1736.
Euler continued to present other proofs of the theorem, and eventually
generalized the problem in 1763 in his paper titled “Euler’s theorem".
Justin Stevens Euler’s Theorem (Lecture 7) 31 / 42
Euler’s Totient Function

Definition. Define φ(m) to be the number of positive integers less than or


equal to m that are relatively prime to m. For instance, φ(6) = 2.

Example. Compute φ(24).


Solution. Factorizing 24 = 23 · 31 , we find the number of integers that
share a divisor with 24 using the Principle of Inclusion-Exclusion,

|Mults of 2| + |Mults of 3| − |Mults of 6| = 24/2 + 24/3 − 24/6 = 16.

Therefore, using complimentary counting, φ(24) = 24 − 16 = 8. The


numbers relatively prime to 24 are 1, 5, 7, 11, 13, 17, 19, 23. Note that they
come in pairs that sum to 24.
In general, for n > 2, φ(n) is even since gcd(n − a, n) = gcd(a, n).

Justin Stevens Euler’s Theorem (Lecture 7) 32 / 42


Multiplicative Function Review

Definition. A function f is multiplicative if whenever gcd(a, b) = 1,

f (ab) = f (a)f (b).

Hence, if n = p1k1 p2k2 · · · prkr is the prime factorzation of a number,

f (n) = f (p1k1 )f (p2k2 ) · · · f (prkr ).

Therefore, we only evaluate multiplicative functions up to prime powers.


Also, since f (a · 1) = f (a) · f (1), we must have f (1) = 1 if f 6= 0.

Theorem. φ is a multiplicative function.

Justin Stevens Euler’s Theorem (Lecture 7) 33 / 42


Visualization for φ(24) = φ(3)φ(8).

Mod 8
0 1 2 3 4 5 6 7
0 24 9 18 3 12 21 6 15
Mod 3

1 16 1 10 19 4 13 22 7
2 8 17 2 11 20 5 14 23

Justin Stevens Euler’s Theorem (Lecture 7) 34 / 42


Proof φ is multiplicative

For coprime m and n, we define the sets Smn and S(m,n) by:

Smn = {a : 1 ≤ a ≤ mn and gcd(a, mn) = 1}


S(m,n) = {(b, c) : 0 ≤ b ≤ m − 1 and gcd(b, m) = 1;
0 ≤ c ≤ n − 1 and gcd(c, n) = 1}.

We prove there is a bijection from Smn to S(m,n) .


For an element (b, c) ∈ S(m,n) , using the Chinese Remainder Theorem,
there exists a unique solution to the linear congruences

x ≡b (mod m), x ≡c (mod n)

modulo mn, call it a. Furthermore, since b is relatively prime to m and c is


relatively prime to n, gcd(a, mn) = 1, therefore a ∈ Smn .

Justin Stevens Euler’s Theorem (Lecture 7) 35 / 42


Proof φ is multiplicative

Smn = {a : 1 ≤ a ≤ mn and gcd(a, mn) = 1}


S(m,n) = {(b, c) : 0 ≤ b ≤ m − 1 and gcd(b, m) = 1;
0 ≤ c ≤ n − 1 and gcd(c, n) = 1}.

If a ∈ Smn , we divide a by m and n, respectively, to give remainders (b, c).


By the division algorithm, 0 ≤ b ≤ m − 1 and 0 ≤ c ≤ n − 1.
Furthermore, since a is relatively prime to mn, gcd(b, m) = 1 and
gcd(c, n) = 1, so (b, c) ∈ S(m,n) and we have established our bijection.
By definition, |Smn | = φ(mn) and |S(m,n) | = φ(m)φ(n). Therefore,

φ(mn) = φ(m)φ(n).

Justin Stevens Euler’s Theorem (Lecture 7) 36 / 42


Formula for φ

For a number n, if we write it as n = p1e1 p2e2 · · · pkek , then by the


multiplicative property of φ, φ(n) = φ(p1e1 )φ(p2e2 ) · · · φ(pkek ).
For a prime pi , the number of integers between 1 and piei inclusive that are
multiples of pi is piei /pi = piei −1 . Therefore, using complimentary counting,

1
 
φ(piei ) = piei − piei −1 =p ei
1− .
p
Substituting for each prime pi , we arrive at the formula
k  k  k 
1 1
   
ei ei −1 ei
Y Y Y
φ(n) = pi − pi = pi 1 − =n 1− .
i=1 i=1
pi i=1
pi
  
1 1
For example, φ(24) = 24 1 − 2 1− 3 = 8.

Justin Stevens Euler’s Theorem (Lecture 7) 37 / 42


Euler’s Totient Theorem

Theorem. For coprime positive integers a and m, aφ(m) ≡ 1 (mod m).


Proof. Let r1 , r2 , · · · , rφ(m) be a reduced residue system modulo m. I claim
{ar1 , ar2 , · · · , arφ(m) } ≡ {r1 , r2 , · · · , rφ(m) } (mod m).
Notice that every element of the left set is relatively prime to m since
gcd(a, m) = 1. Furthermore, if two distinct elements of the reduced residue
set ri and rj are mapped to the same mod m element, then
ari ≡ arj (mod m) =⇒ ri ≡ rj (mod m).
Since the sets are equivalent, their product must be as well:
φ(m) φ(m)
Y Y
aφ(m) rj ≡ rj (mod m).
j=1 j=1

Cancelling out the product since gcd(rm , m) = 1, aφ(m) ≡ 1 (mod m).


Justin Stevens Euler’s Theorem (Lecture 7) 38 / 42
Challenge Problems

Example 5. (AIME 1983) Let an = 6n + 8n . Determine the remainder


on dividing a83 by 49.
2001
Example 6. (Canada) Find the last 3 digits of 20032002 .

Justin Stevens Euler’s Theorem (Lecture 7) 39 / 42


AIME Problem

Example. (AIME 1983) Let an = 6n + 8n . Determine the remainder on


dividing a83 by 49.

Solution. Since φ(49) = 42, 642 ≡ 1 (mod 49) and 842 ≡ 1 (mod 49):

683 + 883 ≡ 6−1 + 8−1 (mod 49)

We can compute 6−1 ≡ −8 (mod 49) and 8−1 ≡ −6 (mod 49), therefore

a83 ≡ −8 − 6 ≡ −14 ≡ 35 (mod 49).

Alternatively, by distributing out the inverses,

6−1 + 8−1 ≡ 6−1 8−1 (8 + 6) ≡ 48−1 · 14 ≡ −14 ≡ 35 (mod 49).

Justin Stevens Euler’s Theorem (Lecture 7) 40 / 42


Canada Problem

2001
Example. (Canada) Find the last 3 digits of 20032002 .

Solution. We find the value mod 8 and find the value mod 125 then use
the Chinese Remainder Theorem. First note that φ(8) = 4, therefore,
2001
20032002 ≡ 1 (mod 8)

since 4 | 20022001 . Next, we see that φ(125) = 100, therefore we desire

20022001 ≡ 22001 (mod 100).

We find this value mod 4 and mod 25. Since φ(25) = 20, we see
(
22001 ≡ 0 (mod 4)
=⇒ 22001 ≡ 52 (mod 100).
22001 ≡ 2 (mod 25)

Justin Stevens Euler’s Theorem (Lecture 7) 41 / 42


Canada Problem

2001
Example. (Canada) Find the last 3 digits of 20032002 .

We therefore have
2001 2001
20032002 ≡ 32002 ≡ 352 (mod 125).

By Euler’s Totient Theorem, 3100 ≡ 1 (mod 125), so


 2
350 ≡1 (mod 125) =⇒ 350 ≡ ±1 (mod 125).

However, 350 ≡ 925 ≡ −1 (mod 5), so 350 ≡ −1 (mod 125). Hence,


352 ≡ −9 ≡ 116 (mod 125). Combining these congruences we see
( 2001
20032002 ≡ 1 (mod 8), 2001
2001 =⇒ 20032002 ≡ 241 (mod 1000).
20032002 ≡ 116 (mod 125)

Justin Stevens Euler’s Theorem (Lecture 7) 42 / 42

You might also like