(a) x ≡ 1 mod 2

MATH 116
Homework 6
Solutions
1. Solve the following systems of congruences.

x≡1



x≡2
(a)
x≡3



x≡5
mod
mod
mod
mod
2 (1)
3 (2)
5 (3)
7 (4)

 x ≡ 2 mod 6
x ≡ 7 mod 15
(b)

x ≡ 12 mod 25
(1)
(2)
(3)
(c)
Solution :
a) From (4), we get that
x = 7k + 5
where k ∈ Z
Substituting this into (3), we find
7k + 5 ≡ 3
Reducing
mod 5
mod 5, we get
2k ≡ 3
mod 5
Since 3 mod 5 is the inverse of 2 mod 5, we multiply both sides by 3 :
k ≡3·2·k ≡3·3≡9≡4
mod 5
So
where l ∈ Z
k = 5l + 4
Substituting this into our expression for x, we find
x = 7k + 5 = 7(5 l + 4) + 5 = 35 l + 33
Substituting this into (2), we get
35 l + 33 ≡ 2
Reducing
mod 3
mod 3, we have
2l ≡ 2
mod 3
Dividing both sides by 2, we get
l≡1
mod
3
=3
(3, 2)
So
l = 3m + 1
where m ∈ Z
Substituting this into our expression for x, we find
x = 35 l + 33 = 35(3m + 1) + 33 = 105m + 68
Substituting this into (1), we get
105 m + 68 ≡ 1
Reducing
mod 2
mod 2, we have
m≡1
mod 2
So
m = 2n + 1
where n ∈ Z
Substituting this into our expression for x, we find
x = 105 m + 68 = 105(2n + 1) + 68 = 210n + 173
x = 210n + 173 where n ∈ Z
1
11x ≡ 2 mod 15 (1)
13x ≡ 1 mod 21 (2)
Note that we can rewrite this answer in modular form
x ≡ 173 mod 210
b) From (3), we get that
where k ∈ Z
x = 25k + 12
Substituting this into (2), we find
Reducing
25k + 12 ≡ 7
mod 15
10k + 12 ≡ 7
mod 15
mod 15, we get
So
10k ≡ −5 ≡ 10
mod 15
Dividing both sides by 10, we get
k≡1
15
=3
(10, 5)
mod
So
k = 3l + 1
where l ∈ Z
Substituting this into our expression for x, we find
x = 25k + 12 = 25(3 l + 1) + 12 = 75 l + 37
Substituting this into (1), we get
75 l + 37 ≡ 2
Reducing
mod 6
mod 6, we have
3l + 1 ≡ 2
mod 6
So
3l ≡ 1
mod 6
Since (3, 6) = 3 and 3 6 |1, there are no solutions
No solutions
c) To solve (2) for x, we need to find an inverse of 13 mod 21.
1
0
−1
−3
5
0 21
1 13 21 = 13 · 2 + (−5)
2
5 13 = 5 · 3 + (−2)
5
2 5=2·2+1
−8
1 2=1·2+0
R3 = R1 − 2R2 and change signs
R4 = R2 − 3R3 and change signs
R5 = R3 − 2R4
so we stop
So 5 · 21 + (−8) · 13 = 1. Hence (−8) · 13 ≡ 1 mod 21 and −8 is an inverse of 13 mod 21. Multiplying both
sides of 13 x ≡ 1 mod 21 by −8, we get
x ≡ (−8) · 13 x ≡ (−8) · 1 ≡ −8 ≡ 13
Hence
x = 21k + 13
where k ∈ Z
Substituting this into (1), we find
11 · (21k + 13) ≡ 2
mod 15
So
231k + 143 ≡ 2
2
mod 15
mod 21
Reducing
mod 15, we get
6k + 8 ≡ 2
mod 15
Hence
6k ≡ −6
mod 15
Dividing both sides by 6, we find
k ≡ −1 ≡ 4
mod
15
=5
(15, 6)
So
where l ∈ Z
k = 5l + 4
Substituting this into our expression for x, we get
x = 21k + 13 = 21(5 l + 4) + 13 = 105 l + 97
x = 105 l + 97 where l ∈ Z
Note that we can rewrite this answer in modular form
x ≡ 97 mod 105
2. A band of 17 pirates has stolen a number of gold coins. When they divide the coins into equal piles, 3 coins are
left over. When they fight over who should get the extra coins, one of the pirates is slain. The remaining pirates
divide the coins again into equal piles and 10 coins are left over. Another round of fighting leaves 1 pirate dead.
Now they can finally divide the coins into equal piles with no coins remaining. What is the least number of gold
coins that the pirates stole?
Solution : Let x be the number of gold coins. Then we have that

mod 17 (1)

 x≡3

x ≡ 10
mod 16 (2)
x
≡
0
mod 15 (3)



x≥0
From (1), we get that
x = 17k + 3 where k ∈ Z
Substituting this in (2), we get
17k + 3 ≡ 10
Reducing
mod 16
mod 16, we find
k + 3 ≡ 10
mod 16
So
k≡7
mod 16
Hence
k = 16 l + 7 where l ∈ Z
Substituting this in our expression for x, we get
x = 17k + 3 = 17(16 l + 7) + 3 = 272 l + 122
Substituting this in (3), we find
272 l + 122 ≡ 0
Reducing
mod 15
mod 15, we get
2l + 2 ≡ 0
3
mod 15
So
2 l ≡ −2
mod 15
Dividing by 2, we have
l ≡ −1 ≡ 14
15
= 15
(15, 2)
mod
Hence
l = 15m + 14
where m ∈ Z
Substituting this into the expression for x, we get
x = 272 l + 122 = 272(15m + 14) + 122 = 4080m + 3930
So we get the smallest number of gold coins when m = 0.
The smallest number of gold coins is 3930.
3. In this exercise, you will solve the equation
x2 + x ≡ 44
mod 56
(a) By trial and error, find all the solutions of
x2 + x ≡ 44
mod 8
x2 + x ≡ 44
mod 7
(b) By trial and error, find all the solutions of
(c) Using the Chinese remainder Theorem, find all the solutions of
x2 + x ≡ 44
mod 56
Solution :
a)
x ≡ 3 mod 8 or x ≡ 4 mod 8
b)
x ≡ 1 mod 7 or x ≡ 5 mod 7
c) Since 56 = 8 · 7 and (8, 7) = 1, we have that
x2 + x ≡ 44
mod 56
⇐⇒
⇐⇒
⇐⇒
x2 + x ≡ 44 mod 8 and
(x ≡ 3 mod 8 or x ≡ 4
x ≡ 3 mod 8
or
x ≡ 1 mod 7
x2 + x ≡ 44 mod 7
mod 8) and (x ≡ 1 mod 7 or x ≡ 5 mod 7)
x ≡ 3 mod 8
x ≡ 4 mod 8
x≡4
or
or
x ≡ 5 mod 7
x ≡ 1 mod 7
x≡5
We solve the first system. The other systems are similar. From the first equation, we get that
x = 8k + 3 where k ∈ Z
Substituting this into the second equation, we get
Reducing
8k + 3 ≡ 1
mod 7
k+3≡1
mod 7
mod 7, we find
4
mod 8
mod 7
So
k ≡ −2 ≡ 5
mod 7
Hence
k = 7 l + 5 where l ∈ Z
Substituting this in our expression for x, we get
x = 8k + 3 = 8(7 l + 5) + 3 = 56 l + 43
So
x ≡ 43
x ≡ 12 mod 56
or
x ≡ 19 mod 56
mod 56
x ≡ 36 mod 56
or
or
x ≡ 43 mod 56
4. Use Hensel’s Method to solve the following equations:
(a) x2 + x + 34 ≡ 0 mod 81
(b) x2 − 2x ≡ 35 mod 625
Solution :
a) We put f (x) = x2 + x + 34. Then f 0 (x) = 2x + 1.
• x2 + x + 34 ≡ 0 mod 3
By trial and error, we get
x ≡ 1 mod 3
• x2 + x + 34 ≡ 0 mod 9
f 0 (1) = 3 ≡ 0 mod 3 and f (1) = 36 ≡ 0 mod 9. So 1 + 3t is a solution for all t.
x ≡ 1 mod 9
or
x ≡ 4 mod 9
or
x ≡ 7 mod 9
• x2 + x + 34 ≡ 0 mod 27
f 0 (1) = 3 ≡ 0 mod 3 and f (1) = 36 6≡ 0 mod 27 so no solutions of the form 1 + 9t.
f 0 (4) = 9 ≡ 0 mod 3 and f (4) = 54 ≡ 0 mod 27. So 4 + 9t is a solution for all t.
f 0 (7) = 15 ≡ 0 mod 3 and f (7) = 90 6≡ 0 mod 27 so no solutions of the form 7 + 9t.
x ≡ 4 mod 27
or
x ≡ 13 mod 27
or
x ≡ 22 mod 27
• x2 + x + 34 ≡ 0 mod 81
f 0 (4) = 9 ≡ 0 mod 3 and f (4) = 54 6≡ 0 mod 81 so no solutions of the form 4 + 27t.
f 0 (13) = 27 ≡ 0 mod 3 and f (13) = 216 6≡ 0 mod 81 so no solutions of the form 13 + 27t.
f 0 (22) = 45 ≡ 0 mod 3 and f (22) = 540 6≡ 0 mod 81 so no solutions of the form 22 + 27t
No solutions
b) We put f (x) = x2 − 2x − 35. Then f 0 (x) = 2x − 2.
• x2 − 2x − 35 ≡ 0 mod 5
By trial and error, we get
x ≡ 0 mod 5
5
or
x ≡ 2 mod 5
• x2 − 2x − 35 ≡ 0 mod 25
f 0 (0) = −2 ≡ 3 mod 5 and f (0) = −35. So 0 + 5t is a solution where
t ≡ −3−1 ·
−35
≡ −2 · (−7) ≡ 14 ≡ 4
5
mod 5
f 0 (2) = 2 mod 5 and f (2) = −35. So 2 + 5t is a solution where
t ≡ −2−1 ·
−35
≡ −3 · (−7) ≡ 21 ≡ 1
5
x ≡ 7 mod 25
or
mod 5
x ≡ 20 mod 25
• x2 − 2x − 35 ≡ 0 mod 125
f 0 (7) = 12 ≡ 2 mod 5 and f (7) = 0 so 7 + 25t is a solution where
t ≡ −2−1 ·
0
≡0
5
mod 5
f 0 (20) = 38 ≡ 3 mod 5 and f (20) = 325. So 20 + 25t is a solution where
t ≡ −3−1 ·
325
≡ −2 · 13 ≡ −26 ≡ 4
25
x ≡ 7 mod 125
or
mod 5
x ≡ 120 mod 25
• x2 − 2x − 35 ≡ 0 mod 625
f 0 (7) = 12 ≡ 2 mod 5 and f (7) = 0 so 7 + 125t is a solution where
t ≡ −2−1 ·
0
≡0
5
mod 5
f 0 (120) = 238 ≡ 3 mod 5 and f (20) = 14125. So 120 + 125t is a solution where
t ≡ −3−1 ·
14125
≡ −2 · 113 ≡ −226 ≡ 4
125
x ≡ 7 mod 625
or
mod 5
x ≡ 620 mod 25
Remark: Note that x2 − 2x − 35 = 0 ⇐⇒ x = 7 or x = −5. Hence x = 7 and x = −5 are always solutions of
x2 − 2x − 35 ≡ 0 mod 5k for k = 1, 2, . . .. It turns out that they are the only solutions for any k.
6