Solution Homework 6 M328K
by Mark Lindberg /Marie-Amélie Lawn
Problem 1:
Part 1-1, 4.1 #6:
a) 22 ≡ 9 (mod 13)
b) 100 ≡ 9 (mod 13)
c) 1001 ≡ 0 (mod 13)
d) −1 ≡ 12 (mod 13)
e) −100 ≡ 4 (mod 13)
f) −1000 ≡ 1 (mod 13)
Part 1-2, 4.1 #8:
a) 1! + 2! + 3! + · · · + 10! ≡ 1 + 2 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 mod 3 = 3 ≡ 0 mod 3
b) 1! + 2! + 3! + · · · + 10! ≡ 1 + 2 + 6 + 2 + 10 + 5 + 2 + 5 + 1 + 10 mod 11 = 44 ≡ 0
mod 11
c) 1! + 2! + 3! + · · · + 10! ≡ 1 + 2 + 2 + 0 + 0 + 0 + 0 + 0 + 0 + 0 = 5 ≡ 1 (mod 4)
d) 1! + 2! + 3! + · · · + 10! ≡ 1 + 2 + 6 + 1 + 5 + 7 + 3 + 1 + 9 + 21 = 56 ≡ 10 (mod 23)
Part 2, 4.1 #36:
2 ≡ 2 (mod 47)
22 ≡ 4 (mod 47)
23 ≡ 8 (mod 47)
24 ≡ 16 (mod 47)
28 ≡ 21 (mod 47)
216 ≡ 18 (mod 47)
232 ≡ 42 (mod 47)
264 ≡ 25 (mod 47)
2128 ≡ 14 (mod 47)
a) 232 ≡ 42 (mod 47)
b) 247 = 232+8+7 = 232 28 27 = 42 · 21 · 128 = 882 · 128 ≡ 36 · 34 = 1224 ≡ 2 (mod 47)
c) 2200 = 2128+64+8 = 2128 264 28 ≡ 14 · 25 · 21 = 350 · 21 ≡ 21 · 21 = 441 ≡ 18 (mod 47)
Part 3-1: Because n is even, there is an integer k such that n = 2k. Then, we have 2 cases: Either
k is even, or k is odd.
Case 1: k is even. Then there is an integer m such that k = 2m. Then n = 2k = 4m, and
n2 = (4m)2 = 16m2 = 8(2m2 ) ≡ 0 (mod 8), by the definition of modulus.
Case 2: k is odd. Then there is an integer p such that k = 2p + 1. Then n = 2k = 4p + 2,
and n2 = (4p+2)2 = 16p2 +16p+4 = 8(2p2 +2p)+4 ≡ 4 (mod 8), by the definition
of modulus.
1
Therefore, because we have checked all cases, we have shown that either n2 ≡ 0 (mod
8) or n2 ≡ 4 (mod 8).
Part 3-2: Because n is odd, there is an integer k such that n = 2k + 1. Then, we have 2 cases:
Either k is even, or k is odd.
Case 1: k is even. Then there is an integer m such that k = 2m. Then n = 2k +1 = 4m+1,
and n2 = (4m + 1)2 = 16m2 + 8m + 1 = 8(2m2 + m) + 1 ≡ 1 (mod 8), by the
definition of modulus.
Case 2: k is odd. Then there is an integer p such that k = 2p+1. Then n = 2k +1 = 4p+3,
and n2 = (4p + 3)2 = 16p2 + 24p + 9 = 8(2p2 + 3p + 1) + 1 ≡ 1 (mod 8), by the
definition of modulus.
Therefore, because we have checked all cases, we have shown that n2 ≡ 1 (mod 8).
Part 4: We can write our three consecutive integers as n − 1, n, and n + 1. Then we have that
(n−1)3 +n3 +(n+1)3 = n3 −3n2 +3n−1+ns+n3 +3n3 +3n+1 = 3n3 +6n = 3(n3 +2n).
Looking at the cases of n3 + 2n, we have the following: n ≡ 0 (mod 3), n ≡ 1 (mod 3),
or n ≡ 2 (mod 3).
Case 1: n ≡ 0 (mod 3). Then n3 + 2n ≡ 0 · 0 · 0 + 2 · 0 = 0 ≡ 0 (mod 3).
Case 2: n ≡ 1 (mod 3). Then n3 + 2n ≡ 1 · 1 · 1 + 2 · 1 = 1 + 2 = 3 ≡ 0 (mod 3).
Case 3: n ≡ 2 (mod 3). Then n3 + 2n ≡ 2 · 2 · 2 + 2 · 2 = 8 + 4 = 12 ≡ 0 (mod 3).
Thus, we see that in all cases, n3 + 2n ≡ 0 (mod 3). Thus, n3 + 2 can be written as 3k,
for some integer k. Then (n − 1)3 + n3 + (n + 1)3 = 3(3k) = 9k ≡ 0 (mod 9).
Problem 2
Part 1, 4.1 # 26 By definition, since ak ≡ bk (mod m), m | ak − bk .
By the definition of divisors, there is therefore an integer p such that ak − bk = pm.
Then bk = ak − pm.
Similarly, because ak+1 ≡ bk+1 (mod m), there exists an integer q such that ak+1 −bk+1 =
qm. Then,
ak+1 −bk+1 = ak+1 −b·bk = ak+1 −b(ak −pm) = a·ak −b·ak +bpm = ak (a−b)+bpm = qm,
and then ak (a − b) = m(q − bp). Then we know that, because q − bp is an integer by the
closure of the integers under addition and multiplication, and the definition of divisors,
m | ak (a − b). But since (m, a) = 1, m and a have no common factors, and thus, m
and ak have no common factors, so we have that m | (a − b). This means that, by the
definition of congruence, we have that a ≡ b (mod m).
This is not true if (a, m) 6= 1. For example, let k = 2, a = 6, b = 0, and m = 12. Then
62 = 36 ≡ 0 = 02 (mod 12) and 63 = 216 ≡ 0 = 03 (mod 12), but 6 6≡ 0 (mod 12).
Part 2, 4.1 # 44 Base case: k = 2. We have to show that if a ≡ b (mod m), then a2 ≡ b2 (mod m).
From the assumptio, and the definition of congruence, we know that m | (a − b), and so
there is an integer p such that a − b = pm by the definition of divisors.
Moreover, we have that a2 − b2 = (a − b)(a + b) = pm(a + b) = m(pa + pb).
2
Because p, a, and b are integers, pa + pb is an integer by the closure of the integers under
addition and multiplication, so m | a2 − b2 by the definition of divisors. Thus, by the
definition of congruence, a2 ≡ b2 (mod m).
Inductive step: Here, I use strong induction, and k ≥ 3. I am assuming that we have at
least the two previous cases to be true. (In the case of k = 3, we have the given, where
k = 1, and the shown base case, for k = 2. Then we prove k = 3, and have both k = 2
and k = 3 cases for when k = 4, and so on.)
We have that ak ≡ bk (mod m) and ak−1 ≡ bk−1 (mod m). Thus, by the definitions of
mod and divides, there are integers x and y such that ak −bk = xm and ak−1 −bk−1 = ym.
Solving the first one for various variables, we have that ak = xm + bk and bk = ak − xm.
Then we have that
ak+1 − bk+1 = a · ak − b · bk = a(xm + bk ) − b(ak − xm) = axm + abk − bak + bxm
= m(ax + bx) + ab(bk−1 − ak−1 ) = m(ax + bx) + ab(−ym)
= m(ax + bx − aby).
Thus, because ax + bx − aby is an integer by the closure of integers under addition and
multiplication, we have that m | ak+1 − bk+1 by the definition of divides, and so, by the
definition of modulus, ak+1 ≡ bk+1 (mod m).
Problem 3:
Part 1: Let (x0 , y0 ) be a solution of the equation 5x2 + 3 = y 2 . Then y02 − 3 = 5x2 and 5|y02 − 3.
This means that y02 = 3 mod 5. Now any integer y0 ≡ 0, 1, 2, 3, or 4 mod 5. Hence
y02 ≡ 0, 1, 4, 9 or 16 mod 5 or equivalently since 9 ≡ 4 mod 5 and 16 ≡ 1 mod 5, we
have that y02 ≡ 0, 1 or 4 mod 5 for all integers. Hence the equation has no solutions.
Part 2-1: Obviously n(n − 1) and n(n + 1) are even, therefore we have 2|n(n − 1) and 2|n(n + 1).
Hence m = n2 (n2 − 1) = n(n − 1)n(n + 1) is divisible by 4. Since any integer n ≡ 0, 1
or 2 mod 3, m ≡ 0 mod 3. In fact we have
Case 1: n ≡ 0 (mod 3). Then n2 (n2 − 1) ≡ 0 ∗ 0(0 ∗ 0 − 1) = 0 ∗ −1 = 0 (mod 3).
Case 2: n ≡ 1 (mod 3). Then n2 (n2 − 1) ≡ 1 ∗ 1(1 ∗ 1 − 1) = 1 ∗ 0 = 0 (mod 3).
Case 3: n ≡ 2 (mod 3). Then n2 (n2 − 1) ≡ 2 ∗ 2(2 ∗ 2 − 1) = 4 ∗ 3 = 12 ≡ 0 (mod 3).
Hence m is divisible by 3 and consequently m is divisible by 3 and 4. But (3, 4) = 1,
hence m is divisible by 3.4 = 12.
Part 2-2: Now we have that r = n2 (n4 − 1) = n2 (n2 − 1)(n2 + 1). We showed in the first part
of the problem that 12|n2 (n2 − 1), hence 12|n2 (n4 − 1). But we know that any integer
n ≡ 0, 1, 2, 3, 4 mod 5, and for each of these cases we can easily see that r ≡ 0 mod 5.
In fact we have
Case 1: n ≡ 0 (mod 5). Then n2 (n4 − 1) ≡ 02 (04 − 1) = 0 ∗ −1 = 0 (mod 5).
Case 2: n ≡ 1 (mod 5). Then n2 (n4 − 1) ≡ 12 (14 − 1) = 1 ∗ 0 = 0 (mod 5).
Case 3: n ≡ 2 (mod 5). Then n2 (n4 − 1) ≡ 22 (24 − 1) = 4 ∗ 15 = 60 ≡ 0 (mod 5).
Case 4: n ≡ 3 (mod 5). Then n2 (n4 − 1) ≡ 32 (34 − 1) = 9 ∗ 80 = 720 ≡ 0 (mod 5).
3
Case 4: n ≡ 3 (mod 5). Then n2 (n4 − 1) ≡ 32 (44 − 1) = 9 ∗ 255 = 2295 ≡ 0 (mod 5).
Hence r is divisible by 5 and therefore by 12 and 5. But (5, 12) = 1. Hence r is divisible
by 12.5 = 60.
Part 3: 3x + 7y is a multiple of 11. In other words, this means that 3x ≡ −7y mod 11. But
trivially 5 ≡ 5 mod 11. Hence using the multiplication rule we saw in class, we get
15x ≡ −35y mod 11. But 15x ≡ 4x mod 11 and −35y ≡ 9y mod 11, which gives the
result.
Problem 4
Part 1: ac ≡ bc (mod n) means that there is an integer m such that ac − bc = c(a − b) = mn by
the definitions of modulus and divisors. Thus, because a − b is an integer by the closure
of integers under addition, we have that c | mn by the definition of divides. But we
know that (c, n) = 1, and so no factor of c is also a factor of n. As shown in a previous
homework, this means than c | m. Thus, there is an integer x such that m = cx. Then
c(a − b) = cxn, so a − b = xn, meaning that, by the definition of divisors, n | a − b, so
a ≡ b (mod n) by the definition of modulus.
Part 2: If cx ≡ cx0 mod n, with x, x0 in S, then using part 1 x ≡ x0 mod n. But S is a
complete set of residues. Hence this implies that x = x0 . Hence all the elements of cS
have distinct reductions modulo n. It follows, since the set cS has n distinct elements,
that cS is a complete set of residues modulo n.
Part 3: Let S be a complete set of residue modulo n. Then there exists a unique element of S
that is congruent to b modulo n. Using part 2, we know that cS is also a complete set
of residues modulo n. Hence there is a unique element cx in cS that is congruent to b
modulo n and we have cx ≡ b mod n.
Problem 5
Part 1: If p is not prime, then either p is a perfect square, or p is not a perfect square.
If p is not a perfect square, then p can be factored as integers a·b = p, with 1 < a < b < p,
a 6= b. Then because (p − 1)! is the product of all positive integers less than p, a and
b are in the factorization of (p − 1)!, and we have that, by the definition of divisors,
p | (p − 1)!. Then, by the definition of congruence, (p − 1)! ≡ 0 (mod p).
Else, p is a perfect square, so there is some integer a such that 1 < a < p and a2 = p.
We have two cases. Either p = 4, but then 3! = 6 ≡ 2 6≡ −1 (mod 4) and the statement
is true, or p > 4. In the last case a > 2, so a2 = p > 2a, so we have that both a, 2a < p
and so, by the same reasoning as above, they must both be factors of (p − 1)!. Hence,
by the definition of divisors, p = a2 | a.2a | (p − 1)! and so p | (p − 1)!.
Thus, we have that, if p > 4 and p is a perfect square, by the definition of modulus,
(p − 1)! ≡ 0 (mod p). Hence, in all cases where p is not prime, (p − 1)! 6≡ −1 (mod p).
Part 2: For each integer 0 < a < p, since p is prime, gcd(a, p) = 1 and we know from the lecture
that there is a unique solution b modulo n to the linear congruence ab ≡ 1 (mod p).
Let b be the smallest nonnegative residue in the class of solutions. Then, b < p as well,
and so we have two cases. Either a = b or a 6= b.
4
If a = b, then ab = a2 ≡ 1 (mod p), so p | (a2 − 1) = (a + 1)(a − 1). Then, because p
is prime and a < p, we have either that p | (a + 1) or p | (a − 1) and so we have that
a = p − 1 or a = 1.
Hence we know that for each number a in the set S = {2, 3, 4 · · · (p − 2)} there exists a
unique number b in S with b 6= a such that ab ≡ 1 mod p and every number in our set
has an inverse modulo p, also in the set. Obviously there is an even number of element
in the set, (in fact p is a prime greater than 2, so it is odd, and so p − 2 is odd, and
p − 2 − 2 + 1 = p − 3 elements in the set is an even number.) Thus, pairing all the
inverses one at a time, we get 2 · 3 · 4 · · · (p − 3) · (p − 2) ≡ 1 · 1 · 1 · · · 1 · 1 = 1 (mod p).
Part 3: By the previous part, we have that if p is prime
2 · 3 · 4 · · · (p − 3) · (p − 2) ≡ 1
mod p.
Note that 1 · (p − 1) = p − 1 ≡ −1 mod p. Hence we get
(p − 1)! = (p − 1)(p − 2)(p − 3).4.3.2.1 ≡ −1.1 ≡ −1
mod p.
By part 1, we showed that if p is prime, then (p − 1)! 6≡ 1 (mod p), and now we have
both necessary and sufficient conditions, and can say that (p − 1)! ≡ −1 (mod p) if (part
3) and only if (part 1) p is prime.
Problem 6
Part 1, 4.2 # 14:
a) 2x + 3y ≡ 1 (mod 7). We have that (2, 3) = 1 = 2(−1) + 3(1), so let z = 2x + 3y.
Then z ≡ 1 (mod 7) is a regular problem in one variable. Then we have that there
is an integer p such that z − 1 = 7p, or z − 7p = 1. We have that (1, 7) = 1 =
1(−6) − 7(−1), so z0 = −6, and p0 = −1, so the general solutions are of the form
{(−6+7k, 7−k), k ∈ Z}. Then 2x+3y = −6+7k, so x0 = 6−7k, y0 = −6+7k, and
so our solution set is of the form (x, y) = {(6 − 7k − 3`, −6 + 7k + 2`), k, ` ∈ Z} .
b) 2x + 4y ≡ 6 (mod 8). We have that (2, 4) = 2 = 2(−1) + 4(1), so let z = x + 2y.
Then 2z ≡ 6 (mod 8) is a regular problem in one variable. Then we have that
there is an integer p such that 2z − 6 = 8p, or 2z − 8p = 6. We have that
(2, 8) = 2 = 2(1) − 8(0), so z0 = 3, and p0 = 0, so the general solutions are of the
form {(3 + 8k, 2k), k ∈ Z}. Then x + 2y = 3 + 8k, so x0 = −3 − 8k, y0 = 3 + 8k, and
so our solution set is of the form (x, y) = {(−3 − 8k − 2`, 3 + 8k + `), k, ` ∈ Z} .
c) 6x + 3y ≡ 0 (mod 9). We have that (6, 3) = 3 = 6(1) + 3(−1), so let z = 2x + y.
Then 2z ≡ 0 (mod 9) is a regular problem in one variable. Then we have that
there is an integer p such that 2z = 9p, or 2z − 9p = 0. We have that (2, 9) =
1 = 2(−4) − 9(−1), so z0 = 0, and p0 = 0, so the general solutions are of the form
{(9k, 2k), k ∈ Z}. Then 2x + y = −4 + 9k, so x0 = 9k, y0 = −9k, and so our
solution set is of the form (x, y) = {(9k − `, −9k + 2`), k, ` ∈ Z} .
d) 10x+5y ≡ 9 (mod 15). We have that (10, 5) = 5 = 10(1)+5(−1), so let z = 2x+y.
Then 5z ≡ 9 (mod 15) is a regular problem in one variable. Then we have that
there is an integer p such that 5z − 9 = 15p, or 5z − 15p = 9. We have that
(5, 15) = 5 = 5(−2) + 15(1). But 5 does not divide 9, so there are no solutions.
5
Part 2, 4.2 # 16: If x2 ≡ 1 (mod 2k ), by the definition of congruence, 2k | x2 = (x + 1)(x − 1).
Hence, if the equation has a solution, the prime factor 2 divides x + 1 or x − 1. But
either way, this means that x + 1 and x − 1 are both even, and x must therefore be odd.
Equivalently, there exists some integer m such that x = 2m + 1. Then we have that
2k = 2k−2 .4 | (2m + 1 + 1)(2m + 1 − 1) = (2m + 2)(2m) = (4m)(m + 1), assuming k > 2
and we have finally that 2k−2 | m(m + 1).
Problem 7:
2n
. But (n, n + 1) = 1, consequently
, hence n + 1| 2n
= n 2n
1) Clearly (n + 1) n+1
n
n
2n
n + 1| n .
p!
2) We now that kp = k!(p−k)!
is an integer. Hence k!(p − k)!|p! = p(p − 1)!. But we know
(p−1)!
k!(p−k)!
that p is prime. Hence k!(p − k)!|(p − 1)! and
(p−1)!
Consequently p| kp = p. k!(p−k)!
.
is an integer.
3) We use induction. For n = 1 the result is trivially satisfied.
Induction hypothesis. Suppose np ≡ n mod p.
Induction step. We want to show that (n + 1)p ≡ n + 1 mod p. We have
p−1 X
p k
n ≡ np + 1 mod p,
(n + 1) = n + 1 +
k
k=1
p
using the result of part 2 since p| k is equivalent to kp ≡ 0 mod p.
But by the induction hypothesis np ≡ n mod p, which proves the result.
p
p
4) Again we use induction, this time over m.
Base step m = 1.
This is an example where the base step is actually not trivial. We have to show
n
X
xi
p
=
i=1
n
X
xpi
mod p.
i=1
For this purpose we use a second induction, but this time over n. The base case n = 1
is trivial. For n = 2 we have
p−1 X
p k p−k
p
p
p
(x1 + x2 ) = x1 + x2 +
x1 x2 ≡ xp1 + xp2 ,
k
i=1
using the same argument
in part
p 2.
Pas
P
n
Induction hypothesis:
= ni=1 xpi mod p.
i=1 xi
We want to show
n+1
X p n+1
X p
xi =
xi mod p.
i=1
i=1
We have
n+1
X
i=1
xi
p
=
n
X
xi + xn+1
i=1
p
≡
n
X
i=1
6
xi
p
+ xpn+1
mod p,
using the case n=2 and finally, using the induction hypothesis
n+1
X
xi
p
i=1
=
n
X
xpi + xpn+1 =
i=1
n+1
X
xpi ,
i=1
which proves the base step m = 1.
Induction hypothesis: We assume that
n
X
xi
p m
≡
i=1
n
X
xpi
m
mod p.
i=1
Now we have by the induction hypothesis and using the case m = 1
n
X
xi
pm+1
=
i=1
n
X
xi
p m p
≡
i=1
≡
n
X
pm
n
X
xpi
m
p
mod p (I.H.)
i=1
p
(xi )
mod p ≡
i=1
n
X
i=1
which proves the statement.
7
xpi
m+1
mod p
(case m=1),
© Copyright 2026 Paperzz