You are on page 1of 10

Number Theory, Midterm I, Solution

陳冠廷 40940903S
March 27, 2023

Problem 1. Find integers x < 0 and y > 0 such that (4 pts)

6919x + 5957y = gcd(6919, 5957).

Solution. By the Euclidean algorithm

a 6919 5957 b
b 5957 5772 6a − 6b
a−b 962 185 −6a + 7b
−30a + 35b 925 185
31a − 36b 37 0

we have
31 · 6919 − 36 · 5957 = gcd(6919, 5957) = 37.

Let d = gcd(6919, 5957) = 37. By Thm. 6.1,

{(x, y) ∈ Z × Z : 6919x + 5957y = d}


{( ) }
5957 6961
= 31 + k, −36 − k ∈Z×Z:k ∈Z
d d
= {(31 + 161k, −36 − 187k) ∈ Z × Z : k ∈ Z}.

Take k = −1 and we have a desired solution (x, y) = (−130, 151).

Problem 2.

(a) Compute the remainder 5657 (mod 329). (4 pts)

(b) Compute the remainder 5657 (mod 330). (4 pts)

Solution (a).

• Note that 329 = 7 · 47, and that, for x ∈ Z,



x ≡ 5657 (mod 7)
x ≡ 5657 (mod 329) ⇐⇒
x ≡ 5657 (mod 47)

by the Chinese remainder theorem.

1
PWO

• Since 7 and 47 are primes, 7̸ | 5 and 5̸ | 47,

x ≡ 5657 ≡ 5657 (mod 6)


= 53 ≡ 6 (mod 7)
x ≡ 5657 ≡ 5657 (mod 46)
= 513 ≡ 43 (mod 47),

by the Fermat’s little theorem.

• Now, we aim to solve 


x ≡ 6 (mod 7)
x ≡ 43 (mod 47).

From x ≡ 6 (mod 7), we have x is of the form 7k + 6, k ∈ Z. Plugging this to


x ≡ 43 (mod 47) gives

7k + 6 ≡ 43 (mod 47), or equivalently, 7k ≡ 37 (mod 47).

By the Euclidean algorithm we get −20 · 7 + 3 · 47 = 1. Thus,

1 ≡ −20 · 7 (mod 47), and 37 ≡ 7 · (−740) ≡ 7 · 12 (mod 47).

Take k = 12, and we have x = 7 · k + 6 = 90. Therefore,



x ≡ 6 (mod 7)
⇐⇒ x ≡ 90 (mod 329).
x ≡ 43 (mod 47)

by the Chinese remainder theorem.

• Note that 0 ≤ 90 < 329. Hence (5657 (mod 329)) = 90.

Solution (b).

• Note that 330 = 5 · 66, and that, for x ∈ Z,



x ≡ 5657 ≡ 0 (mod 5)
x≡5 657
(mod 330) ⇐⇒
x ≡ 5657 ≡ 5657 (mod ϕ(66)) = 517 ≡ 47 (mod 66)

by the Chinese remainder theorem and Euler’s formula.

2
PWO

• Now, we aim to solve 


x ≡ 0 (mod 5)
x ≡ 47 (mod 66).

From x ≡ 0 (mod 5), we have x is of the form 5k, k ∈ Z. Plugging this to x ≡ 47


(mod 66) gives
5k ≡ 47 (mod 66).

By the Euclidean algorithm we get −13 · 5 + 1 · 66 = 1. Thus,

1 ≡ −13 · 5 (mod 66), and 47 ≡ −611 · 5 ≡ 49 · 5 (mod 66).

Take k = 49, and we have x = 5k = 245. Therefore,



x ≡ 0 (mod 5)
⇐⇒ x ≡ 245 (mod 330).
x ≡ 49 (mod 66).

by the Chinese remainder theorem.

• Note that 0 ≤ 245 < 330. Hence (5657 (mod 329)) = 245.

Problem 3.

(a) Find all incongruent solutions to 2863x ≡ 2023 (mod 3157). (6 pts)

(b) Find all incongruent solutions to 15939x ≡ 7357 (mod 3266). (6 pts)

(c) Find all incongruent solutions to x ≡ 31 (mod 34) and x ≡ 29 (mod 88). (6 pts)

Solution (a). By the Euclidean algorithm

a 2863 3157 b
−10a + 10b 2940 2863 a
11a − 10b −77 294 −a + b
215a − 195b −70 308 −44a + 40b
−204a + 185b −7 −14 43a − 39b
−14
0

3
PWO

we know that
204 · 2863 − 185 · 3157 = 7 = gcd(2863, 3157).

Note that 2023


gcd(2863,2023)
= 289. By Thm. 8.1, x = 204 · 289 = 58956 is a solution and all
incongruent solutions are given by
3157
x ≡ 58956 + k · = 58956 + 451k (mod 3157) for k = 0, 1, . . . , 6.
7

Solution (b). By the Euclidean algorithm

a 15939 3266 b
5b 16330 3128 −8a + 40b
a − 5b −391 138 8a − 39b
−24a + 117b −414 138
25a − 122b 23 0

we know that gcd(15939, 3266) = 23. Since gcd(15939, 3266)̸ | 7457, by Thm. 8.1, there
has no solution.

Solution (c).

• Notice that


x ≡ 31 ≡ 1 (mod 2) 
 
 

 
 x ≡ −3 (mod 17)
x ≡ 31 (mod 34) x ≡ 31 ≡ −3 (mod 17) 
⇐⇒ ⇐⇒ x ≡ −3 (mod 8)
x ≡ 29 (mod 88) 
 x ≡ 29 ≡ −3 (mod 8) 


 
x ≡ −4

 (mod 11)
x ≡ 29 ≡ −4 (mod 11)

• Since gcd(17, 8) = 1,

x ≡ −3 (mod 17)
⇐⇒ x ≡ −3 (mod 136),
x ≡ −3 (mod 8)

where 136 = 17 · 8. Thus, we aim to solve



x ≡ −3 (mod 136)
x ≡ −4 (mod 11)

4
PWO

• From x ≡ −3 (mod 136) we know that x is of the form

x = 136y − 3 with y any integer.

Substituting this into x ≡ −4 (mod 11) gives

136y − 3 ≡ −4 (mod 11) or 4y ≡ 136y ≡ −1 (mod 11).

• We now solve 4y ≡ −1 (mod 11). Applying the Euclidean algorithm,

a 4 11 b
−2a + b 3 8 2a
3a − b 1 3 −2a + b
3
0

we have

3 · 4 − 1 · 11 = 1 = gcd(4, 11), and 4 · 3 ≡ 1 (mod 11)

Thus, 4 · (−3) ≡ −1 (mod 11), that is, y = −3 is a solution.

• So
x = 136y − 3 = 136 · (−3) − 3 = −411

x ≡ −3 (mod 136)
is a solution to . By the Chinese remainder theorem,
x ≡ −4 (mod 11)

x ≡ −3 (mod 136)
⇐⇒ x ≡ −411 (mod 1496),
x ≡ −4 (mod 11)

where 1496 = 136 · 11. Thus, x ≡ −411 (mod 1496) the desired solution.

Problem 4. (a) Let m ∈ N. Suppose that p1 , p2 , . . . , pr are the distinct primes that divide
m. Show that (5 pts)
( )( ) ( )
1 1 1
ϕ(m) = m 1 − 1− ··· 1 − .
p1 p2 pr

(b) Find ϕ(188000). (4 pts)

5
PWO

Solution (a). Suppose



r
m= pm 1 m2
1 p2 · · · pm
r
r
= pm
k ,
k

k=1

where m1 , . . . , mr ∈ N. By the properties of ϕ, we have


( ) ) (

r ∏
k ∏
r
1 ∏
r
k −1
ϕ(m) = ϕ pm
=k
k
= ϕ(pm
k )
k
− 1) = pm
k 1−
(pk pm
k
k

pk
( r
k=1
)( r (
k=1 k=1
) ) (
k=1
)( ) ( )
∏ m ∏ 1 1 1 1
= pk k
1− =m 1− 1− ··· 1 − ,
k=1 k=1
pk p1 p2 pr

as desired.

Solution (b). By the properties of ϕ, we have

ϕ(188000) = ϕ(25 · 53 · 47) = ϕ(25 ) · ϕ(53 ) · ϕ(47)


= 24 (2 − 1) · 52 (5 − 1) · (47 − 1) = 16 · 100 · 46 = 73600.

Problem 5. Suppose a, m ∈ N and gcd(a, m) = 1. Let 1 = b1 < b2 < · · · < bϕ(m) < m are
relatively prime to m and ri ≡ abi (mod m), where 0 ≤ ri < m.

(a) Show that if i ̸= j, then ri ̸= rj , (5 pts)

(b) Show that r1 , r2 , . . . , rϕ(m) are all relatively prime to m. (6 pts)

(c) Is xϕ(m) − 1 ≡ (x − b1 )(x − b2 ) · · · (x − bϕ(m) ) (mod m) ? Give your reason. (4 pts)

Solution. (a) Suppose that ri = rj , where 1 ≤ i, j ≤ ϕ(m). We have

ri = rj =⇒ abi ≡ abj (mod m) =⇒ m | a(bi − bj ).

Since gcd(a, m) = 1, there exist x, y ∈ Z s.t. xa + ym = 1. Then

xa(bi − bj ) + ym(bi − bj ) = (xa + ym)(bi − bj ) = 1(bi − bj ) = bi − bj .

Also, since m | a(bi − bj ) · x and m | my(bi − bj ), we have

m | xa(bi − bj ) + ym(bi − bj ) = bi − bj .

6
PWO

Moreover,

1 = b1 < b2 < · · · < bϕ(m) < m =⇒ −m < bi − bj < m.

So m | bi − bj leads that bi = bj , and thus i = j. Hence the contrapositive, i ̸= j


implies ri ̸= rj .

(b) Fix i ∈ {1, . . . , ϕ(m)}.

1◦ We first show that gcd(abi , m) = 1. Since gcd(a, m) = 1 and gcd(bi , m) = 1,


there exist x, y, u, v ∈ Z s.t. xa + ym = 1 and ubi + vm = 1. Then

1 = (xa + ym)(ubi + vm) = (xu)abi + (yubi + xav + ymv)m,

where xu, yubi +xav+ymv ∈ Z. By the corollary, we conclude gcd(abi , m) =


1.

2◦ Since ri ≡ abi (mod m), we have m | ri − abi . By the lemma (of the division
algorithm, in Note I), we have

1 = gcd(abi , m) = gcd(abi mod m, m) = gcd(ri , m).

So r1 , r2 , . . . , rϕ(m) are all relatively prime to m.

(c) No. Take m = 8 and x = 6. Then it is clear that ϕ(8) = 4 and b1 = 1, b2 = 3,


b3 = 5 and b4 = 7. Then

6ϕ(8) − 1 = 64 − 1 ≡ −1 ≡ 7 (mod 8)

but
(6 − 1)(6 − 3)(6 − 5)(6 − 7) = 5 · 3 · 1 · (−1) ≡ 1 (mod 8).

Problem 6. Let c ∈ Z and let a, b and m be positive integers with a ̸= b, and let d = gcd(a, b).
Prove or give a counter example.

(a) If the equation ax + by = c has a solution in integers, then d = c. (5 pts)

(b) If the equation ax + by = 1 has a solution in integers, then d = 1. (5 pts)

(c) If a | m, b | m and d = 1, then ab | m. (5 pts)

(d) If gcd(a, m) = 1 = gcd(m, b), then gcd(ab, m) = 1. (5 pts)

7
PWO

(e) If m | ab and d = 1, then either m | a or m | b. (5 pts)

(f) gcd(a, b, m) = gcd(d, m). (5 pts)

(g) gcd(a/d, b/d) = 1. (5 pts)

(h) If a = bq + r for some q and 0 ≤ r < b, then gcd(a, b) = gcd(b, r). (5 pts)

(i) If ac ≡ bc (mod m) then a ≡ b (mod m). (5 pts)

(j) For all n ≥ 5, gcd(7n + 3, 12n + 5) = 1. (5 pts)

(k) Let m = p1 × p2 × · · · × pk , where pi are distinct primes. If gcd(a, m) = 1 and am−1 ≡ 1


(mod pi ) for each i = 1, 2, . . . , k, then am−1 ≡ 1 (mod m). (5 pts)

Solution. (a) False. Take a = 1, b = 2 and c = 4. Then d = 2, and ax + by = c has


an integer solution (x, y) = (0, 2) clearly. But 2 = d ̸= c = 4.

(b) True. Since d | a and d | b, we have d | ax + by = 1, which implies that d = ±1.


Also, since d > 0, we have d = 1.

(c) True. Suppose that m = ak = bℓ for some k, ℓ ∈ Z. Since d = 1, there exist


u, v ∈ Z s.t. ua + vb = 1. Then

m = mua + mvb = bℓua + akvb = ab(ℓu + kv),

where ℓu + kv ∈ Z, which implies ab | m.

(d) True. Since gcd(a, m) = 1 = gcd(m, b), there exist u, v, x, y ∈ Z s.t. ua + vm =


1 = xm + yb. Then

1 = (ua + vm)(xm + yb) = (uy)ab + (uax + vyb + vmx)m,

where uy, uax+vyb+vmx ∈ Z, which implies that gcd(ab, m) = 1 by the corollary.

(e) False. Take m = 6, a = 2 and b = 3. Then d = 1 and m = 6 | 6 = ab, but


m = 6̸ | 2 = a and m = 6̸ | 3 = b.

8
PWO

(f) True. Since d = gcd(a, b), there exist x, y ∈ Z s.t. xa + yb = d. Suppose u is a


common divisor of a, b and m. Then
d xa + yb a b
= = x + y ∈ Z.
u u u u
Thus, u | d. So u is common divisor of d and m.

Also, suppose u is a common divisor of d and m. Since d | a, d | b and u | d, u | a


and u | b. So u is a common divisor of a, b, and m.

We conclude that the common divisors of a, b and m are exactly the same as the
common divisor of d and m, which implies gcd(a, b, m) = gcd(d, m).

(g) True. Note that there exist u, v ∈ Z s.t. ua + vb = gcd(a, b) = d. Then we have
a b d
u + v = = 1,
d d d
which implies that gcd(a/d, b/d) = 1 by the corollary.

(h) True.

1◦ Suppose u be a common divisor of a and b. Then u | a − bq, that is, u | r, so u


is a common divisor of b and r.

2◦ Next, suppose that u be a common divisor of b and r. Then u | bq + r, that is,


u | a, so u is a common divisor of b and a.

We therefore conclude that the common divisors of a and b are exactly the same as
the common divisor of b and r, which implies gcd(a, b) = gcd(b, r).

(i) False. Choose m = 4, a = 1, b = 3 and c = 2. Then

ac = 2 ≡ 6 = bc (mod m)

but
a = 1 ̸≡ 3 = b (mod m).

9
PWO

(j) True. For n ≥ 5, applying the Euclidean algorithm,

−3 7n + 3 12n + 5 2
6n + 3 14n + 6
−n n −2n − 1 −2
n −2n
0 −1

we have
gcd(7n + 3, 12n + 5) = |−1| = 1.

(k) True. Note that


( r )

gcd pi , pr+1 = gcd(p1 p2 · · · pr , pr+1 ) = 1 for r = 1, 2, . . . , k − 1,
i=1

and, for each i = 1, . . . , k,

am−1 ≡ 1 (mod pi ) =⇒ pi | am−1 − 1.

Then, applying 6.(3) successively, we have

p1 | am−1 − 1
p1 p2 | am−1 − 1
p1 p2 p3 | am−1 − 1
..
.
m = p1 p2 · · · pk | am−1 − 1.

Thus am−1 ≡ 1 (mod m).

10

You might also like