Vous êtes sur la page 1sur 176

Chinese Remainder Theorem,

Euler’s, Fermat’s
and
Wilson’s Theorems

Math 125 - Number Theory


Oreste M. Ortega, Jr.
Leyte Normal University

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Least Positive Residue
DEFINITION

Definition:

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Least Positive Residue
DEFINITION

Definition:
If m is a natural number and b is an integer,

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Least Positive Residue
DEFINITION

Definition:
If m is a natural number and b is an integer, let b = qm + r,

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Least Positive Residue
DEFINITION

Definition:
If m is a natural number and b is an integer, let b = qm + r,
where 0 ≤ r ≤ m − 1.

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Least Positive Residue
DEFINITION

Definition:
If m is a natural number and b is an integer, let b = qm + r,
where 0 ≤ r ≤ m − 1. We say that r is the least positive residue
of b (mod m).

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Least Positive Residue
DEFINITION

Definition:
If m is a natural number and b is an integer, let b = qm + r,
where 0 ≤ r ≤ m − 1. We say that r is the least positive residue
of b (mod m).

Example
Find the least positive residue when 3500 is divided by 13.

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Least Positive Residue
DEFINITION

Definition:
If m is a natural number and b is an integer, let b = qm + r,
where 0 ≤ r ≤ m − 1. We say that r is the least positive residue
of b (mod m).

Example
Find the least positive residue when 3500 is divided by 13.
Solutions:

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Least Positive Residue
DEFINITION

Definition:
If m is a natural number and b is an integer, let b = qm + r,
where 0 ≤ r ≤ m − 1. We say that r is the least positive residue
of b (mod m).

Example
Find the least positive residue when 3500 is divided by 13.
Solutions: In solving this problem,

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Least Positive Residue
DEFINITION

Definition:
If m is a natural number and b is an integer, let b = qm + r,
where 0 ≤ r ≤ m − 1. We say that r is the least positive residue
of b (mod m).

Example
Find the least positive residue when 3500 is divided by 13.
Solutions: In solving this problem, it is just like solving for n
in the linear congruence 3500 ≡ n (mod 13).

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Least Positive Residue
DEFINITION

Definition:
If m is a natural number and b is an integer, let b = qm + r,
where 0 ≤ r ≤ m − 1. We say that r is the least positive residue
of b (mod m).

Example
Find the least positive residue when 3500 is divided by 13.
Solutions: In solving this problem, it is just like solving for n
in the linear congruence 3500 ≡ n (mod 13).
Since 33 ≡ 1 (mod 13),

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Least Positive Residue
DEFINITION

Definition:
If m is a natural number and b is an integer, let b = qm + r,
where 0 ≤ r ≤ m − 1. We say that r is the least positive residue
of b (mod m).

Example
Find the least positive residue when 3500 is divided by 13.
Solutions: In solving this problem, it is just like solving for n
in the linear congruence 3500 ≡ n (mod 13).
Since 33 ≡ 1 (mod 13), then we have

3500

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Least Positive Residue
DEFINITION

Definition:
If m is a natural number and b is an integer, let b = qm + r,
where 0 ≤ r ≤ m − 1. We say that r is the least positive residue
of b (mod m).

Example
Find the least positive residue when 3500 is divided by 13.
Solutions: In solving this problem, it is just like solving for n
in the linear congruence 3500 ≡ n (mod 13).
Since 33 ≡ 1 (mod 13), then we have

3500 = (33 )166 · 32

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Least Positive Residue
DEFINITION

Definition:
If m is a natural number and b is an integer, let b = qm + r,
where 0 ≤ r ≤ m − 1. We say that r is the least positive residue
of b (mod m).

Example
Find the least positive residue when 3500 is divided by 13.
Solutions: In solving this problem, it is just like solving for n
in the linear congruence 3500 ≡ n (mod 13).
Since 33 ≡ 1 (mod 13), then we have

3500 = (33 )166 · 32 ≡ (1)166 · 9 (mod 13)

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Least Positive Residue
DEFINITION

Definition:
If m is a natural number and b is an integer, let b = qm + r,
where 0 ≤ r ≤ m − 1. We say that r is the least positive residue
of b (mod m).

Example
Find the least positive residue when 3500 is divided by 13.
Solutions: In solving this problem, it is just like solving for n
in the linear congruence 3500 ≡ n (mod 13).
Since 33 ≡ 1 (mod 13), then we have

3500 = (33 )166 · 32 ≡ (1)166 · 9 (mod 13)


3500 ≡ 9 (mod 13)

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Least Positive Residue
DEFINITION

Definition:
If m is a natural number and b is an integer, let b = qm + r,
where 0 ≤ r ≤ m − 1. We say that r is the least positive residue
of b (mod m).

Example
Find the least positive residue when 3500 is divided by 13.
Solutions: In solving this problem, it is just like solving for n
in the linear congruence 3500 ≡ n (mod 13).
Since 33 ≡ 1 (mod 13), then we have

3500 = (33 )166 · 32 ≡ (1)166 · 9 (mod 13)


3500 ≡ 9 (mod 13) thus n = 9

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Least Positive Residue
DEFINITION

Definition:
If m is a natural number and b is an integer, let b = qm + r,
where 0 ≤ r ≤ m − 1. We say that r is the least positive residue
of b (mod m).

Example
Find the least positive residue when 3500 is divided by 13.
Solutions: In solving this problem, it is just like solving for n
in the linear congruence 3500 ≡ n (mod 13).
Since 33 ≡ 1 (mod 13), then we have

3500 = (33 )166 · 32 ≡ (1)166 · 9 (mod 13)


3500 ≡ 9 (mod 13) thus n = 9

Therefore, the least positive residue is 9.


Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Least Positive Residue
EXAMPLE

Example
Find the least positive residue of 12! modulo 13.

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Least Positive Residue
EXAMPLE

Example
Find the least positive residue of 12! modulo 13.

Solutions:

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Least Positive Residue
EXAMPLE

Example
Find the least positive residue of 12! modulo 13.

Solutions:
Its another way of saying that,

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Least Positive Residue
EXAMPLE

Example
Find the least positive residue of 12! modulo 13.

Solutions:
Its another way of saying that, what is the remainder when
12! is divided by 13?

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Least Positive Residue
EXAMPLE

Example
Find the least positive residue of 12! modulo 13.

Solutions:
Its another way of saying that, what is the remainder when
12! is divided by 13? Now

12!

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Least Positive Residue
EXAMPLE

Example
Find the least positive residue of 12! modulo 13.

Solutions:
Its another way of saying that, what is the remainder when
12! is divided by 13? Now

12! = 12 · 11 · 10 · 9 · (8 · 7) · (6 · 5) · (4 · 3) · 2 · 1

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Least Positive Residue
EXAMPLE

Example
Find the least positive residue of 12! modulo 13.

Solutions:
Its another way of saying that, what is the remainder when
12! is divided by 13? Now

12! = 12 · 11 · 10 · 9 · (8 · 7) · (6 · 5) · (4 · 3) · 2 · 1
≡ (−1)(−2)[(−3)(−4)](4)(4)(−1)(2)(mod 13)

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Least Positive Residue
EXAMPLE

Example
Find the least positive residue of 12! modulo 13.

Solutions:
Its another way of saying that, what is the remainder when
12! is divided by 13? Now

12! = 12 · 11 · 10 · 9 · (8 · 7) · (6 · 5) · (4 · 3) · 2 · 1
≡ (−1)(−2)[(−3)(−4)](4)(4)(−1)(2)(mod 13)
≡ (2)(−1)(6)(−1)(mod 13)

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Least Positive Residue
EXAMPLE

Example
Find the least positive residue of 12! modulo 13.

Solutions:
Its another way of saying that, what is the remainder when
12! is divided by 13? Now

12! = 12 · 11 · 10 · 9 · (8 · 7) · (6 · 5) · (4 · 3) · 2 · 1
≡ (−1)(−2)[(−3)(−4)](4)(4)(−1)(2)(mod 13)
≡ (2)(−1)(6)(−1)(mod 13)
≡ 12(mod 13)

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
System of Linear Congruences
CHINESE REMAINDER THEOREM

Theorem: Chinese Remainder Theorem (CRT)

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
System of Linear Congruences
CHINESE REMAINDER THEOREM

Theorem: Chinese Remainder Theorem (CRT)


Let m1 , m2 , . . . , mr (r ≥ 2) be natural numbers

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
System of Linear Congruences
CHINESE REMAINDER THEOREM

Theorem: Chinese Remainder Theorem (CRT)


Let m1 , m2 , . . . , mr (r ≥ 2) be natural numbers that are
pairwise relatively prime

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
System of Linear Congruences
CHINESE REMAINDER THEOREM

Theorem: Chinese Remainder Theorem (CRT)


Let m1 , m2 , . . . , mr (r ≥ 2) be natural numbers that are
pairwise relatively prime and whose product is M.

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
System of Linear Congruences
CHINESE REMAINDER THEOREM

Theorem: Chinese Remainder Theorem (CRT)


Let m1 , m2 , . . . , mr (r ≥ 2) be natural numbers that are
pairwise relatively prime and whose product is M. Then the
system of r simultaneous linear congruences

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
System of Linear Congruences
CHINESE REMAINDER THEOREM

Theorem: Chinese Remainder Theorem (CRT)


Let m1 , m2 , . . . , mr (r ≥ 2) be natural numbers that are
pairwise relatively prime and whose product is M. Then the
system of r simultaneous linear congruences

x ≡ a1 (mod m1 )

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
System of Linear Congruences
CHINESE REMAINDER THEOREM

Theorem: Chinese Remainder Theorem (CRT)


Let m1 , m2 , . . . , mr (r ≥ 2) be natural numbers that are
pairwise relatively prime and whose product is M. Then the
system of r simultaneous linear congruences

x ≡ a1 (mod m1 )
x ≡ a2 (mod m2 )

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
System of Linear Congruences
CHINESE REMAINDER THEOREM

Theorem: Chinese Remainder Theorem (CRT)


Let m1 , m2 , . . . , mr (r ≥ 2) be natural numbers that are
pairwise relatively prime and whose product is M. Then the
system of r simultaneous linear congruences

x ≡ a1 (mod m1 )
x ≡ a2 (mod m2 )
x ≡ a3 (mod m3 )

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
System of Linear Congruences
CHINESE REMAINDER THEOREM

Theorem: Chinese Remainder Theorem (CRT)


Let m1 , m2 , . . . , mr (r ≥ 2) be natural numbers that are
pairwise relatively prime and whose product is M. Then the
system of r simultaneous linear congruences

x ≡ a1 (mod m1 )
x ≡ a2 (mod m2 )
x ≡ a3 (mod m3 )
..
.
x ≡ ar (mod mr )

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
System of Linear Congruences
CHINESE REMAINDER THEOREM

Theorem: Chinese Remainder Theorem (CRT)


Let m1 , m2 , . . . , mr (r ≥ 2) be natural numbers that are
pairwise relatively prime and whose product is M. Then the
system of r simultaneous linear congruences

x ≡ a1 (mod m1 )
x ≡ a2 (mod m2 )
x ≡ a3 (mod m3 )
..
.
x ≡ ar (mod mr )

has a unique solution modulo M = m1 · m2 · · · mr

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
System of Linear Congruences
CHINESE REMAINDER THEOREM

Theorem: Chinese Remainder Theorem (CRT)


Let m1 , m2 , . . . , mr (r ≥ 2) be natural numbers that are
pairwise relatively prime and whose product is M. Then the
system of r simultaneous linear congruences

x ≡ a1 (mod m1 )
x ≡ a2 (mod m2 )
x ≡ a3 (mod m3 )
..
.
x ≡ ar (mod mr )

has a unique solution modulo M = m1 · m2 · · · mr and is given


by

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
System of Linear Congruences
CHINESE REMAINDER THEOREM

Theorem: Chinese Remainder Theorem (CRT)


Let m1 , m2 , . . . , mr (r ≥ 2) be natural numbers that are
pairwise relatively prime and whose product is M. Then the
system of r simultaneous linear congruences

x ≡ a1 (mod m1 )
x ≡ a2 (mod m2 )
x ≡ a3 (mod m3 )
..
.
x ≡ ar (mod mr )

has a unique solution modulo M = m1 · m2 · · · mr and is given


by
x ≡ a1 M1 x1 + a2 M2 x2 + · · · + ar Mr xr (mod M)

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
System of Linear Congruences
CHINESE REMAINDER THEOREM

Theorem: Chinese Remainder Theorem (CRT)


Let m1 , m2 , . . . , mr (r ≥ 2) be natural numbers that are
pairwise relatively prime and whose product is M. Then the
system of r simultaneous linear congruences

x ≡ a1 (mod m1 )
x ≡ a2 (mod m2 )
x ≡ a3 (mod m3 )
..
.
x ≡ ar (mod mr )

has a unique solution modulo M = m1 · m2 · · · mr and is given


by
x ≡ a1 M1 x1 + a2 M2 x2 + · · · + ar Mr xr (mod M)
where Mi xi ≡ 1(mod mi )
Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
System of Linear Congruences
CHINESE REMAINDER THEOREM

Theorem: Chinese Remainder Theorem (CRT)


Let m1 , m2 , . . . , mr (r ≥ 2) be natural numbers that are
pairwise relatively prime and whose product is M. Then the
system of r simultaneous linear congruences

x ≡ a1 (mod m1 )
x ≡ a2 (mod m2 )
x ≡ a3 (mod m3 )
..
.
x ≡ ar (mod mr )

has a unique solution modulo M = m1 · m2 · · · mr and is given


by
x ≡ a1 M1 x1 + a2 M2 x2 + · · · + ar Mr xr (mod M)
M
where Mi xi ≡ 1(mod mi ) and Mi = mi .
Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Chinese Remainder Theorem
EXAMPLE

Example
Find a number that leaves a remainder of 1 when divided
by 3,

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Chinese Remainder Theorem
EXAMPLE

Example
Find a number that leaves a remainder of 1 when divided
by 3, a remainder of 2 when divided by 5

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Chinese Remainder Theorem
EXAMPLE

Example
Find a number that leaves a remainder of 1 when divided
by 3, a remainder of 2 when divided by 5 and a reminder of 3
when divided by 7.

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Chinese Remainder Theorem
EXAMPLE

Example
Find a number that leaves a remainder of 1 when divided
by 3, a remainder of 2 when divided by 5 and a reminder of 3
when divided by 7.

Solutions:
This problem leads us to the system of linear congruences

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Chinese Remainder Theorem
EXAMPLE

Example
Find a number that leaves a remainder of 1 when divided
by 3, a remainder of 2 when divided by 5 and a reminder of 3
when divided by 7.

Solutions:
This problem leads us to the system of linear congruences

x ≡ 1(mod 3)

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Chinese Remainder Theorem
EXAMPLE

Example
Find a number that leaves a remainder of 1 when divided
by 3, a remainder of 2 when divided by 5 and a reminder of 3
when divided by 7.

Solutions:
This problem leads us to the system of linear congruences

x ≡ 1(mod 3)
x ≡ 2(mod 5)

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Chinese Remainder Theorem
EXAMPLE

Example
Find a number that leaves a remainder of 1 when divided
by 3, a remainder of 2 when divided by 5 and a reminder of 3
when divided by 7.

Solutions:
This problem leads us to the system of linear congruences

x ≡ 1(mod 3)
x ≡ 2(mod 5)
x ≡ 3(mod 7)

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Chinese Remainder Theorem
EXAMPLE

Example
Find a number that leaves a remainder of 1 when divided
by 3, a remainder of 2 when divided by 5 and a reminder of 3
when divided by 7.

Solutions:
This problem leads us to the system of linear congruences

x ≡ 1(mod 3)
x ≡ 2(mod 5)
x ≡ 3(mod 7)

This implies that a1 = 1, a2 = 2, a3 = 3,

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Chinese Remainder Theorem
EXAMPLE

Example
Find a number that leaves a remainder of 1 when divided
by 3, a remainder of 2 when divided by 5 and a reminder of 3
when divided by 7.

Solutions:
This problem leads us to the system of linear congruences

x ≡ 1(mod 3)
x ≡ 2(mod 5)
x ≡ 3(mod 7)

This implies that a1 = 1, a2 = 2, a3 = 3, m1 = 3, m2 = 5 and


m3 = 7.

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Chinese Remainder Theorem
EXAMPLE

Example
Find a number that leaves a remainder of 1 when divided
by 3, a remainder of 2 when divided by 5 and a reminder of 3
when divided by 7.

Solutions:
This problem leads us to the system of linear congruences

x ≡ 1(mod 3)
x ≡ 2(mod 5)
x ≡ 3(mod 7)

This implies that a1 = 1, a2 = 2, a3 = 3, m1 = 3, m2 = 5 and


m3 = 7. Computing for M yields M = (3)(5)(7) = 105,

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Chinese Remainder Theorem
EXAMPLE

Example
Find a number that leaves a remainder of 1 when divided
by 3, a remainder of 2 when divided by 5 and a reminder of 3
when divided by 7.

Solutions:
This problem leads us to the system of linear congruences

x ≡ 1(mod 3)
x ≡ 2(mod 5)
x ≡ 3(mod 7)

This implies that a1 = 1, a2 = 2, a3 = 3, m1 = 3, m2 = 5 and


m3 = 7. Computing for M yields M = (3)(5)(7) = 105, hence
M1 = 105
3 = 35,

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Chinese Remainder Theorem
EXAMPLE

Example
Find a number that leaves a remainder of 1 when divided
by 3, a remainder of 2 when divided by 5 and a reminder of 3
when divided by 7.

Solutions:
This problem leads us to the system of linear congruences

x ≡ 1(mod 3)
x ≡ 2(mod 5)
x ≡ 3(mod 7)

This implies that a1 = 1, a2 = 2, a3 = 3, m1 = 3, m2 = 5 and


m3 = 7. Computing for M yields M = (3)(5)(7) = 105, hence
M1 = 105 105
3 = 35, M2 = 5 = 21

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Chinese Remainder Theorem
EXAMPLE

Example
Find a number that leaves a remainder of 1 when divided
by 3, a remainder of 2 when divided by 5 and a reminder of 3
when divided by 7.

Solutions:
This problem leads us to the system of linear congruences

x ≡ 1(mod 3)
x ≡ 2(mod 5)
x ≡ 3(mod 7)

This implies that a1 = 1, a2 = 2, a3 = 3, m1 = 3, m2 = 5 and


m3 = 7. Computing for M yields M = (3)(5)(7) = 105, hence
M1 = 105 105
3 = 35, M2 = 5 = 21 and M3 = 7 = 15.
105

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Chinese Remainder Theorem
EXAMPLE

To solve for x1 , x2 and x3 ,

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Chinese Remainder Theorem
EXAMPLE

To solve for x1 , x2 and x3 , we have


M1 x1 ≡ 1(mod 3)

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Chinese Remainder Theorem
EXAMPLE

To solve for x1 , x2 and x3 , we have


M1 x1 ≡ 1(mod 3) ⇒ 35x1 ≡ 1(mod 3)

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Chinese Remainder Theorem
EXAMPLE

To solve for x1 , x2 and x3 , we have


M1 x1 ≡ 1(mod 3) ⇒ 35x1 ≡ 1(mod 3)
⇒ 2x1 ≡ 1(mod 3)

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Chinese Remainder Theorem
EXAMPLE

To solve for x1 , x2 and x3 , we have


M1 x1 ≡ 1(mod 3) ⇒ 35x1 ≡ 1(mod 3)
⇒ 2x1 ≡ 1(mod 3)
⇒ x1 ≡ 2(mod 3)

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Chinese Remainder Theorem
EXAMPLE

To solve for x1 , x2 and x3 , we have


M1 x1 ≡ 1(mod 3) ⇒ 35x1 ≡ 1(mod 3)
⇒ 2x1 ≡ 1(mod 3)
⇒ x1 ≡ 2(mod 3)

M2 x2 ≡ 1(mod 5)

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Chinese Remainder Theorem
EXAMPLE

To solve for x1 , x2 and x3 , we have


M1 x1 ≡ 1(mod 3) ⇒ 35x1 ≡ 1(mod 3)
⇒ 2x1 ≡ 1(mod 3)
⇒ x1 ≡ 2(mod 3)

M2 x2 ≡ 1(mod 5) ⇒ 21x2 ≡ 1(mod 5)

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Chinese Remainder Theorem
EXAMPLE

To solve for x1 , x2 and x3 , we have


M1 x1 ≡ 1(mod 3) ⇒ 35x1 ≡ 1(mod 3)
⇒ 2x1 ≡ 1(mod 3)
⇒ x1 ≡ 2(mod 3)

M2 x2 ≡ 1(mod 5) ⇒ 21x2 ≡ 1(mod 5)


⇒ x2 ≡ 1(mod 5)

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Chinese Remainder Theorem
EXAMPLE

To solve for x1 , x2 and x3 , we have


M1 x1 ≡ 1(mod 3) ⇒ 35x1 ≡ 1(mod 3)
⇒ 2x1 ≡ 1(mod 3)
⇒ x1 ≡ 2(mod 3)

M2 x2 ≡ 1(mod 5) ⇒ 21x2 ≡ 1(mod 5)


⇒ x2 ≡ 1(mod 5)

M3 x3 ≡ 1(mod 7)

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Chinese Remainder Theorem
EXAMPLE

To solve for x1 , x2 and x3 , we have


M1 x1 ≡ 1(mod 3) ⇒ 35x1 ≡ 1(mod 3)
⇒ 2x1 ≡ 1(mod 3)
⇒ x1 ≡ 2(mod 3)

M2 x2 ≡ 1(mod 5) ⇒ 21x2 ≡ 1(mod 5)


⇒ x2 ≡ 1(mod 5)

M3 x3 ≡ 1(mod 7) ⇒ 15x3 ≡ 1(mod 7)

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Chinese Remainder Theorem
EXAMPLE

To solve for x1 , x2 and x3 , we have


M1 x1 ≡ 1(mod 3) ⇒ 35x1 ≡ 1(mod 3)
⇒ 2x1 ≡ 1(mod 3)
⇒ x1 ≡ 2(mod 3)

M2 x2 ≡ 1(mod 5) ⇒ 21x2 ≡ 1(mod 5)


⇒ x2 ≡ 1(mod 5)

M3 x3 ≡ 1(mod 7) ⇒ 15x3 ≡ 1(mod 7)


⇒ 1x3 ≡ 1(mod 7)

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Chinese Remainder Theorem
EXAMPLE

To solve for x1 , x2 and x3 , we have


M1 x1 ≡ 1(mod 3) ⇒ 35x1 ≡ 1(mod 3)
⇒ 2x1 ≡ 1(mod 3)
⇒ x1 ≡ 2(mod 3)

M2 x2 ≡ 1(mod 5) ⇒ 21x2 ≡ 1(mod 5)


⇒ x2 ≡ 1(mod 5)

M3 x3 ≡ 1(mod 7) ⇒ 15x3 ≡ 1(mod 7)


⇒ 1x3 ≡ 1(mod 7)
⇒ x3 ≡ 1(mod 7)

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Chinese Remainder Theorem
EXAMPLE

Therefore, the solution is

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Chinese Remainder Theorem
EXAMPLE

Therefore, the solution is

x ≡ (1)(35)(2)

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Chinese Remainder Theorem
EXAMPLE

Therefore, the solution is

x ≡ (1)(35)(2) + (2)(21)(1)

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Chinese Remainder Theorem
EXAMPLE

Therefore, the solution is

x ≡ (1)(35)(2) + (2)(21)(1) + (3)(15)(1)(mod 105)

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Chinese Remainder Theorem
EXAMPLE

Therefore, the solution is

x ≡ (1)(35)(2) + (2)(21)(1) + (3)(15)(1)(mod 105)


≡ 157(mod 105)

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Chinese Remainder Theorem
EXAMPLE

Therefore, the solution is

x ≡ (1)(35)(2) + (2)(21)(1) + (3)(15)(1)(mod 105)


≡ 157(mod 105)
≡ 52(mod 105)

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Chinese Remainder Theorem
EXAMPLE

Therefore, the solution is

x ≡ (1)(35)(2) + (2)(21)(1) + (3)(15)(1)(mod 105)


≡ 157(mod 105)
≡ 52(mod 105)

We can check that x satisfies the system of linear congruences

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Chinese Remainder Theorem
EXAMPLE

Therefore, the solution is

x ≡ (1)(35)(2) + (2)(21)(1) + (3)(15)(1)(mod 105)


≡ 157(mod 105)
≡ 52(mod 105)

We can check that x satisfies the system of linear congruences


whenever x ≡ 52(mod 105)

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Chinese Remainder Theorem
EXAMPLE

Therefore, the solution is

x ≡ (1)(35)(2) + (2)(21)(1) + (3)(15)(1)(mod 105)


≡ 157(mod 105)
≡ 52(mod 105)

We can check that x satisfies the system of linear congruences


whenever x ≡ 52(mod 105) by noting that 52 ≡ 1(mod 3),

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Chinese Remainder Theorem
EXAMPLE

Therefore, the solution is

x ≡ (1)(35)(2) + (2)(21)(1) + (3)(15)(1)(mod 105)


≡ 157(mod 105)
≡ 52(mod 105)

We can check that x satisfies the system of linear congruences


whenever x ≡ 52(mod 105) by noting that 52 ≡ 1(mod 3),
52 ≡ 2(mod 5)

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Chinese Remainder Theorem
EXAMPLE

Therefore, the solution is

x ≡ (1)(35)(2) + (2)(21)(1) + (3)(15)(1)(mod 105)


≡ 157(mod 105)
≡ 52(mod 105)

We can check that x satisfies the system of linear congruences


whenever x ≡ 52(mod 105) by noting that 52 ≡ 1(mod 3),
52 ≡ 2(mod 5) and 52 ≡ 3(mod 7).

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Euler’s Phi Function
DEFINITION

Let m ∈ N.

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Euler’s Phi Function
DEFINITION

Let m ∈ N. The number φ(m),

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Euler’s Phi Function
DEFINITION

Let m ∈ N. The number φ(m), known as Euler’s phi


function,

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Euler’s Phi Function
DEFINITION

Let m ∈ N. The number φ(m), known as Euler’s phi


function, is the number of positive integers lass than or equal to
m that are relatively to m.

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Euler’s Phi Function
DEFINITION

Let m ∈ N. The number φ(m), known as Euler’s phi


function, is the number of positive integers lass than or equal to
m that are relatively to m.

Example
Consider m = 12.

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Euler’s Phi Function
DEFINITION

Let m ∈ N. The number φ(m), known as Euler’s phi


function, is the number of positive integers lass than or equal to
m that are relatively to m.

Example
Consider m = 12. The integers 1, 5, 7 and 11

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Euler’s Phi Function
DEFINITION

Let m ∈ N. The number φ(m), known as Euler’s phi


function, is the number of positive integers lass than or equal to
m that are relatively to m.

Example
Consider m = 12. The integers 1, 5, 7 and 11 are the only
four positive integers less than or equal to 12 that are relatively
to 12.

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Euler’s Phi Function
DEFINITION

Let m ∈ N. The number φ(m), known as Euler’s phi


function, is the number of positive integers lass than or equal to
m that are relatively to m.

Example
Consider m = 12. The integers 1, 5, 7 and 11 are the only
four positive integers less than or equal to 12 that are relatively
to 12. Thus φ(12) = 4.

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Euler’s Phi Function
DEFINITION

Let m ∈ N. The number φ(m), known as Euler’s phi


function, is the number of positive integers lass than or equal to
m that are relatively to m.

Example
Consider m = 12. The integers 1, 5, 7 and 11 are the only
four positive integers less than or equal to 12 that are relatively
to 12. Thus φ(12) = 4.
One can verify that φ(1) = 1,

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Euler’s Phi Function
DEFINITION

Let m ∈ N. The number φ(m), known as Euler’s phi


function, is the number of positive integers lass than or equal to
m that are relatively to m.

Example
Consider m = 12. The integers 1, 5, 7 and 11 are the only
four positive integers less than or equal to 12 that are relatively
to 12. Thus φ(12) = 4.
One can verify that φ(1) = 1, φ(2) = 1,

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Euler’s Phi Function
DEFINITION

Let m ∈ N. The number φ(m), known as Euler’s phi


function, is the number of positive integers lass than or equal to
m that are relatively to m.

Example
Consider m = 12. The integers 1, 5, 7 and 11 are the only
four positive integers less than or equal to 12 that are relatively
to 12. Thus φ(12) = 4.
One can verify that φ(1) = 1, φ(2) = 1, φ(3) = 2,

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Euler’s Phi Function
DEFINITION

Let m ∈ N. The number φ(m), known as Euler’s phi


function, is the number of positive integers lass than or equal to
m that are relatively to m.

Example
Consider m = 12. The integers 1, 5, 7 and 11 are the only
four positive integers less than or equal to 12 that are relatively
to 12. Thus φ(12) = 4.
One can verify that φ(1) = 1, φ(2) = 1, φ(3) = 2, φ(4) = 2,

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Euler’s Phi Function
DEFINITION

Let m ∈ N. The number φ(m), known as Euler’s phi


function, is the number of positive integers lass than or equal to
m that are relatively to m.

Example
Consider m = 12. The integers 1, 5, 7 and 11 are the only
four positive integers less than or equal to 12 that are relatively
to 12. Thus φ(12) = 4.
One can verify that φ(1) = 1, φ(2) = 1, φ(3) = 2, φ(4) = 2,
φ(4) = 4,

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Euler’s Phi Function
DEFINITION

Let m ∈ N. The number φ(m), known as Euler’s phi


function, is the number of positive integers lass than or equal to
m that are relatively to m.

Example
Consider m = 12. The integers 1, 5, 7 and 11 are the only
four positive integers less than or equal to 12 that are relatively
to 12. Thus φ(12) = 4.
One can verify that φ(1) = 1, φ(2) = 1, φ(3) = 2, φ(4) = 2,
φ(4) = 4, φ(6) = 2,

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Euler’s Phi Function
DEFINITION

Let m ∈ N. The number φ(m), known as Euler’s phi


function, is the number of positive integers lass than or equal to
m that are relatively to m.

Example
Consider m = 12. The integers 1, 5, 7 and 11 are the only
four positive integers less than or equal to 12 that are relatively
to 12. Thus φ(12) = 4.
One can verify that φ(1) = 1, φ(2) = 1, φ(3) = 2, φ(4) = 2,
φ(4) = 4, φ(6) = 2, φ(7) = 6,

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Euler’s Phi Function
DEFINITION

Let m ∈ N. The number φ(m), known as Euler’s phi


function, is the number of positive integers lass than or equal to
m that are relatively to m.

Example
Consider m = 12. The integers 1, 5, 7 and 11 are the only
four positive integers less than or equal to 12 that are relatively
to 12. Thus φ(12) = 4.
One can verify that φ(1) = 1, φ(2) = 1, φ(3) = 2, φ(4) = 2,
φ(4) = 4, φ(6) = 2, φ(7) = 6, φ(8) = 4,

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Euler’s Phi Function
DEFINITION

Let m ∈ N. The number φ(m), known as Euler’s phi


function, is the number of positive integers lass than or equal to
m that are relatively to m.

Example
Consider m = 12. The integers 1, 5, 7 and 11 are the only
four positive integers less than or equal to 12 that are relatively
to 12. Thus φ(12) = 4.
One can verify that φ(1) = 1, φ(2) = 1, φ(3) = 2, φ(4) = 2,
φ(4) = 4, φ(6) = 2, φ(7) = 6, φ(8) = 4, φ(9) = 6,

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Euler’s Phi Function
DEFINITION

Let m ∈ N. The number φ(m), known as Euler’s phi


function, is the number of positive integers lass than or equal to
m that are relatively to m.

Example
Consider m = 12. The integers 1, 5, 7 and 11 are the only
four positive integers less than or equal to 12 that are relatively
to 12. Thus φ(12) = 4.
One can verify that φ(1) = 1, φ(2) = 1, φ(3) = 2, φ(4) = 2,
φ(4) = 4, φ(6) = 2, φ(7) = 6, φ(8) = 4, φ(9) = 6, φ(10) = 4,

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Euler’s Phi Function
DEFINITION

Let m ∈ N. The number φ(m), known as Euler’s phi


function, is the number of positive integers lass than or equal to
m that are relatively to m.

Example
Consider m = 12. The integers 1, 5, 7 and 11 are the only
four positive integers less than or equal to 12 that are relatively
to 12. Thus φ(12) = 4.
One can verify that φ(1) = 1, φ(2) = 1, φ(3) = 2, φ(4) = 2,
φ(4) = 4, φ(6) = 2, φ(7) = 6, φ(8) = 4, φ(9) = 6, φ(10) = 4, and
φ(11) = 10.

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Congruences
EULER’S THEOREM

Theorem: Euler’s Theorem

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Congruences
EULER’S THEOREM

Theorem: Euler’s Theorem


Let a ∈ Z

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Congruences
EULER’S THEOREM

Theorem: Euler’s Theorem


Let a ∈ Z and m ∈ N

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Congruences
EULER’S THEOREM

Theorem: Euler’s Theorem


Let a ∈ Z and m ∈ N such that gcd(a, m) = 1.

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Congruences
EULER’S THEOREM

Theorem: Euler’s Theorem


Let a ∈ Z and m ∈ N such that gcd(a, m) = 1. Then

aφ(m) ≡ 1(mod m).

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Congruences
EULER’S THEOREM

Theorem: Euler’s Theorem


Let a ∈ Z and m ∈ N such that gcd(a, m) = 1. Then

aφ(m) ≡ 1(mod m).

Example
What is the remainder when 1698 is divided by 21?

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Congruences
EULER’S THEOREM

Theorem: Euler’s Theorem


Let a ∈ Z and m ∈ N such that gcd(a, m) = 1. Then

aφ(m) ≡ 1(mod m).

Example
What is the remainder when 1698 is divided by 21?
Solutions:

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Congruences
EULER’S THEOREM

Theorem: Euler’s Theorem


Let a ∈ Z and m ∈ N such that gcd(a, m) = 1. Then

aφ(m) ≡ 1(mod m).

Example
What is the remainder when 1698 is divided by 21?
Solutions:
Since φ(21) = 12

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Congruences
EULER’S THEOREM

Theorem: Euler’s Theorem


Let a ∈ Z and m ∈ N such that gcd(a, m) = 1. Then

aφ(m) ≡ 1(mod m).

Example
What is the remainder when 1698 is divided by 21?
Solutions:
Since φ(21) = 12 and gcd(16, 21) = 1,

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Congruences
EULER’S THEOREM

Theorem: Euler’s Theorem


Let a ∈ Z and m ∈ N such that gcd(a, m) = 1. Then

aφ(m) ≡ 1(mod m).

Example
What is the remainder when 1698 is divided by 21?
Solutions:
Since φ(21) = 12 and gcd(16, 21) = 1, by Euler’s theorem,

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Congruences
EULER’S THEOREM

Theorem: Euler’s Theorem


Let a ∈ Z and m ∈ N such that gcd(a, m) = 1. Then

aφ(m) ≡ 1(mod m).

Example
What is the remainder when 1698 is divided by 21?
Solutions:
Since φ(21) = 12 and gcd(16, 21) = 1, by Euler’s theorem,
we have 1612 ≡ 1(mod 21).

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Congruences
EULER’S THEOREM

Theorem: Euler’s Theorem


Let a ∈ Z and m ∈ N such that gcd(a, m) = 1. Then

aφ(m) ≡ 1(mod m).

Example
What is the remainder when 1698 is divided by 21?
Solutions:
Since φ(21) = 12 and gcd(16, 21) = 1, by Euler’s theorem,
we have 1612 ≡ 1(mod 21). Thus,
1698

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Congruences
EULER’S THEOREM

Theorem: Euler’s Theorem


Let a ∈ Z and m ∈ N such that gcd(a, m) = 1. Then

aφ(m) ≡ 1(mod m).

Example
What is the remainder when 1698 is divided by 21?
Solutions:
Since φ(21) = 12 and gcd(16, 21) = 1, by Euler’s theorem,
we have 1612 ≡ 1(mod 21). Thus,
1698 = (1612 )8 · 162

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Congruences
EULER’S THEOREM

Theorem: Euler’s Theorem


Let a ∈ Z and m ∈ N such that gcd(a, m) = 1. Then

aφ(m) ≡ 1(mod m).

Example
What is the remainder when 1698 is divided by 21?
Solutions:
Since φ(21) = 12 and gcd(16, 21) = 1, by Euler’s theorem,
we have 1612 ≡ 1(mod 21). Thus,
1698 = (1612 )8 · 162 ≡ 1 · 256

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Congruences
EULER’S THEOREM

Theorem: Euler’s Theorem


Let a ∈ Z and m ∈ N such that gcd(a, m) = 1. Then

aφ(m) ≡ 1(mod m).

Example
What is the remainder when 1698 is divided by 21?
Solutions:
Since φ(21) = 12 and gcd(16, 21) = 1, by Euler’s theorem,
we have 1612 ≡ 1(mod 21). Thus,
1698 = (1612 )8 · 162 ≡ 1 · 256 ≡ 4(mod 21)

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Congruences
EULER’S THEOREM

Theorem: Euler’s Theorem


Let a ∈ Z and m ∈ N such that gcd(a, m) = 1. Then

aφ(m) ≡ 1(mod m).

Example
What is the remainder when 1698 is divided by 21?
Solutions:
Since φ(21) = 12 and gcd(16, 21) = 1, by Euler’s theorem,
we have 1612 ≡ 1(mod 21). Thus,
1698 = (1612 )8 · 162 ≡ 1 · 256 ≡ 4(mod 21)
Hence, the remainder is 4 when 1698 is divided by 21.
Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Congruences
FERMAT’S LITTLE THEOREM

In case when m = p is prime,

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Congruences
FERMAT’S LITTLE THEOREM

In case when m = p is prime, φ(m) = p − 1,

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Congruences
FERMAT’S LITTLE THEOREM

In case when m = p is prime, φ(m) = p − 1, we have the


following theorem.

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Congruences
FERMAT’S LITTLE THEOREM

In case when m = p is prime, φ(m) = p − 1, we have the


following theorem.

Theorem: Fermat’s Little Theorem

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Congruences
FERMAT’S LITTLE THEOREM

In case when m = p is prime, φ(m) = p − 1, we have the


following theorem.

Theorem: Fermat’s Little Theorem


Let p be a prime

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Congruences
FERMAT’S LITTLE THEOREM

In case when m = p is prime, φ(m) = p − 1, we have the


following theorem.

Theorem: Fermat’s Little Theorem


Let p be a prime and a ∈ Z.

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Congruences
FERMAT’S LITTLE THEOREM

In case when m = p is prime, φ(m) = p − 1, we have the


following theorem.

Theorem: Fermat’s Little Theorem


Let p be a prime and a ∈ Z. If gcd(a, p) = 1,

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Congruences
FERMAT’S LITTLE THEOREM

In case when m = p is prime, φ(m) = p − 1, we have the


following theorem.

Theorem: Fermat’s Little Theorem


Let p be a prime and a ∈ Z. If gcd(a, p) = 1, then
ap−1 ≡ 1(mod p).

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Congruences
FERMAT’S LITTLE THEOREM

In case when m = p is prime, φ(m) = p − 1, we have the


following theorem.

Theorem: Fermat’s Little Theorem


Let p be a prime and a ∈ Z. If gcd(a, p) = 1, then
ap−1 ≡ 1(mod p).

Corollary:

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Congruences
FERMAT’S LITTLE THEOREM

In case when m = p is prime, φ(m) = p − 1, we have the


following theorem.

Theorem: Fermat’s Little Theorem


Let p be a prime and a ∈ Z. If gcd(a, p) = 1, then
ap−1 ≡ 1(mod p).

Corollary:
Let p be prime and a ∈ Z.

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Congruences
FERMAT’S LITTLE THEOREM

In case when m = p is prime, φ(m) = p − 1, we have the


following theorem.

Theorem: Fermat’s Little Theorem


Let p be a prime and a ∈ Z. If gcd(a, p) = 1, then
ap−1 ≡ 1(mod p).

Corollary:
Let p be prime and a ∈ Z. Then ap ≡ a(mod p).

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Congruences
FERMAT’S LITTLE THEOREM

In case when m = p is prime, φ(m) = p − 1, we have the


following theorem.

Theorem: Fermat’s Little Theorem


Let p be a prime and a ∈ Z. If gcd(a, p) = 1, then
ap−1 ≡ 1(mod p).

Corollary:
Let p be prime and a ∈ Z. Then ap ≡ a(mod p).

Example
What is the remainder when 101370 is divided by 37?

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Fermat’s Little Theorem
EXAMPLE

Solutions:

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Fermat’s Little Theorem
EXAMPLE

Solutions:
Note that 101370 = (1036 )38 · 102

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Fermat’s Little Theorem
EXAMPLE

Solutions:
Note that 101370 = (1036 )38 · 102 and, by Fermat’s Little
Theorem,

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Fermat’s Little Theorem
EXAMPLE

Solutions:
Note that 101370 = (1036 )38 · 102 and, by Fermat’s Little
Theorem, 1036 ≡ 1(mod 37)

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Fermat’s Little Theorem
EXAMPLE

Solutions:
Note that 101370 = (1036 )38 · 102 and, by Fermat’s Little
Theorem, 1036 ≡ 1(mod 37) since (10, 37) = 1.

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Fermat’s Little Theorem
EXAMPLE

Solutions:
Note that 101370 = (1036 )38 · 102 and, by Fermat’s Little
Theorem, 1036 ≡ 1(mod 37) since (10, 37) = 1. Thus, we have

101370

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Fermat’s Little Theorem
EXAMPLE

Solutions:
Note that 101370 = (1036 )38 · 102 and, by Fermat’s Little
Theorem, 1036 ≡ 1(mod 37) since (10, 37) = 1. Thus, we have

101370 = (1036 )38 · 102

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Fermat’s Little Theorem
EXAMPLE

Solutions:
Note that 101370 = (1036 )38 · 102 and, by Fermat’s Little
Theorem, 1036 ≡ 1(mod 37) since (10, 37) = 1. Thus, we have

101370 = (1036 )38 · 102


≡ (1)3 8 · 100(mod 37)

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Fermat’s Little Theorem
EXAMPLE

Solutions:
Note that 101370 = (1036 )38 · 102 and, by Fermat’s Little
Theorem, 1036 ≡ 1(mod 37) since (10, 37) = 1. Thus, we have

101370 = (1036 )38 · 102


≡ (1)3 8 · 100(mod 37)
≡ 26(mod 37)

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Fermat’s Little Theorem
EXAMPLE

Solutions:
Note that 101370 = (1036 )38 · 102 and, by Fermat’s Little
Theorem, 1036 ≡ 1(mod 37) since (10, 37) = 1. Thus, we have

101370 = (1036 )38 · 102


≡ (1)3 8 · 100(mod 37)
≡ 26(mod 37)

Thus, the remainder when 101370 is divided by 37 is 26.

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Fermat’s Little Theorem
EXAMPLE

Example
For any n ∈ N,

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Fermat’s Little Theorem
EXAMPLE

Example
For any n ∈ N, show that n5 and n always have the same
units digit.

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Fermat’s Little Theorem
EXAMPLE

Example
For any n ∈ N, show that n5 and n always have the same
units digit.

Solutions:

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Fermat’s Little Theorem
EXAMPLE

Example
For any n ∈ N, show that n5 and n always have the same
units digit.

Solutions:
We prove the assertion by showing that 10 | (n5 − n).

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Fermat’s Little Theorem
EXAMPLE

Example
For any n ∈ N, show that n5 and n always have the same
units digit.

Solutions:
We prove the assertion by showing that 10 | (n5 − n). That
is, we will show that

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Fermat’s Little Theorem
EXAMPLE

Example
For any n ∈ N, show that n5 and n always have the same
units digit.

Solutions:
We prove the assertion by showing that 10 | (n5 − n). That
is, we will show that 5 | (n5 − n)

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Fermat’s Little Theorem
EXAMPLE

Example
For any n ∈ N, show that n5 and n always have the same
units digit.

Solutions:
We prove the assertion by showing that 10 | (n5 − n). That
is, we will show that 5 | (n5 − n) and 2 | (n5 − n).

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Fermat’s Little Theorem
EXAMPLE

Example
For any n ∈ N, show that n5 and n always have the same
units digit.

Solutions:
We prove the assertion by showing that 10 | (n5 − n). That
is, we will show that 5 | (n5 − n) and 2 | (n5 − n). By the
Corollary above,

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Fermat’s Little Theorem
EXAMPLE

Example
For any n ∈ N, show that n5 and n always have the same
units digit.

Solutions:
We prove the assertion by showing that 10 | (n5 − n). That
is, we will show that 5 | (n5 − n) and 2 | (n5 − n). By the
Corollary above, n5 ≡ n(mod 5),

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Fermat’s Little Theorem
EXAMPLE

Example
For any n ∈ N, show that n5 and n always have the same
units digit.

Solutions:
We prove the assertion by showing that 10 | (n5 − n). That
is, we will show that 5 | (n5 − n) and 2 | (n5 − n). By the
Corollary above, n5 ≡ n(mod 5), that is, 5 | (n5 − n).

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Fermat’s Little Theorem
EXAMPLE

Example
For any n ∈ N, show that n5 and n always have the same
units digit.

Solutions:
We prove the assertion by showing that 10 | (n5 − n). That
is, we will show that 5 | (n5 − n) and 2 | (n5 − n). By the
Corollary above, n5 ≡ n(mod 5), that is, 5 | (n5 − n). Thus, we
are left to show that 2 | (n5 − n).

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Fermat’s Little Theorem
EXAMPLE

Example
For any n ∈ N, show that n5 and n always have the same
units digit.

Solutions:
We prove the assertion by showing that 10 | (n5 − n). That
is, we will show that 5 | (n5 − n) and 2 | (n5 − n). By the
Corollary above, n5 ≡ n(mod 5), that is, 5 | (n5 − n). Thus, we
are left to show that 2 | (n5 − n).
Note that n5 − n = n(n2 − 1)(n2 + 1)

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Fermat’s Little Theorem
EXAMPLE

Example
For any n ∈ N, show that n5 and n always have the same
units digit.

Solutions:
We prove the assertion by showing that 10 | (n5 − n). That
is, we will show that 5 | (n5 − n) and 2 | (n5 − n). By the
Corollary above, n5 ≡ n(mod 5), that is, 5 | (n5 − n). Thus, we
are left to show that 2 | (n5 − n).
Note that n5 − n = n(n2 − 1)(n2 + 1)
If n is even,

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Fermat’s Little Theorem
EXAMPLE

Example
For any n ∈ N, show that n5 and n always have the same
units digit.

Solutions:
We prove the assertion by showing that 10 | (n5 − n). That
is, we will show that 5 | (n5 − n) and 2 | (n5 − n). By the
Corollary above, n5 ≡ n(mod 5), that is, 5 | (n5 − n). Thus, we
are left to show that 2 | (n5 − n).
Note that n5 − n = n(n2 − 1)(n2 + 1)
If n is even, then n5 − n is also even,

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Fermat’s Little Theorem
EXAMPLE

Example
For any n ∈ N, show that n5 and n always have the same
units digit.

Solutions:
We prove the assertion by showing that 10 | (n5 − n). That
is, we will show that 5 | (n5 − n) and 2 | (n5 − n). By the
Corollary above, n5 ≡ n(mod 5), that is, 5 | (n5 − n). Thus, we
are left to show that 2 | (n5 − n).
Note that n5 − n = n(n2 − 1)(n2 + 1)
If n is even, then n5 − n is also even, thus 2 | (n5 − n).

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Fermat’s Little Theorem
EXAMPLE

Example
For any n ∈ N, show that n5 and n always have the same
units digit.

Solutions:
We prove the assertion by showing that 10 | (n5 − n). That
is, we will show that 5 | (n5 − n) and 2 | (n5 − n). By the
Corollary above, n5 ≡ n(mod 5), that is, 5 | (n5 − n). Thus, we
are left to show that 2 | (n5 − n).
Note that n5 − n = n(n2 − 1)(n2 + 1)
If n is even, then n5 − n is also even, thus 2 | (n5 − n).
If n is odd,

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Fermat’s Little Theorem
EXAMPLE

Example
For any n ∈ N, show that n5 and n always have the same
units digit.

Solutions:
We prove the assertion by showing that 10 | (n5 − n). That
is, we will show that 5 | (n5 − n) and 2 | (n5 − n). By the
Corollary above, n5 ≡ n(mod 5), that is, 5 | (n5 − n). Thus, we
are left to show that 2 | (n5 − n).
Note that n5 − n = n(n2 − 1)(n2 + 1)
If n is even, then n5 − n is also even, thus 2 | (n5 − n).
If n is odd, then both (n2 − 1) and (n2 + 1) are even,

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Fermat’s Little Theorem
EXAMPLE

Example
For any n ∈ N, show that n5 and n always have the same
units digit.

Solutions:
We prove the assertion by showing that 10 | (n5 − n). That
is, we will show that 5 | (n5 − n) and 2 | (n5 − n). By the
Corollary above, n5 ≡ n(mod 5), that is, 5 | (n5 − n). Thus, we
are left to show that 2 | (n5 − n).
Note that n5 − n = n(n2 − 1)(n2 + 1)
If n is even, then n5 − n is also even, thus 2 | (n5 − n).
If n is odd, then both (n2 − 1) and (n2 + 1) are even, and so
n5 − n is even.

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Fermat’s Little Theorem
EXAMPLE

Example
For any n ∈ N, show that n5 and n always have the same
units digit.

Solutions:
We prove the assertion by showing that 10 | (n5 − n). That
is, we will show that 5 | (n5 − n) and 2 | (n5 − n). By the
Corollary above, n5 ≡ n(mod 5), that is, 5 | (n5 − n). Thus, we
are left to show that 2 | (n5 − n).
Note that n5 − n = n(n2 − 1)(n2 + 1)
If n is even, then n5 − n is also even, thus 2 | (n5 − n).
If n is odd, then both (n2 − 1) and (n2 + 1) are even, and so
n5 − n is even. Hence, 2 | (n5 − n).

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Congruences
WILSON’S THEOREM

Theorem: Wilson’s Theorem

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Congruences
WILSON’S THEOREM

Theorem: Wilson’s Theorem


If p is a prime,

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Congruences
WILSON’S THEOREM

Theorem: Wilson’s Theorem


If p is a prime, then (p − 1)! ≡ −1(mod p).

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Congruences
WILSON’S THEOREM

Theorem: Wilson’s Theorem


If p is a prime, then (p − 1)! ≡ −1(mod p).

Example
Find the remainder when 90! is divided by 97.

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Congruences
WILSON’S THEOREM

Theorem: Wilson’s Theorem


If p is a prime, then (p − 1)! ≡ −1(mod p).

Example
Find the remainder when 90! is divided by 97.
Solutions:

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Congruences
WILSON’S THEOREM

Theorem: Wilson’s Theorem


If p is a prime, then (p − 1)! ≡ −1(mod p).

Example
Find the remainder when 90! is divided by 97.
Solutions:
That is, we are going to solve for n in the congruence
90! ≡ n(mod 97).

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Congruences
WILSON’S THEOREM

Theorem: Wilson’s Theorem


If p is a prime, then (p − 1)! ≡ −1(mod p).

Example
Find the remainder when 90! is divided by 97.
Solutions:
That is, we are going to solve for n in the congruence
90! ≡ n(mod 97). By Wilson’s theorem,

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Congruences
WILSON’S THEOREM

Theorem: Wilson’s Theorem


If p is a prime, then (p − 1)! ≡ −1(mod p).

Example
Find the remainder when 90! is divided by 97.
Solutions:
That is, we are going to solve for n in the congruence
90! ≡ n(mod 97). By Wilson’s theorem, 96! ≡ −1(mod 97),

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Congruences
WILSON’S THEOREM

Theorem: Wilson’s Theorem


If p is a prime, then (p − 1)! ≡ −1(mod p).

Example
Find the remainder when 90! is divided by 97.
Solutions:
That is, we are going to solve for n in the congruence
90! ≡ n(mod 97). By Wilson’s theorem, 96! ≡ −1(mod 97), thus
96 · 95 · 94 · 93 · 92 · 91 · 90!

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Congruences
WILSON’S THEOREM

Theorem: Wilson’s Theorem


If p is a prime, then (p − 1)! ≡ −1(mod p).

Example
Find the remainder when 90! is divided by 97.
Solutions:
That is, we are going to solve for n in the congruence
90! ≡ n(mod 97). By Wilson’s theorem, 96! ≡ −1(mod 97), thus
96 · 95 · 94 · 93 · 92 · 91 · 90! ≡ −1(mod 97)

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Congruences
WILSON’S THEOREM

Theorem: Wilson’s Theorem


If p is a prime, then (p − 1)! ≡ −1(mod p).

Example
Find the remainder when 90! is divided by 97.
Solutions:
That is, we are going to solve for n in the congruence
90! ≡ n(mod 97). By Wilson’s theorem, 96! ≡ −1(mod 97), thus
96 · 95 · 94 · 93 · 92 · 91 · 90! ≡ −1(mod 97)
(−1)(−2)(−3)(−4)(−5)(−6) · 90!

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Congruences
WILSON’S THEOREM

Theorem: Wilson’s Theorem


If p is a prime, then (p − 1)! ≡ −1(mod p).

Example
Find the remainder when 90! is divided by 97.
Solutions:
That is, we are going to solve for n in the congruence
90! ≡ n(mod 97). By Wilson’s theorem, 96! ≡ −1(mod 97), thus
96 · 95 · 94 · 93 · 92 · 91 · 90! ≡ −1(mod 97)
(−1)(−2)(−3)(−4)(−5)(−6) · 90! ≡ −1(mod 97)

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Congruences
WILSON’S THEOREM

Theorem: Wilson’s Theorem


If p is a prime, then (p − 1)! ≡ −1(mod p).

Example
Find the remainder when 90! is divided by 97.
Solutions:
That is, we are going to solve for n in the congruence
90! ≡ n(mod 97). By Wilson’s theorem, 96! ≡ −1(mod 97), thus
96 · 95 · 94 · 93 · 92 · 91 · 90! ≡ −1(mod 97)
(−1)(−2)(−3)(−4)(−5)(−6) · 90! ≡ −1(mod 97)
720 · 90!

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Congruences
WILSON’S THEOREM

Theorem: Wilson’s Theorem


If p is a prime, then (p − 1)! ≡ −1(mod p).

Example
Find the remainder when 90! is divided by 97.
Solutions:
That is, we are going to solve for n in the congruence
90! ≡ n(mod 97). By Wilson’s theorem, 96! ≡ −1(mod 97), thus
96 · 95 · 94 · 93 · 92 · 91 · 90! ≡ −1(mod 97)
(−1)(−2)(−3)(−4)(−5)(−6) · 90! ≡ −1(mod 97)
720 · 90! ≡ −1(mod 97)

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Congruences
WILSON’S THEOREM

Theorem: Wilson’s Theorem


If p is a prime, then (p − 1)! ≡ −1(mod p).

Example
Find the remainder when 90! is divided by 97.
Solutions:
That is, we are going to solve for n in the congruence
90! ≡ n(mod 97). By Wilson’s theorem, 96! ≡ −1(mod 97), thus
96 · 95 · 94 · 93 · 92 · 91 · 90! ≡ −1(mod 97)
(−1)(−2)(−3)(−4)(−5)(−6) · 90! ≡ −1(mod 97)
720 · 90! ≡ −1(mod 97)
41 · 90!

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Congruences
WILSON’S THEOREM

Theorem: Wilson’s Theorem


If p is a prime, then (p − 1)! ≡ −1(mod p).

Example
Find the remainder when 90! is divided by 97.
Solutions:
That is, we are going to solve for n in the congruence
90! ≡ n(mod 97). By Wilson’s theorem, 96! ≡ −1(mod 97), thus
96 · 95 · 94 · 93 · 92 · 91 · 90! ≡ −1(mod 97)
(−1)(−2)(−3)(−4)(−5)(−6) · 90! ≡ −1(mod 97)
720 · 90! ≡ −1(mod 97)
41 · 90! ≡ −1(mod 97)

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Wilson’s Theorem
EXAMPLE

Since 71 · 41 ≡ 1(mod 97),

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Wilson’s Theorem
EXAMPLE

Since 71 · 41 ≡ 1(mod 97), thus we have

71 · 41 · 90!

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Wilson’s Theorem
EXAMPLE

Since 71 · 41 ≡ 1(mod 97), thus we have

71 · 41 · 90! ≡ 71 · −1(mod 97)

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Wilson’s Theorem
EXAMPLE

Since 71 · 41 ≡ 1(mod 97), thus we have

71 · 41 · 90! ≡ 71 · −1(mod 97)


90!

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Wilson’s Theorem
EXAMPLE

Since 71 · 41 ≡ 1(mod 97), thus we have

71 · 41 · 90! ≡ 71 · −1(mod 97)


90! ≡ −71(mod 97)

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Wilson’s Theorem
EXAMPLE

Since 71 · 41 ≡ 1(mod 97), thus we have

71 · 41 · 90! ≡ 71 · −1(mod 97)


90! ≡ −71(mod 97)
90! ≡ 26(mod 97)

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Wilson’s Theorem
EXAMPLE

Since 71 · 41 ≡ 1(mod 97), thus we have

71 · 41 · 90! ≡ 71 · −1(mod 97)


90! ≡ −71(mod 97)
90! ≡ 26(mod 97)

Therefore, the remainder is 26 when 90! is divided by 97.

Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The
Congruences
EXERCISES

EXERCISES:
1 Find the remainder when
13 · 1245 is divided by 47
252 is divided by 37
9! is divided by 11
2 Find the least positive residue when 18! is divided by 437.
3 Show that 55552222 + 22225555 is divisible by 7.
x5 x3 7x
4 Show that if x is an integer, then + + is also an
5 3 15
integer.
5 Find a multiple of 11 that leaves a remainder of 1 when
divided by each of the integers 2, 3, 5 and 7.
82!
6 Let y = . What is the remainder when y is divided by
21
83?
Math 125 - Number Theory Oreste M. Ortega, Jr. Leyte Normal University
Chinese Remainder Theorem, Euler’s, Fermat’s and Wilson’s The