MATH 3240 - Introduction to Number Theory - FIRST MIDTERM
Show all work. No calculators. There are 2 theory questions and 4 additional
problems.
———————–
Theory Question 1. (20 points) Let u, v be integers. Prove that if q is a prime and q divides
the product u · v, then q divides u or q divides v. (You may assume the following theorem:
the linear equation ax + by = c has a solution if and only if gcd(a, b) divides c).
Proof. Suppose q divides uv but q does not divide u. Then gcd(q, u) = 1 (otherwise, there
is d > 1 such that d|q and d|u, and since q is prime d = q but q does not divide u). By the
theorem above, there exist x, y ∈ Z such that
ux + qy = 1.
Multiplying this equation by v gives:
(uv)x + (qv)y = v.
Since q divides uv and q obviously divides qv, then q divides any linear combination of uv
and qv. Hence q divides v = (uv)x + (qv)y.
Theory Question 2. (20 points) You may assume the fundamental theorem of arithmetic
and any property about congruences proved in class.
(1) Justify: if p ≡ 1(mod 3) and q ≡ 1(mod 3) then pq ≡ 1(mod 3).
(2) Show that if N ≡ 2(mod 3) then N has a prime factor p such that p ≡ 2(mod 3).
(3) Suppose q1 , . . . , qk are primes such that qi ≡ 2(mod 3) for all 1 ≤ i ≤ k. Let us define
N = 3q1 · · · qk − 1. Show that N has a prime factor p such that p ≡ 2(mod 3) and p
is distinct from any of the primes q1 , . . . , qk .
(4) Prove that there exist infinitely many primes p of the form p ≡ 2(mod 3).
Proof.
(1) We know from class that if a ≡ b(mod m) and c ≡ d(mod m) then ac ≡
bd(mod m). Therefore if p ≡ q ≡ 1(mod m) then
pq ≡ 1 · 1 ≡ 1 mod m.
(2) By part (1), if two numbers are congruent to 1 modulo 3 then their product also is
1 mod 3. Let N ≡ 2(mod 3) have a prime factorization N = p1 · · · pr . Note that since
N ≡ 2(mod 3) then N is not divisible by 3. Thus, by part (1), some prime divisor pi
must be ≡ 2(mod 3), otherwise N ≡ 1(mod 3).
(3) Let N = 3q1 · · · qk − 1 with qi ≡ 2(mod 3). Note that N ≡ −1 ≡ 2(mod 3). Thus,
by part (2) there is a prime divisor p of N such that p ≡ 2(mod 3). Suppose p = qi .
Then p divides N and p divides 3q1 · · · qk , and so p divides −1, hence a contradiction
and p 6= qi .
(4) Suppose that there are only finitely many primes q1 , . . . , qk which are congruent to 2
modulo 3. Then N = 3q1 · · · qk − 1 has a prime divisor p ≡ 2(mod 3) which is distinct
from all q1 , . . . , qk . Contradiction.
Problem 1. (15 points) Use Euclid’s algorithm to:
(1) Find the greatest common divisor of 7 and 9.
(2) Find all solutions of the linear diophantine equation 7x + 9y = 1.
(3) Solve the congruence 7x ≡ 1 mod 9
(4) Solve the congruence 9x ≡ 1 mod 7.
1
2
Proof.
(1) One has 9 = 7 + 2 and 7 = 2 · 3 + 1. Therefore the gcd is 1.
(2) Now work backwards. One has 1 = 7 − 2 · 4 = 7 − 3(9 − 7) = 4 · 7 − 3 · 9. Hence
1=4·7−3·9
is a solution. Since gcd(7, 9) = 1 by a theorem in class all solutions to 1 = 7x + 9y
are given by:
x = 4 − 9t,
y = −3 + 7t,
for any t ∈ Z.
(3) and (4) Since 1 = 4 · 7 − 3 · 9 we get 4 · 7 ≡ 1 mod 9 and 9 · (−3) ≡ 9 · 4 ≡ 1 mod 7. Thus,
x ≡ 4 mod 9 and x ≡ −3 mod 7 are the solutions to the congruences.
Problem 2. (15 points) Let N = 9 · 367 + 5 · 365 + 7 · 362 + 7.
(1) Is N divisible by 2 or 3? Explain.
(2) Is N divisible by 5 or 7? Explain.
(3) Is N divisible by 37? Explain.
(1) Note that 36 ≡ 0 mod 2 and mod3. Thus N ≡ 0 + 0 + 0 + 7 ≡ 1 mod 2 and
mod3. Thus, 2 and 3 do not divide N .
(2) Notice that 36 = 1 + 5 · 7, thus 36 ≡ 1 modulo 5 or 7. Now:
Proof.
N ≡ 9 + 5 + 7 + 7 ≡ 4 + 0 + 2 + 2 ≡ 8 ≡ 3 mod 5
N ≡ 9 + 5 + 7 + 7 ≡ 14 + 0 + 0 ≡ 0 mod 7
and so N is not divisible by 5 but 7 divides N .
(3) Here we use the fact that 36 ≡ −1(mod 37) to calculate:
N ≡ 9(−1)7 + 5(−1)5 + 7(−1)2 + 7 ≡ −9 − 5 + 7 + 7 ≡ 0 mod 37.
Hence 37|N .
Problem 3. (15 points) Provide a full explanation:
(1) Is 17100 − 16 divisible by 15? Explain.
(2) Show that a square number n2 must be congruent to 0, 1 or 4 modulo 5, but it cannot
be congruent to 2 or 3 mod 5.
(3) Use part (2) to prove that the equation x2 − 5y 2 = 13 has no solutions x, y ∈ Z.
Proof.
(1) Since 17 ≡ 2 mod 15 and 16 ≡ 1 mod 15 we get:
17100 − 16 ≡ 2100 − 1 mod 15.
Moreover, 24 ≡ 16 ≡ 1 mod 15. Therefore:
2100 ≡ (24 )25 ≡ (1)25 ≡ 1 mod 15.
Thus: 17100 − 16 ≡ 2100 − 1 ≡ 1 − 1 ≡ 0 mod 15 and, therefore, it is divisible by 15.
(2) n must be congruent to 0, 1, 2, 3 or 4 modulo 5, because {0, 1, 2, 3, 4} is a complete set
of representatives modulo 5. Thus n2 must be equivalent to 02 , 12 , 22 , 32 or 42 modulo
5, and those are, in order: 0, 1, 4, 4 or 1 modulo 5. Thus, every square is either 0, 1 or
4, and no square can be 2 or 3 modulo 5.
3
(3) Suppose x2 − 5y 2 = 13 has a solution x, y ∈ Z. Then, reduce modulo 5:
x2 ≡ 13 ≡ 3 mod 5
but we have just proved that no square can be congruent to 3 modulo 5. Contradiction,
thus such solution cannot exist.
Problem 4. (15 points) (True/False/No answer) For each of the following, circle the correct
answer (+3) pts or circle NA (“No Answer”, 0 pts) to avoid being penalized for a wrong
answer (−1 pts). Justification is not required. Read the statements carefully.
a. For a, b ∈ Z, if there exist x, y ∈ Z
such that ax + by = 5 then gcd(a, b) = 5.
True False NA
b. The congruence 11x ≡ 14 mod 35 is solvable.
True False NA
c. The congruence 15x ≡ 6 mod 18 has 3 solutions modulo 18.
True False NA
d. If ax ≡ 1 mod b has a solution, then bx ≡ 1 mod a has a solution. True False NA
e. For a, b, c ∈ Z, if a|c and b|c, then (a + b)|c.
Proof.
True False NA
(a) FALSE. For example, a = 3, b = 2, x = 5, y = −5:
5·3−5·2=5
(b)
(c)
(d)
(e)
but the GCD of a = 3 and b = 2 is equal to 1. From ax + by = 5 having a solution
one can only deduce that the GCD of a and b divides 5 but it is not necessarily equal
to 5.
TRUE, because gcd(11, 35) = 1 and therefore the congruence 11x ≡ 14 mod 35 will
have a solution. The solution is x ≡ 14 mod 35.
TRUE, the congruence 15x ≡ 6 mod 18 has solutions if and only if gcd(15, 18) = 3
divides 6, which it does, and then there are gcd(15, 18) = 3 distinct solutions modulo
18, namely 4, 10, 16 mod 18.
TRUE, if ax ≡ 1 mod b has a solution, then gcd(a, b) = 1 and therefore gcd(b, a) = 1
and bx ≡ 1 mod a must have a solution as well.
FALSE, 2|6 and 3|6 but (2 + 3) = 5 does not divide 6.
© Copyright 2026 Paperzz