M3P14 EXAMPLE SHEET 1 SOLUTIONS 1a. Show that for a, b, d

M3P14 EXAMPLE SHEET 1 SOLUTIONS
1a. Show that for a, b, d integers, we have (da, db) = d(a, b).
Since (a, b) divides both a and b, d(a, b) divides both da and db, and hence
divides (da, db). On the other hand, there exist m and n such that (a, b) =
ma + nb. Then d(a, b) = mda + ndb. Since (da, db) divides both da and
db, and d(a, b) is a linear combination of da and db, we have (da, db) divides
d(a, b). Thus (da, db) and d(a, b) are equal.
n
1b. Let n, a, b be integers and suppose that n divides a, b. Show that (n,a)
n
a
divides b. Let n0 = (n,a)
, and a0 = (n,a)
. Both are integers. Since n divides
ab, we have nk = ab for some integer k, and dividing by (n, a) we find
that n0 k = a0 b; that is, n0 divides a0 b. But (n, a) = ((n, a)n0 , (n, a)a0 ) =
(n, a)(a0 , n0 ) by part 1a, so (a0 , n0 ) = 1. Thus n0 divides b by a result from
lecture.
2a. Express 18 as an integer linear combination of 327 and 120.
We have:
327
120
87
33
21
12
=
=
=
=
=
=
2(120) + 87
1(87) + 33
2(33) + 21
1(21) + 12
1(12) + 9
1(9) + 3
Therefore:
3 =
=
=
=
=
=
=
=
=
=
=
12 − 9
12 − (21 − 12)
2(12) − 21
2(33 − 21) − 21
2(33) − 3(21)
2(33) − 3(87 − 2(33))
8(33) − 3(87)
8(120 − 87) − 3(87)
8(120) − 11(87)
8(120) − 11(327 − 2(120))
30(120) − 11(327)
1
2
M3P14 EXAMPLE SHEET 1 SOLUTIONS
We thus have 18 = 180(120) − 66(327).
2b. Find, with proof, all solutions to the linear diophantine equation 110x +
68y = 14.
We have:
110
68
42
26
16
10
6
=
=
=
=
=
=
=
1(68) + 42
1(42) + 26
1(26) + 16
1(16) + 10
1(10) + 6
1(6) + 4
1(4) + 2
We have (110, 68) = 2; unwinding the above we find 2 = −21(110) + 34(68).
So 14 = −147(110) + 238(68) and one solution is x = −147, y = 238. The
remaining solutions have the form −147 − 34n, 238 + 55n for any integer n.
2c. Find a multiplicative inverse of 31 modulo 132.
We must write 1 as a linear combination of 31 and 132. By Euclid’s algorithm,
132 = 4(31) + 8
31 = 3(8) + 7
8 = 7+1
Thus:
1 = 8−7 = 8−(31−3(8)) = 4(8)−31 = 4(132−4(31))−31 = 4(132)−17(31).
In particular −17(31) is congruent to 1 mod 132, so −17 is the desired
inverse.
2d. Find an integer congruent to 3 mod 9 and congruent to 1 mod 49.
Note that 1 = 11(9) − 2(49). Thus −98 is congruent to 1 mod 9 and 0 mod
49, and 99 is congruent to 0 mod 9 and 1 mod 49. Thus 3(−98) + 99 = −195
is congruent to 3 mod 9 and 1 mod 49.
2e. Find, with proof, the smallest nonnegative integer n such that n ≡ 1
(mod 3), n ≡ 4 (mod 5), and n ≡ 3 (mod 7).
We have 1 = 2(3)−5, so 4(2(3))−5 = 19 is congruent to 1 mod 3 and 4 mod 5.
So is 4. We thus know that n ≡ 4 (mod 15) by the uniqueness in the Chinese
Remainder Theorem. We have 1 = 15 − 2(7), so −2(4(7)) + 3(15) = −11 is
congruent to 4 (mod 15) and 3 (mod 7). Thus n is congruent to −11 (mod
105) by the Chinese remainder theorem. Since 94 is the smallest positive
integer congruent to −11 mod 105, we must have n = 94.
3. Let m and n be integers. Show that the greatest commond divisor of m
and n is the unique positive integer d such that:
M3P14 EXAMPLE SHEET 1 SOLUTIONS
3
• d divides both m and n
• if x divides both m and n, then x divides d.
(In other rings, we will take these properties to be the definition of greatest
common divisor.)
It is clear that (m, n) divides both m and n. Conversely, suppose x divides
both m and n. Writing (m, n) = am + bn for some integers a and b we see
that x divides (m, n) as well. For uniqueness, suppose there were another
integer d with these properties. Then d divides m and n, so it divides (m, n).
Similarly, (m, n) divides m and n so it divides d. Thus d = ±(m, n), and if
d is positive it must equal (m, n).
4. Least Common Multiples
4a. Let a and b be nonzero integers. Show that there is a unique positive
integer m with the following two properties:
• a and b divide m, and
• If n is any number divisible by both a and b, then m|n.
The number m is called the least common multiple of a and b.
We first show that m is unique. Let n be another positive integer with the
same properties. Then a and b divide n by the first property (of n), so by
the second property (of m) we have m|n. Similarly, by the first property (of
m) and the second property (of n) we have n|m. So m = ±n, but both are
positive, so m = n.
Existence of m will follow from part 2b, below:
|ab|
.
4b. Show that the least common multiple of a and b is given by (a,b)
|ab|
b
It is clear that (a,b)
is positive. It is divisible by a because (a,b)
is an integer,
and similarly is divisible by b. We must thus show that if a and b divide n,
|ab|
a
b
n
a
then so does (a,b)
. If a, b divide n, then (a,b)
and (a,b)
divide (a,b
). But (a,b)
b
are relatively prime, so their product
and (a,b)
divides n.
ab
(a,b)2
divides
n
(a,b) .
Thus
ab
(a,b)
5. Let m and n be positive integers, and let K be the kernel of the map:
Z/mnZ → Z/mZ × Z/nZ
that takes a class mod mn to the corresponding classes modulo m and n.
Show that K has (m, n) elements. What are they?
If a lies in K, then a ≡ 0 (mod m) and a ≡ 0 (mod n). Thus both m and n
mn
divide a, so by question 4, the least common multiple d = (m,n)
of m and n
mn
divides a. On the other hand it is clear that any multiple of (m,n) lies in K.
Thus K consists precisely of these multiples. Modulo mn these multiples
fall into the classes [d], [2d], . . . [d(m, n)] = [0]. There are thus (m, n) such
classes, so K has (m, n) elements as claimed.
6. Show that the equation ax ≡ b (mod n) has no solutions if b is not
divisible by (a, n), and exactly (a, n) solutions in Z/n otherwise.
4
M3P14 EXAMPLE SHEET 1 SOLUTIONS
If ax ≡ b (mod n), then ax − b = kn for some integer k. Since both ax and
kn are divisible by (a, n), b must be as well.
Suppose that b is divisible by (a, n). Then solving ax − b = kn is the same
a
b
n
as solving cx − d = km, where c = (a,n)
, d = (a,n)
, m = (a,n)
. Since c and m
are relatively prime, this equation has a unique solution y modulo m. Thus
any x that is congruent to y modulo m is a solution. Since there are (a, n)
congruence clases modulo n that are congruent to a given congruence class
mod m, we are done.
7. For n a positive integer, let σ(n) denote the sum
P
d of the positive
d|n,d>0
divisors of n. Show that the function n 7→ σ(n) is multiplicative.
We must show that σ(nm) = σ(n)σ(m) whenever m and n are relatively
prime. Let d be a divisor of mn, and set e = (d, m), f = de . Then e and f are
integers, and e divides m. Since (e, n) = (d, m, n) = 1, e and n are relatively
prime. Thus f divides n by 1b above, and f and m are relatively prime. The
map that takes a divisor d to the corresponding e, f is a bijection between
divisors of mn and pairs consisting of a divisor of m and a divisor of n. We
thus have:
X
X
X
d=
ef.
d|mn,d>0
e|m,e>0 f |n,f >0
Factoring the right-hand side, we find that it is equal to the product:



X
X

e 
f  = σ(m)σ(n)
e|m,e>0
f |n,f >0
as claimed.
2
8. Let p be a prime, and a be any integer. Show that ap +p+1 is congruent
to a3 modulo p.
Note that if p does not divide a, then ap−1 ≡ 1 (mod p), so ap ≡ a (mod p).
If p does divide a, then a and ap are both 0 (mod p). Thus ap ≡ a (mod p)
2
2
2
for all a. Now ap = (ap )p ≡ ap ≡ a (mod p). Thus ap +p+1 = ap ap a ≡ a3
(mod p).
9. Let n be a squarefree positive integer, and suppose that for all primes
p dividing n, we have (p − 1)|(n − 1). Show that for all integers a with
(a, n) = 1, we have an ≡ a (mod n).
Since n is squarefree, it is the product of the primes that divide it. Therefore,
by the uniqueness part of the Chinese remainder theorem, it suffices to show
that an ≡ a (mod p) for all p dividing n. Since (a, n) = 1, p does not divide
a, and so ap−1 ≡ 1 (mod p). Since (p − 1)|(n − 1), we have n = 1 + k(p − 1)
for some k. Then an = a(ap−1 )k ≡ a (mod p) as claimed.
M3P14 EXAMPLE SHEET 1 SOLUTIONS
10. Let n be a positive integer. Show that the sum
P
5
Φ(d) is equal to
d|n,d>0
n.
For any positive integer a less than or equal to n, (a, n) is a positive divisor
d of n. It follows (since n is the number of positive integers less than or
equal to n) that we have:
X
n
#{a : 1 ≤ a ≤ n, (a, n) = }.
n=
d
d|n,d>0
Therefore, it suffices to show that the number of positive integers a between
1 and n with (a, d) = nd is Φ(d). But multiplication by nd gives a bijection
between the set of positive integers b with 1 ≤ b ≤ d and (b, d) = 1, and the
set of positive integers a with 1 ≤ a ≤ n and (a, n) = nd . Thus these sets
both have Φ(d) elements.
NOTE: this can also be done by induction on the number of primes dividing
n.