Number Theory
Number Theory
3. Use the roster method to list the elements of the set that contains all the
natural numbers that are divisors of 48.
4. Use the roster method to list the elements of the set that contains all the
natural numbers that are divisors of 84.
5. Determine the intersection of the two sets in Parts (3) and (4). This set
contains all the natural numbers that are common divisors of 48 and 84.
414
8.1. The Greatest Common Divisor 415
7. Use the method suggested in Parts (3) through (6) to determine each of the
following: gcd.8; 12/, gcd.0; 5/, gcd.8; 27/, and gcd.14; 28/.
8. If a and b are integers, make a conjecture about how the common divisors
of a and b are related to the greatest common divisor of a and b.
1. Each row in the following table contains values for the integers a and b.
In this table, the value of r is the remainder (from the Division Algorithm)
when a is divided by b. Complete each row in this table by determining
gcd.a; b/, r, and gcd.b; r/.
Number theory is a study of the system of integers, which consists of the set of
integers, Z D f : : : ; 3; 2; 1; 0; 1; 2; 3; : : : g and the various properties of this
set under the usual operations of addition and multiplication and under the usual
ordering relation of “less than.” The properties of the integers in Table 8.1 will be
considered axioms in this text.
We will also assume the properties of the integers shown in Table 8.2. These
properties can be proven from the properties in Table 8.1. (However, we will not
do so here.)
416 Chapter 8. Topics in Number Theory
We have already studied a good deal of number theory in this text in our dis-
cussion of proof methods. In particular, we have studied even and odd integers,
divisibility of integers, congruence, and the Division Algorithm. See the summary
for Chapter 3 on page 166 for a summary of results concerning even and odd in-
tegers as well as results concerning properties of divisors. We reviewed some of
these properties and the Division Algorithm in the Preview Activities.
One of the most important concepts in elementary number theory is that of the
greatest common divisor of two integers. The definition for the greatest common
divisor of two integers (not both zero) was given in Preview Activity 1.
This means that d is not the greatest common divisor of a and b provided
that it is not a common divisor of a and b or that there exists a common
divisor of a and b that is greater than d.
In the preview activities, we determined the greatest common divisors for several
pairs of integers. The process we used was to list all the divisors of both integers,
then list all the common divisors of both integers and, finally, from the list of all
common divisors, find the greatest (largest) common divisor. This method works
reasonably well for small integers but can get quite cumbersome if the integers are
large. Before we develop an efficient method for determining the greatest common
divisor of two integers, we need to establish some properties of greatest common
divisors.
One property was suggested in Preview Activity 1. If we look at the results
in Part (7) of that preview activity, we should observe that any common divisor of
a and b will divide gcd.a; b/. In fact, the primary goals of the remainder of this
section are
1. To find an efficient method for determining gcd.a; b/, where a and b are
integers.
2. To prove that the natural number gcd.a; b/ is the only natural number d that
satisfies the following properties:
The second goal is only slightly different from the definition of the greatest com-
mon divisor. The only difference is in the second condition where k d is re-
placed by k j d.
418 Chapter 8. Topics in Number Theory
We will first consider the case where a and b are integers with a ¤ 0 and
b > 0. The proof of the result stated in the second goal contains a method
(called the Euclidean Algorithm) for determining the greatest common divisors
of the two integers a and b. The main idea of the method is to keep replacing the
pair of integers .a; b/ with another pair of integers .b; r/, where 0 r < b and
gcd.b; r/ D gcd.a; b/. This idea was explored in Preview Activity 2. Lemma 8.1
is a conjecture that could have been formulated in Preview Activity 2.
Lemma 8.1. Let c and d be integers, not both equal to zero. If q and r are integers
such that c D d q C r, then gcd.c; d / D gcd.d; r/.
Proof. Let c and d be integers, not both equal to zero. Assume that q and r are
integers such that c D d q C r. For ease of notation, we will let
Now, m divides c and m divides d . Consequently, there exist integers x and y such
that c D mx and d D my. Hence,
r Dc d q
r D mx .my/q
r D m.x yq/:
But this means that m divides r. Since m divides d and m divides r, m is less than
or equal to gcd.d; r/. Thus, m n.
Using a similar argument, we see that n divides d and n divides r. Since
c D d q C r, we can prove that n divides c. Hence, n divides c and n divides d .
Thus, n gcd.c; d / or n m. We now have m n and n m. Hence, m D n
and gcd.c; d / D gcd.d; r/.
The key to finding the greatest common divisor (in more complicated cases) is
to use the Division Algorithm again, this time with 12 and r. We now find integers
q2 and r2 such that
12 D r q2 C r2 :
The example in Progress Check 8.2 illustrates the main idea of the Euclidean Al-
gorithm for finding gcd.a; b/, which is explained in the proof of the following
theorem.
Theorem 8.3. Let a and b be integers with a ¤ 0 and b > 0. Then gcd.a; b/ is
the only natural number d such that
Proof. Let a and b be integers with a ¤ 0 and b > 0, and let d D gcd.a; b/. By
the Division Algorithm, there exist integers q1 and r1 such that
(all of which have the same greatest common divisor). This is summarized in the
following table:
From the inequalities in the third column of this table, we have a strictly decreasing
sequence of nonnegative integers .b > r1 > r2 > r3 > r4 /. Consequently, a
term in this sequence must eventually be equal to zero. Let p be the smallest
natural number such that rpC1 D 0. This means that the last two rows in the
preceding table will be
Remember that this table was constructed by repeated use of Lemma 8.1 and that
the greatest common divisor of each pair of integers produced equals gcd.a; b/.
Also, the last row in the table indicates that rp divides rp 1 . This means that
gcd.rp 1 ; rp / D rp and hence rp D gcd.a; b/.
This proves that rp D gcd.a; b/ satisfies Condition (a) of this theorem. Now
assume that k is an integer such that k divides a and k divides b. We proceed
through the table row by row. First, since r1 D a b q, we see that
k must divide r1 .
k divides r2 .
8.1. The Greatest Common Divisor 421
Continuing with each row, we see that k divides each of the remainders r1 , r2 , r3 ,
: : : ; rp . This means that rp D gcd.a; b/ satisfies Condition (b) of the theorem.
Theorem 8.3 was proven with the assumptions that a; b 2 Z with a ¤ 0 and b > 0.
A more general version of this theorem can be proven with a; b 2 Z and b ¤ 0.
This can be proven using Theorem 8.3 and the results in the following lemma.
Lemma 8.5. Let a; b 2 Z with b ¤ 0. Then
1. gcd.0; b/ D jbj.
The proofs of these results are in Exercise (4). An application of this result is given
in the next example.
422 Chapter 8. Topics in Number Theory
We will use Example 8.6 to illustrate another use of the Euclidean Algorithm. It
is possible to use the steps of the Euclidean Algorithm in reverse order to write
gcd.a; b/ in terms of a and b. We will use these steps in reverse order to find
integers m and n such that gcd.234; 42/ D 234m C 42n. The idea is to start
with the row with the last nonzero remainder and work backward as shown in the
following table:
Explanation Result
First, use the equation in Step 3 to 6 D 24 18 1
write 6 in terms of 24 and 18.
Use the equation in Step 2 to write 6 D 24 18 1
18 D 42 24 1. Substitute this into D 24 .42 24 1/
the preceding result and simplify. D 42 . 1/ C 24 2
We now have written 6 in terms of 6 D 42 . 1/ C 24 2
42 and 24. Use the equation in D 42 . 1/ C .234 42 5/ 2
Step 1 to write 24 D 234 42 5. D 234 2 C 42 . 11/
Substitute this into the preceding
result and simplify.
The previous example and progress check illustrate the following important
result in number theory, which will be used in the next section to help prove some
other significant results.
Theorem 8.8. Let a and b be integers, not both 0. Then gcd.a; b/ can be written
as a linear combination of a and b. That is, there exist integers u and v such that
gcd.a; b/ D au C bv.
We will not give a formal proof of this theorem. Hopefully, the examples
and activities provide evidence for its validity. The idea is to use the steps of the
Euclidean Algorithm in reverse order to write gcd.a; b/ as a linear combination of
a and b. For example, assume the completed table for the Euclidean Algorithm is
natural numbers states that any nonempty set of natural numbers must contain a
least element. It can be proven that the Well-Ordering Principle is equivalent to the
Principle of Mathematical Induction.
Exercises 8.1
1. Find each of the following greatest common divisors by listing all of the
common divisors of each pair of integers.
? (a) gcd.21; 28/ ? (c) gcd.58; 63/ (e) gcd.110; 215/
? (b) gcd. 21; 28/ ? (d) gcd.0; 12/ (f) gcd.110; 215/
5. For each of the following pairs of integers, use the Euclidean Algorithm to
find gcd.a; b/ and to write gcd.a; b/ as a linear combination of a and b. That
is, find integers m and n such that d D am C bn.
?
(a) a D 36; b D 60 (d) a D 12628; b D 21361
?
(b) a D 901; b D 935 (e) a D 36, b D 60
?
(c) a D 72; b D 714 (f) a D 901, b D 935
6. (a) Find integers u and v such that 9u C 14v D 1 or explain why it is not
possible to do so. Then find integers x and y such that 9x C 14y D 10
or explain why it is not possible to do so.
8.1. The Greatest Common Divisor 425
(b) Find integers x and y such that 9x C 15y D 10 or explain why it is not
possible to do so.
(c) Find integers x and y such that 9x C 15y D 3162 or explain why it is
not possible to do so.
7. ? (a) Notice that gcd.11; 17/ D 1. Find integers x and y such that
11x C 17y D 1.
? (b) Let m; n 2 Z. Write the sum m C n as a single fraction.
11 17
(c) Find two rational numbers with denominators of 11 and 17, respec-
10
tively , whose sum is equal to . Hint: Write the rational numbers
187
m n
in the form and , where m; n 2 Z. Then write
11 17
m n 10
C D :
11 17 187
Use Exercises (7a) and (7b) to determine m and n.
(d) Find two rational numbers with denominators 17 and 21, respectively,
326
whose sum is equal to or explain why it is not possible to do so.
357
(e) Find two rational numbers with denominators 9 and 15, respectively,
10
whose sum is equal to or explain why it is not possible to do so.
225
That is, S is the set of all linear combinations of a and b, and T is the
set of all multiples of the greatest common divisor of a and b. Does the
set S equal the set T ? If not, is one of these sets a subset of the other
set? Justify your conclusions.
Note: In Parts (c) and (d), we were exploring special cases for these
two sets.
1. Give examples of four natural numbers that are prime and four natural num-
bers that are composite.
Theorem 4.9 in Section 4.2 states that every natural number greater than 1 is
either a prime number or a product of prime numbers.
When a composite number is written as a product of prime numbers, we say
that we have obtained a prime factorization of that composite number. For exam-
ple, since 60 D 22 3 5, we say that 22 3 5 is a prime factorization of 60.
4. Repeat Parts (2) and (3) with 150. First, start with 150 D 3 50, and then
start with 150 D 5 30.
In Section 8.1, we introduced the concept of the greatest common divisor of two
integers. We showed how the Euclidean Algorithm can be used to find the greatest
common divisor of two integers, a and b, and also showed how to use the results
of the Euclidean Algorithm to write the greatest common divisor of a and b as a
linear combination of a and b.
In this section, we will use these results to help prove the so-called Fundamen-
tal Theorem of Arithmetic, which states that any natural number greater than 1 that
is not prime can be written as product of primes in “essentially” only one way. This
means that given two prime factorizations, the prime factors are exactly the same,
and the only difference may be in the order in which the prime factors are written.
We start with more results concerning greatest common divisors. We first prove
Proposition 5.16, which was part of Exercise (18) on page 243 in Section 5.2 and
Exercise (8) on page 425in Section 8.1.
Proposition 5.16 Let a, b, and t be integers with t ¤ 0. If t divides a and t divides
b, then for all integers x and y, t divides (ax + by).
428 Chapter 8. Topics in Number Theory
Proof. Let a, b, and t be integers with t ¤ 0, and assume that t divides a and t
divides b. We will prove that for all integers x and y, t divides .ax C by/.
So let x 2 Z and let y 2 Z. Since t divides a, there exists an integer m such
that a D mt and since t divides b, there exists an integer n such that b D nt .
Using substitution and algebra, we then see that
ax C by D .mt /x C .nt /y
D t .mx C ny/
Since .mx C ny/ is an integer, the last equation proves that t divides ax C by and
this proves that for all integers x and y, t divides .ax C by/.
We now let a; b 2 Z, not both 0, and let d D gcd.a; b/. Theorem 8.8 states
that d can be written as a linear combination of a and b. Now, since d j a and
d j b, we can use the result of Proposition 5.16 to conclude that for all x; y 2 Z,
d j .ax C by/. This means that d divides every linear combination of a and b.
In addition, this means that d must be the smallest positive number that is a linear
combination of a and b. We summarize these results in Theorem 8.9.
Theorem 8.9. Let a; b 2 Z, not both 0.
Definition. Two nonzero integers a and b are relatively prime provided that
gcd.a; b/ D 1.
8.2. Prime Numbers and Prime Factorizations 429
Theorem 8.11. Let a and b be nonzero integers, and let p be a prime number.
1. If a and b are relatively prime, then there exist integers m and n such that
am C bn D 1. That is, 1 can be written as linear combination of a and b.
2. If p j a, then gcd.a; p/ D p.
Part (1) of Theorem 8.11 is actually a corollary of Theorem 8.9. Parts (2)
and (3) could have been the conjectures you formulated in Progress Check 8.10.
The proofs are included in Exercise (1).
Given nonzero integers a and b, we have seen that it is possible to use the
Euclidean Algorithm to write their greatest common divisor as a linear combination
of a and b. We have also seen that this can sometimes be a tedious, time-consuming
process, which is why people have programmed computers to do this. Fortunately,
in many proofs of number theory results, we do not actually have to construct this
linear combination since simply knowing that it exists can be useful in proving
results. This will be illustrated in the proof of Theorem 8.12, which is based on
work in Preview Activity 1.
Theorem 8.12. Let a, b, be nonzero integers and let c be an integer. If a and b are
relatively prime and a j .bc/, then a j c.
430 Chapter 8. Topics in Number Theory
c D aq: (1)
Since we are given that a j .bc/, there exists an integer k such that
bc D ak: (2)
It may seem tempting to divide both sides of equation (2) by b, but if we do so,
we run into problems with the fact that the integers are not closed under division.
Instead, we look at the other part of the hypothesis, which is that a and b are
relatively prime. This means that gcd.a; b/ D 1. How can we use this? This
means that a and b have no common factors except for 1. In light of equation (2),
it seems reasonable that any factor of a must also be a factor of c. But how do we
formalize this?
One conclusion that we can use is that since gcd.a; b/ D 1, by Theorem 8.11,
there exist integers m and n such that
am C bn D 1: (3)
We may consider solving equation (3) for b and substituting this into equa-
tion (2). The problem, again, is that in order to solve equation (3) for b, we need
to divide by n.
Before doing anything else, we should look at the goal in equation (1). We
need to introduce c into equation (3). One way to do this is to multiply both sides
of equation (3) by c. (This keeps us in the system of integers since the integers are
closed under multiplication.) This gives
.am C bn/ c D 1 c
acm C bcn D c: (4)
Notice that the left side of equation (4) contains a term, bcn, that contains bc. This
means that we can use equation (2) and substitute bc D ak in equation (4). After
doing this, we can factor the left side of the equation to prove that a j c.
Corollary 8.14.
Part (1) of Corollary 8.14 is a corollary of Theorem 8.12. Part (2) is proved us-
ing mathematical induction. The basis step is the case where n D 1, and Part (1) is
the case where n D 2. The proofs of these two results are included in Exercises (2)
and (3).
Historical Note
Part (1) of Corollary 8.14 is known as Euclid’s Lemma. Most people associate
geometry with Euclid’s Elements, but these books also contain many basic results
in number theory. Many of the results that are contained in this section appeared
in Euclid’s Elements.
We are now ready to prove the Fundamental Theorem of Arithmetic. The first part
of this theorem was proved in Theorem 4.9 in Section 4.2. This theorem states
that each natural number greater than 1 is either a prime number or is a product of
prime numbers. Before we state the Fundamental Theorem of Arithmetic, we will
discuss some notational conventions that will help us with the proof. We start with
an example.
We will use n D 120. Since 5 j 120, we can write 120 D 5 24. In addition,
we can factor 24 as 24 D 2 2 2 3. So we can write
120 D 5 24
D 5 .2 2 2 3/ :
This is a prime factorization of 120, but it is not the way we usually write this
factorization. Most often, we will write the prime number factors in ascending
order. So we write
120 D 2 2 2 3 5 or 120 D 23 3 5:
432 Chapter 8. Topics in Number Theory
Now, let n 2 N. To write the prime factorization of n with the prime factors in
ascending order requires that if we write n D p1 p2 pr , where p1 ; p2 ; pr are
prime numbers, we will have p1 p2 pr .
n D p1 p2 pr and that n D q1 q2 qs ;
Proof. The first part of this theorem was proved in Theorem 4.9. We will prove
the second part of the theorem by induction on n using the Second Principle of
Mathematical Induction. (See Section 4.2.) For each natural number n with n > 1,
let P .n/ be
We have also assumed that q1 qj for all j and, hence, we know that q1 p1 .
However, we have also assumed that p1 q1 . Hence,
p1 D q1 :
The product in the previous equation is less that k C 1. Hence, we can apply our
induction hypothesis to these factorizations and conclude that r D s, and for each
j from 2 to r, pj D qj .
This completes the proof that if P .2/; P .3/; : : : ; P .k/ are true, then P .k C 1/
is true. Hence, by the Second Principle of Mathematical Induction, we conclude
that P .n/ is true for all n 2 N with n 2. This completes the proof of the
theorem.
This list contains the first 25 prime numbers. Does this list ever stop? The
question was answered in Euclid’s Elements, and the result is stated in The-
orem 8.16. The proof of this theorem is considered to be one of the classical
proofs by contradiction.
Proof. We will use a proof by contradiction. We assume that there are only
finitely many primes, and let
p1 ; p2 ; : : : ; pm
M D p1 p2 pm C 1: (1)
1DM p1 p2 pm : (2)
Theorem 8.17. For any natural number n, there exist at least n consecutive
natural numbers that are composite numbers.
8.2. Prime Numbers and Prime Factorizations 435
There are many unanswered questions about prime numbers, two of which will
now be discussed.
4. Goldbach’s Conjecture
Given an even natural number, is it possible to write it as a sum of two prime
numbers? For example,
Exercises 8.2
?
1. Prove the second and third parts of Theorem 8.11.
436 Chapter 8. Topics in Number Theory
?
3. Use mathematical induction to prove the second part of Corollary 8.14.
Let p be a prime number, let n 2 N, and let a1 ; a2 ; : : : ; an 2 Z. If
p j .a1 a2 an /, then there exists a k 2 N with 1 k n such that
p j ak .
? 4. (a) Let a and b be nonzero integers. If there exist integers x and y such that
ax C by D 1, what conclusion can be made about gcd.a; b/? Explain.
(b) Let a and b be nonzero integers. If there exist integers x and y such that
ax C by D 2, what conclusion can be made about gcd.a; b/? Explain.
5. (a) Let a 2 Z. What is gcd.a; a C 1/? That is, what is the greatest com-
mon divisor of two consecutive integers? Justify your conclusion.
Hint: Exercise (4) might be helpful.
(b) Let a 2 Z. What conclusion can be made about gcd.a; a C 2/? That
is, what conclusion can be made about the greatest common divisor of
two integers that differ by 2? Justify your conclusion.
6. (a) Let a 2 Z. What conclusion can be made about gcd.a; a C 3/? That
is, what conclusion can be made about the greatest common divisor of
two integers that differ by 3? Justify your conclusion.
(b) Let a 2 Z. What conclusion can be made about gcd.a; a C 4/? That
is, what conclusion can be made about the greatest common divisor of
two integers that differ by 4? Justify your conclusion.
14. (a) Determine five different primes that are congruent to 3 modulo 4.
(b) Prove that there are infinitely many primes that are congruent to 3 mod-
ulo 4.
16. The Twin Prime Conjecture states that there are infinitely many twin primes,
but it is not known if this conjecture is true or false. The answers to the
following questions, however, can be determined.
(a) How many pairs of primes p and q exist where q p D 3? That is,
how many pairs of primes are there that differ by 3? Prove that your
answer is correct. (One such pair is 2 and 5.)
(b) How many triplets of primes of the form p, p C 2, and p C 4 are there?
That is, how many triplets of primes exist where each prime is 2 more
than the preceding prime? Prove that your answer is correct. Notice
that one such triplet is 3, 5, and 7.
Hint: Try setting up cases using congruence modulo 3.
(a) Find two pairs of integers x and y so that x > 7 and 3x C 5y D 11.
(Try to keep the integer values of x as small as possible.)
(b) Find two pairs of integers x and y so that x < 2 and 3x C 5y D 11.
(Try to keep the integer values of x as close to 2 as possible.)
(c) Determine formulas (one for x and one for y) that will generate pairs
of integers x and y so that 3x C 5y D 11.
Hint: The two formulas can be written in the form x D 2 C km and
y D 1 C k n, where k is an arbitrary integer and m and n are specific
integers.
(a) Find two pairs of integers x and y so that x > 7 and 4x C 6y D 16.
(Try to keep the integer values of x as small as possible.)
(b) Find twopairs of integers x and y so that x < 4 and 4x C 6y D 16.
(Try to keep the integer values of x as close to 4 as possible.)
(c) Determine formulas (one for x and one for y) that will generate pairs
of integers x and y so that 4x C 6y D 16.
Hint: The two formulas can be written in the form x D 4 C km and
y D 0 C k n, where k is an arbitrary integer and mand n are specific
integers.
In the two preview activities, we were interested only in integer solutions for
certain equations. In such instances, we give the equation a special name.
8.3. Linear Diophantine Equations 441
The equations that were investigated in Preview Activity 2 were linear Dio-
phantine equations in two variables. The problem of determining all the solutions
of a linear Diophantine equation has been completely solved. Before stating the
general result, we will provide a few more examples.
x y x y
2 1 1 3
5 5 4 7
8 9 7 11
11 13 10 15
It would be nice to determine the pattern that these solutions exhibit. If we consider
the solution x D 2 and y D 1 to be the “starting point,” then we can see that
the other solutions are obtained by adding 3 to x and subtracting 4 from y in the
previous solution. So we can write these solutions to the equation as
x D 2 C 3k and yD 1 4k;
where k is an integer. We can use substitution and algebra to verify that these
expressions for x and y give solutions of this equation as follows:
4x C 3y D 4 .2 C 3k/ C 3 . 1 4k/
D .8 C 12k/ C . 3 12k/
D 5:
We should note that we have not yet proved that these solutions are all of the
solutions of the Diophantine equation 4x C 3y D 5. This will be done later.
If the general form for a linear Diophantine equation is ax C by D c, then for
this example, a D 4 and b D 3. Notice that for this equation, we started with one
solution and obtained other solutions by adding b D 3 to x and subtracting a D 4
from y in the previous solution. Also, notice that gcd.3; 4/ D 1.
1. Verify that the following table shows some solutions of the linear Diophan-
tine equation 6x C 9y D 12.
x y x y
2 0 1 2
5 2 4 4
8 4 7 6
11 6 10 8
2. Follow the pattern in this table to determine formulas for x and y that will
generate integer solutions of the equation 6x C 9y D 12. Verify that the
formulas actually produce solutions for the equation 6x C 9y D 12.
8.3. Linear Diophantine Equations 443
The solutions for the linear Diophantine equations in Preview Activity 2, Ex-
ample 8.19, and Progress Check 8.20 provide examples for the second part of The-
orem 8.22.
Theorem 8.22. Let a, b, and c be integers with a ¤ 0 and b ¤ 0, and let
d D gcd.a; b/.
Proof. The proof of Part (1) is Exercise (1). For Part (2), we let a, b, and c be
integers with a ¤ 0 and b ¤ 0, and let d D gcd.a; b/. We also assume that d j c.
Since d D gcd.a; b/, Theorem 8.8 tells us that d is a linear combination of a and
b. So there exist integers s and t such that
d D as C bt: (1)
d m D .as C bt /m
c D a.sm/ C b.t m/:
We now verify that for each k 2 Z, the equations in (2) produce a solution of
ax C by D c.
b a
ax C by D a x0 C k C b y0 k
d d
ab ab
D ax0 C k C by0 k
d d
D ax0 C by0
D c:
This proves that the Diophantine equation ax C by D c has infinitely many solu-
tions.
We now show that every solution of this equation can be written in the form
described in (2). So suppose that x and y are integers such that ax C by D c. Then
1. Use the Euclidean Algorithm to verify that gcd.63; 336/ D 21. What con-
clusion can be made about linear Diophantine equation 63x C 336y D 40
using Theorem 8.22? If this Diophantine equation has solutions, write for-
mulas that will generate the solutions.
2. Use the Euclidean Algorithm to verify that gcd.144; 225/ D 9. What con-
clusion can be made about linear Diophantine equation 144x C 225y D 27
using Theorem 8.22? If this Diophantine equation has solutions, write for-
mulas that will generate the solutions.
Exercises 8.3
5. On the night of a certain banquet, a caterer offered the choice of two dinners,
a steak dinner for $25 and a vegetarian dinner for $16. At the end of the
evening, the caterer presented the host with a bill (before tax and tips) for
$1461. What is the minimum number of people who could have attended the
banquet? What is the maximum number of people who could have attended
the banquet?
6. The goal of this exercise is to determine all (integer) solutions of the linear
Diophantine equation in three variables 12x1 C 9x2 C 16x3 D 20.
(a) First, notice that gcd.12; 9/ D 3. Determine formulas that will gener-
ate all solutions for the linear Diophantine equation
3y C 16x3 D 20.
(b) Explain why the solutions (for x1 and x2 ) of the Diophantine equation
12x1 C 9x2 D 3y can be used to generate solutions for
12x1 C 9x2 C 16x3 D 20.
(c) Use the general value for y from Exercise (6a) to determine the solu-
tions of 12x1 C 9x2 D 3y.
(d) Use the results from Exercises (6a) and (6c) to determine formulas that
will generate all solutions for the Diophantine equation
12x1 C 9x2 C 16x3 D 20.
Note: These formulas will involve two arbitrary integer parameters.
Substitute specific values for these integers and then check the resulting
solution in the original equation. Repeat this at least three times.
(e) Check the general solution for 12x1 C 9x2 C 16x3 D 20 from Exer-
cise (6d).
8.3. Linear Diophantine Equations 447
7. Use the method suggested in Exercise (6) to determine formulas that will
generate all solutions of the Diophantine equation 8x1 C 4x2 6x3 D 6.
Check the general solution.
9. The purpose of this exercise will be to prove that the nonlinear Diophantine
equation 3x 2 y 2 D 2 has no solution.
10. Use the method suggested in Exercise (9) to prove that the Diophantine equa-
tion 7x 2 C 2 D y 3 has no solution.
11. Linear Congruences in One Variable. Let n be a natural number and let
a; b 2 Z with a ¤ 0. A congruence of the form ax b .mod n/ is called a
linear congruence in one variable. This is called a linear congruence since
the variable x occurs to the first power.
A solution of a linear congruence in one variable is defined similarly to
the solution of an equation. A solution is an integer that makes the result-
ing congruence true when the integer is substituted for the variable x. For
example,
(a) Verify that x D 2 and x D 5 are the only solutions the linear congru-
ence 4x 2 .mod 6/ with 0 x < 6.
448 Chapter 8. Topics in Number Theory
(b) Show that the linear congruence 4x 3 .mod 6/ has no solutions with
0 x < 6.
(c) Determine all solutions of the linear congruence 3x 7 .mod 8/ with
0 x < 8.
The following parts of this activity show that we can use the results of Theo-
rem 8.22 to help find all solutions of the linear congruence 6x 4 .mod 8/.
(d) Verify that x D 2 and x D 6 are the only solutions for the linear
congruence 6x 4 .mod 8/ with 0 x < 8.
(e) Use the definition of “congruence” to rewrite the congruence
6x 4 .mod 8/ in terms of “divides.”
(f) Use the definition of “divides” to rewrite the result in part (11e) in the
form of an equation. (An existential quantifier must be used.)
(g) Use the results of parts (11d) and (11f) to write an equation that will
generate all the solutions of the linear congruence 6x 4 .mod 8/.
Hint: Use Theorem 8.22. This can be used to generate solutions for x
and the variable introduced in part (11f). In this case, we are interested
only in the solutions for x.
Important Definitions
Theorem 8.3. Let a and b be integers with a ¤ 0 and b > 0. Then gcd.a; b/
is the only natural number d such that
(a) d divides a,
(b) d divides b, and
(c) if k is an integer that divides both a and b, then k divides d.
Theorem 8.8. Let a and b be integers, not both 0. Then gcd.a; b/ can be
written as a linear combination of a and b. That is, there exist integers u
and v such that gcd.a; b/ D au C bv.
Theorem 8.9.
Theorem 8.11. Let a and b be nonzero integers, and let p be a prime num-
ber.
1. If a and b are relatively prime, then there exist integers m and n such
that am C bn D 1. That is, 1 can be written as linear combination of
a and b.
2. If p j a, then gcd.a; p/ D p.
3. If p does not divide a, then gcd.a; p/ D 1.
Corollary 8.14
n D p1 p2 pr and that n D q1 q2 qs ;
x D x0 C bk and y D y0 ak;
where k 2 Z.