18.781 Practice Final Exam #1
Exercise 1. If m and k are positive integers, prove that the number of positive integers less than or
equal to mk that are coprime to m is kφ(m).
Solution
In every m consecutive integers there are φ(m) numbers coprime to m. Hence, between 1 and km there
are kφ(m) numbers coprime to m.
Exercise 2. For what integers a, b does the following system of equations admits integer solutions?
x + 2y + 3z = a
.
x + 4y + 9z = b
Solution
The complete matrix associated to the system is
1 2
1 4
3
9
a
b
After elementary row and column operations we get
1 2 3 a
1 2 3 a
1
→
→
1 4 9 b
0 2 6 b−a
0
Hence, the system has solutions if and only if 2 b − a.
0
2
0
0
a
b−a
Exercise 3. Does the congruence x2 ≡ 135 mod (997) admit solutions?
Solution
Note that 997 is prime ≡ 1 (4). So, we need to look at the Legendre symbol
135
997
52
4
13
13
135
5
13
8
2
=
=
=
=
=
=
=
=
=
= −1
997
135
135
135 135
135
13
13
5
5
5
So, there are no solutions.
Exercise 4. Show that if 23a2 ≡ b2 mod (17), then 23a2 ≡ b2 mod (289).
Solution
We have
23
6
2
3
3
17
2
=
=
=
=
=
= −1
17
17
17 17
17
3
3
−1 2
Hence, 23 is not a squer modulo 17. But
17 ) mod (17),
if it were (a,17) = 1, we would have
232 ≡ (b[a]
2
2
which is impossible. So it must be 17 a. But then 17 b, and therefore 17 23a − b .
Exercise 5. Let p ≥ 11 be prime. Show that for some n ∈ {1, . . . , 9}, both n and n + 1 are quadratic
residues mod p.
Solution
If 2 is a quadratic residue mod p, then 1 and 2 are consecutive quadratic residues. If 5 is a quadratic
residue mod p, then 4 and 5 are consecutive quadratic residues. If 2 and 5 are not quadratic residues,
then 9 and 10 are consecutive quadratic residues.
Exercise 6. Find all integer solutions of the equation 37x + 41y = −3
Solution
We have, by euclidean algorithm 10∗37−9∗41 = 1. Hence, the solutions are x = −30+41k, y = 27−37k,
for k ∈ Z.
Exercise 7. Find all solutions of the congruence equation x2 + 3x + 18 ≡ 0 mod 28.
1
Solution
We need to figure out the solutions mod 4 and mod 7, and apply the CRT. Modulo 4 we have
x2 + 3x + 18 ≡ x2 + 3x + 2 ≡ (x + 1)(x + 2) mod (4)
It’s easy to see this has the only solutions x ≡ −1, −2 mod (4). Modulo 7 we have
x3 + 3x + 18 ≡ x2 − 4x + 4 ≡ (x − 2)2 ≡ 0 mod (7)
So just one solution x ≡ 2 mod (7). To find the solution mod 28, we use 2 ∗ 4 + (−1) ∗ 7 = 1.
Then combining -1 and 2 wehave (−1) ∗ (−1) ∗ 7 + 2 ∗ 2 ∗ 4 = 23. Combining −2 and 2 we have
(−2) ∗ (−1) ∗ 7 + 2 ∗ 2 ∗ 4 = 30 ≡ 2 mod (28).
Exercise 8. Show that the equation x2 + 2y 2 = 8z + 5 has no solutions in integers.
Solution
Looking mod 8, we have x2 + 2y 2 ≡ 5 mod (8). Now, further looking mod 2, we see that x must be odd.
So x2 ≡ 1 mod (8), which forces 2y 2 ≡ 4 mod 8. This is impossible, since if y is even, then 2y 2 ≡ 0 mod
8, and if y is odd, then 2y 2 ≡ 2 mod 8.
Exercise 9. Compute h12, 24i.
Solution
√
Let θ = h24i = 24 + θ1 . Then θ2 − 24θ − 1 = 0, so θ = 12 + 145 (plus sign because θ > 0). Therefore
ξ = h12, 24i = 12 +
√
12 − 145 √
1
1
√
= 12 +
= 12 +
= 145
θ
144 − 145
12 + 145
Exercise 10. If θ and θ0 are real nomber with continued fraction expansion of the form θ = h3, 1, 5, 7, a1 , a2 , . . . i,
49
.
and θ0 = h3, 1, 5, 7, b1 , b2 , . . . i, prove that |θ − θ0 | < 7095
Solution
Recall that
θ0 = h3i < θ2 = h3, 1, 5i < θ, θ0 < θ3 = h3, 1, 5, 7i < θ1 = h3, 1i
Therefore
|θ − θ0 | < θ3 − θ2 = h3, 1, 5, 7i − h3, 1, 5i = 3 +
1
1+
2
1
5+ 71
−3−
1
1+
1
5
=
36 5
1
49
− =
<
43 6
258
7095
© Copyright 2026 Paperzz