You are on page 1of 7

CHAPTER 6: SPECIAL CONGRUENCES

Euler’s Theorem
Fermat’s Little Theorem involves moduli which are prime numbers. In this
section, we will learn Euler’s Theorem that will allow us to work with moduli
that are not prime numbers.
To achieve this, Euler introduced the “Euler 𝜑 function” (𝜑 is pronounced
“phee”).
Definition. The function 𝜑 is the function defined by:
𝜑(𝑛) = number of elements in {1,2,…,n} which are relatively prime to n.

Examples: Compute (a) 𝜑(7) and (b) 𝜑(12).


Solution.
(a) 𝜑(7) is the number of elements in {1,2,…,7} that are relatively prime to 7.
In this set, six numbers (1, 2, 3, 4, 5, and 6) are relatively prime to 7.
Therefore, 𝜑(7) = 6.
(b) 𝜑(12) is the number of elements in {1,2,…,12} that are relatively prime to
12. In this set, the following numbers are relatively prime to 12: 1,5,7,11.
Therefore, 𝜑(5) = 12.
Observe!
If p is prime, then 𝜑(𝑝) = 𝑝 − 1
(because all positive integers less than p is relatively
prime to p, as demonstrated in part (a) above).

How can we compute Euler’s 𝜑 function more efficiently? For 𝜑(5) or 𝜑(12), it
is reasonable to check all integers less than p that are relatively prime to p.
However, we need a more efficient strategy to compute something like
𝜑(250). We will use the following theorem.
Theorem (Computations involving 𝝋(𝒏))
(a) If p is prime and if k is a positive exponent, then
𝜑(𝑝𝑘 ) = 𝑝𝑘 − 𝑝𝑘−1
(b) If m1 and m2 are relatively prime, then
𝜑(𝑚1 𝑚2 ) = 𝜑(𝑚1 )𝜑(𝑚2 )
The proof of this theorem is beyond the scope of this module.
The theorem above gives a way to compute 𝜑(𝑛) more efficiently—first write
n as a product of its prime factors.
Example. Compute the following: (a) 𝜑(81), (b) 𝜑(490), and (c) 𝜑(192)
MathEd 222: Number Theory
15
Solution.
(a) 𝜑(81) = 𝜑(34 ) = 34 − 33 = 81 − 27 = 54
(b) 𝜑(490) = 𝜑(21 51 72 ) = 𝜑(21 )𝜑(51 )𝜑(72 )
= (21 − 20 )(51 − 50 )(72 − 71 )
= (1)(4)(42)
= 168
(b) 𝜑(192) = 𝜑(31 26 ) = 𝜑(31 )𝜑(26 )
= (31 − 30 )(26 − 25 )
= (2)(32)
= 64

Reduced Residue System (mod n)

Definition
A reduced residue system (mod n) is a set of 𝜑(𝑛) integers such that no two
of them are congruent (mod n).

Example:
a) Consider mod 8. 𝜑(8) = 23 − 22 = 4, so the reduced residue system (mod
8) must contain 4 elements. The set {1,3,5,7} is a reduced residue system
(mod 8) because no pair is congruent mod 8.
b) Consider mod 8 again. The set {17, –1, 71, 43} is also a reduced residue
system (mod 8). There is no pair among these that are congruent mod 8. If we
get their remainders when we divide by 8, then we get the following:
17  8 → Remainder 1
–1  8 → Remainder 5
71  8 → Remainder 7
43  8 → Remainder 3

They all have different remainders, and so the set is a reduced residue
system (mod 8).

Introduction to Euler’s Theorem

MathEd 222: Number Theory


16
Consider the set {1,3,5,7}. This is a reduced residue system (mod 8).
Multiply each number in the set {1,3,5,8} by 21. Note that 21 and 8 are
relatively prime (i.e., gcd(21,8)=1).
1 × 21 = 21
3 × 21 = 63
5 × 21 = 105
7 × 21 = 147
The resulting numbers {21, 63, 105, 147} is another reduced residue system
(mod 10). We can check that they all have different remainders when divided
by 10 (hence none of them are congruent mod 10).
21  8 → Remainder 5 → 21  5 (mod 8)
63  8 → Remainder 7 → 63  7 (mod 8)
105  8 → Remainder 1 → 105  1 (mod 8)
147  8 → Remainder 3 → 147  3 (mod 8)

We can now multiply the congruences on the right side (above) to obtain the
following:
21  63  105  147  5  7  1  3 (mod 8)
In other words:
(121)  (321)  (521)  (721)  5  7  1  3 (mod 8)
Now we can divide both sides by 5  7  1  3 (which is relatively prime with 8,
so division is valid) to get:
214  1 (mod 8)
We can actually generalize the result above. Starting from any mod (such as
mod 8), if we take its Euler 𝜑-function (in this case 𝜑(8) = 4, then if we make
it an exponent of a base (like 21), then the result is congruent to 1 mod 8. The
only restriction is that the base (21) must be relatively prime to the mod (8).

We are now ready to state Euler’s Theorem.


Theorem (Euler’s Theorem)
If a and n are integers with n > 1, and with gcd(a, n) = 1, then
𝑎𝜑(𝑛) ≡ 1 (mod n)

There are many examples:


If we choose mod 14, then get 𝜑(14) = 𝜑(2)𝜑(7) = 16 = 6
MathEd 222: Number Theory
17
Choose any base that is relatively prime to 14. There are many, like 5, 27, 39,
etc. So meaning, all of these can be the base, and we can conclude (by
Euler’s Theorem) that:
• 5𝜑(14) = 56 ≡ 1 (mod 14)
• 27𝜑(14) = 276 ≡ 1 (mod 14)
• 39𝜑(14) = 396 ≡ 1 (mod 14)

Example. Use Euler’s Theorem to calculate the following, if possible: (a) 242
(mod 75), (b) 542 (mod 75), and (c) (c) 3101 (mod 56)
Solution.
(a) Euler’s Theorem applies because gcd(2,75) = 1. Therefore,
2𝜑(75) ≡ 1 (mod 75)
We can compute 𝜑(75) using the theorem on page 15:
𝜑(75) = 𝜑(52 ∙ 31 ) = 𝜑(52 )𝜑(31 )
= (52 − 51 )(31 − 30 )
= (20)(2) = 40
Therefore, by Euler’s Theorem, 240  1 (mod 75).
We can now multiply 22 to both sides of the equation to get:
24022  122 (mod 75)
→ 242  4 (mod 75).
(b) We cannot use Euler’s Theorem to calculate 542 (mod 75) because
gcd(5,75)  1.
(c) Euler’s Theorem applies because gcd(3,56) = 1. Therefore,
3𝜑(56) ≡ 1 (mod 56)
We compute 𝜑(56) as follows:
𝜑(56) = 𝜑(23 ∙ 71 ) = 𝜑(23 )𝜑(71 )
= (23 − 22 )(71 − 70 )
= (4)(6) = 24
Therefore, by Euler’s Theorem, 324 ≡ 1 (mod 56)
What about 3101? We use the Division Algorithm to obtain 101 = 4(24)+5
Thus we can write
3101 = 324(4)+5 = (324 )4 35 ≡ (1)4 35 = 243 (mod 56)
MathEd 222: Number Theory
18
Finally, we find the remainder when 243 is divided by 56 to get:
3101 ≡ 243 ≡ 19 (mod 56).
Example. Use Euler’s Theorem to solve the linear congruence 6x ≡ 17 (mod
37).
Solution. We first check that gcd(6,37) = 1 and 1 divides 17, so the equation
has a solution. Further, since gcd(6,37) = 1, then Euler’s Theorem applies.
By Euler’s theorem, 6𝜑(37) ≡ 1 (mod 37). Since 37 is odd, then 𝜑(37) = 36.
Therefore, 636 ≡ 1 (mod 37).
Multiply both sides by 17, and we get: 636 17 ≡ 17 (mod 37).
We can rewrite the equation this way: 6 635 17 ≡ 17 (mod 37).

𝑥
This implies that 𝑥 = 635 17 is a solution to the equation.

Problem Set

Calculate the following:


1. 𝜑(27) 2. 𝜑(28) 3. 𝜑(29) 4. 𝜑(30)
Ans: 1) 18; 2) 12; 3) 28; 4) 8
5. Write down all the integers in {1,2,…,18} which are counted in 𝜑(18).
Ans: {1,5,7,11,13,17}
Use the theorem on page 15 to compute:
6. 𝜑(525) Ans: 240
7. 𝜑(108 ) [Hint: First write 10 as a product of its prime factors] Ans:
40,000,000
For each of the following, state whether the use Euler’s Theorem is valid.
8. 5187 (mod 81) 9. 3490 (mod 138) 10. 15418 (mod 14)
Ans: 8) Yes; 9) No, because gcd(3,138)1; 10) Yes
Use Euler’s Theorem to compute the following.
10. 2187 (mod 77) 11. 7152 (mod 135)
Ans: 10) 51; 11) 31
11. Use Euler’s Theorem to solve the equation 7x ≡ 3 (mod 20). Ans: 77 3
MathEd 222: Number Theory
19
Fermat’s Little Theorem

Fermat’s Last Theorem, which says that the equation xn + yn = zn has no


integer solutions for n  3, was proved after more than 300 years through the
efforts of Andrew Wiles.
In this section, we will learn about another theorem: Fermat’s Little Theorem,
which involves congruences.

Review
On page 15, we learned that if p is prime, then
𝜑(𝑝) = 𝑝 − 1.
Now, in Euler’s Theorem, if n is a prime number p,
then
𝑎𝜑(𝑛) ≡ 1 (mod n)
becomes
𝑎𝑝−1 ≡ 1 (mod p),
which is Fermat’s Little Theorem.

Theorem (Fermat’s Little Theorem)


If p is prime and gcd(a, p) = 1 (mod p), then
ap – 1  1 (mod p).

Fermat’s Little Theorem has an easy-to-remember corollary. [A corollary is a


theorem that naturally follows from another theorem]
Corollary.
If p is prime, then
ap  a (mod p).

Proof.
Case 1: Suppose a is not divisible by p. Then gcd(a,p) = 1 and we can use
Fermat’s Little Theorem to obtain ap – 1  1 (mod p). We can multiply both
sides by p to get ap  a (mod p).
Case 2: Suppose a is divisible by p. Then a  0 (mod p). Raise both sides to
p, to obtain ap  0 (mod p). Since both a and ap are congruent to 0 (mod p),
then ap  a (mod p).
Example. Compute 5496 (mod 97).
Solution. The number 97 is prime. Also, gcd(54, 97) = 1. Therefore, 54 96  1
(mod 97).

MathEd 222: Number Theory


20
We can also apply Fermat’s Little Theorem to examples when the given
expression is not yet in the form ap – 1.
Example. Compute (a) 3100 (mod 5), and (b) 3103 (mod 5).
Solution.
(a) Based on Fermat’s Little Theorem, 34  1 (mod 5). We will now express
3100 in terms of 34.
3100 = (34)25  (1)25 = 1 (mod 5).
(b) To solve (b), we use what we found in part (a), which is 3100  1 (mod 5).
By the Division Algorithm, 103 = 4(25) + 3, and so
3103 = 34(25)+3 = (34)2533  (1)2533 = 33 = 27  2 (mod 5).

Problem Set
In each of the following, use Fermat’s Little Theorem to fill in the blanks with
the least non-negative residue.
1. 144  _____ (mod 5) [1]
2. 20013  _____ (mod 13) [5]
3. 315  _____ (mod 7) [Hint: What is 35 (mod 6)?] [6]
4. 522  _____ (mod 19) [17]
5. 3144  _____ (mod 17) [1]
6. 56147  _____ (mod 13) [12]

MathEd 222: Number Theory


21

You might also like