0% found this document useful (0 votes)
29 views293 pages

Basic Logic and Number Theory

The document is a self-learning material for the B.Sc. Mathematics first semester course on Basic Logic and Number Theory at the University of Calicut. It covers essential topics such as propositions, logical equivalences, proof methods, and various number theory concepts. The material emphasizes the importance of understanding mathematical reasoning through active engagement and problem-solving.

Uploaded by

midhun9846914081
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views293 pages

Basic Logic and Number Theory

The document is a self-learning material for the B.Sc. Mathematics first semester course on Basic Logic and Number Theory at the University of Calicut. It covers essential topics such as propositions, logical equivalences, proof methods, and various number theory concepts. The material emphasizes the importance of understanding mathematical reasoning through active engagement and problem-solving.

Uploaded by

midhun9846914081
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 293

BASIC LOGIC AND

NUMBER THEORY
(MTS1 B01)

I SEMESTER
CORE COURSE

B.Sc. MATHEMATICS
(2020 Admission onwards)

UNIVERSITY OF CALICUT
School of Distance Education,
Calicut University P.O.
Malappuram - 673 635, Kerala.

19551
UNIVERSITY OF CALICUT
SCHOOL OF DISTANCE EDUCATION
Self Learning Material
B.Sc. Mathematics (First Semester)
(2020 Admission Onwards)
MTS1 B01 : Basic Logic and Number Theory

Lessons Prepared by:


Dr.Vinod Kumar P., Associate Professor,
Department of Mathematics,
Thunchan Memorial Government College Tirur
Malappuram Dt.

Scrutinized by:
Dr.Bijumon R., Associate Professor and Head,
Department of Mathematics,
Mahatma Gandhi College, Iritty
Keezhur P.O., Kannur Dt.

DISCLAIMER
'' The author shall be''solely responsible for the
content and views expressed in this book''
Contents

1 Propositions 3

2 Logical Equivalences 31

3 Quantifiers 42

4 Arguments 51

5 Proof Methods 71

6 Mathematical Induction 97

7 Recursion 110

8 Division Algorithm 120

9 Prime and Composite Numbers 135


10 The Greatest Common Divisor 149

11 Euclidean Algorithm 166

12 The Fundamental Theorem of Arithmetic 175

13 Least Common Multiple 190

14 Linear Diophantine Equations 196

15 Congruences 216

16 Linear Congruence 234

17 Divisibility Tests 248

18 Wilson’s Theorem 253

19 Fermat’s Little Theorem 263

20 Euler’s Theorem 276

Syllabus 286
A note to the students

“As are the crests on the heads of peacocks,


As are the gems on the hoods of cobras,
So is Mathematics, at the top of all sciences.”

The Yajurveda, circa 600 B.C.

Mathematics is an abstract branch of human knowledge. Its language


and style are precise and systematic. No one can learn this subject
without capturing its language and the way of its thought processes.
As Paul Halmos said, the only way to learn Mathematics is to do
Mathematics and you cannot understand this subject by just reading
some books, or by attending some lecture classes on Mathematics or
just by watching someone doing it! So don’t just read these notes, but
try to ask your own questions, find out your own examples, and thereby
try to internalize the concepts. While studying a theorem and its proof,
try to convince yourself where the proof uses the hypothesis and how we
arrive at the final conclusions. Each and every step of the proof requires

1
2

a thorough analysis, sound reasoning, and explanations.

Also, consider the following questions: Is the entire hypothesis neces-


sary? Is there any other alternative ways to reach the conclusion? Can
we connect the present result with any previous ideas? Is the converse
true? etc. Such an analytic approach will help you for a better under-
standing of the concept and to enjoy the pleasure of doing Mathematics.

Take special care to do all the exercises listed in the book, that
will give you much confidence for future studies and to face the exams.
Doing problems in an analytic and systematic way helps to internal-
ize the abstract mathematical concepts more better. Always remember
that success is never an accident, it is the final outcome of
purposeful activities and hard work.

Queries and suggestions are most welcome and that can be mailed
to: vinodunical@gmail.com

Tirur
01. 12. 2021 Dr. Vinod Kumar P
Chapter 1
Propositions

Introduction

The rules of mathematical logic specify methods of reasoning math-


ematical statements. These rules are used to distinguish between valid
and invalid mathematical arguments. Apart from its importance in un-
derstanding mathematical reasoning, logic has numerous applications in
Computer Science, varying from design of digital circuits, to the con-
struction of computer programs and verification of correctness of pro-
grams.

Propositions and Compound Propositions

The basic building blocks of logic are propositions. Before giving the
definition of proposition, we note that statement is a declarative sentence
(i.e., a sentence that declares a fact). For example, the following are
statements:

3
4 Propositions

(i) The sun rises in the East.


(ii)‘b’ is a vowel.
(ii) 3 + 5 = 7.

The following are not declarative sentences and hence not statements:

(i) Who is that?


(ii) Listen carefully.
(iii) Go out and play.

In mathematics, we are interested in statements that can be proved or


disproved. A proposition is a statement to which it is possible to assign
a value of either true or false. More precisely; we have the following
definition.

Definition
A proposition is a declarative sentence that is either true or false, but
not both. We denote it by the lowercase letters p ,q ,r, s, or t. The
variables p ,q ,r, s, or t are boolean variables (or logic variables).

Example 1
Consider the following statements.

1. 2 is an even number
2. 3 is an even number.
3. Chennai is a state of India.
4. Lotus is the national flower of India.

All these statements are propositions, since each of them has a truth
value. Propositions 1 and 4 are true, where 2 and 3 are false.

Some sentences that are not propositions are given in the next ex-
ample.
Propositions 5

Example 2
Consider the following sentences.

1. Wake up.

2. Who is that?

3. x + 2 = 12

4. x + y = z

Sentences 1 and 2 are not propositions because they are not declara-
tive sentences. Sentences 3 and 4 are not propositions because they are
neither true nor false, since the values are not assigned to the variables
in these sentences.

Notations
Letters are used to denote propositions, just as letters are used to denote
variables.
The conventional letters used for this purpose are p, q, r, s, . . . .

The truth-value of a proposition is true, and is denoted by T, if it is


a true proposition and false, and denoted by F, if it is a false proposition.

The area of logic that deals with propositions is called the proposi-
tional calculus or propositional logic.

Compound Propositions using Logical Operators

Many mathematical statements are constructed by combining one or


more propositions. New propositions, called compound propositions,
are formed from existing propositions using logical operators.

Definition
Let p be a proposition. The statement
6 Propositions

“It is not the case that p”

is another proposition, called the negation of p. The negation of p is


denoted by ¬p or by ∼ p. The proposition ¬p is read “not p.”

¬p is F when p is T and ¬p is T when p is F.

The truth table for negation of the proposition p is given in Table 1.

Table 1 :

The truth table for negation of one proposition

p ¬p
T F
F T

Example 3
Let p: Delhi is the capital of India.

The negation of p is

¬p: It is not the case that Delhi is the capital of India.

This sentence is often written as

¬p: Delhi is not the capital of India.

Definition
Let p and q be propositions. The proposition “p and q”, denoted by
p ∧ q, is the proposition that is true when both p and q are true and is
false otherwise. The proposition p ∧ q is called the conjunction of p
and q.

The truth table for p ∧ q is shown in Table 2. Note that there are
four rows in this truth table, one row for each possible combination of
Propositions 7

truth-values for the propositions p and q.

Table 2 :

The truth table for the Conjunction of two propositions

p q p∧q
TT T
TF F
FT F
FF F
Example 4
Find the conjunction of the propositions p and q where p is the propo-
sition “Today is Friday” and q is the proposition “It is raining today”.

Solution

The conjunction of these propositions, p ∧ q, is the proposition “


Today is Friday and it is raining today”. This proposition is true on
rainy Fridays. The proposition is false on any day that is not a Friday
and on Fridays when it does not rain.

Expressions that yield the value true or false are boolean expressions,
and they often occur in both mathematics and computer science. For
instance, 1 < 2 and 3 < 1 are boolean expressions. If- statements and
while-loops in computer programs often use such expressions, and their
values determine whether or not if-statements and while-loops will be
executed.

Definition
Let p and q be propositions. The proposition “p or q”, denoted by p ∨ q,
is the proposition that is false when p and q are both false and true
otherwise. The proposition p ∨ q is called the disjunction of p and q
8 Propositions

(disjunction of p and q is also called inclusive or of p and q).

Table 3 :

The truth table for the Disjunction of two propositions

p q p∨q
TT T
TF T
FT T
FF F

Example 5
What is the disjunction of the propositions p and q where p is the propo-
sition “Today is Friday” and q is the proposition “It is raining today”.

Solution

The disjunction of p and q, p ∨ q, is the proposition

“Today is Friday or it is raining today.”

This proposition is true on any day that is either a Friday or a rainy day
(including rainy Fridays). It is false on days that are not Fridays when
it also does not rain.

Definition
Let p and q be propositions. The exclusive or of p and q, denoted by
p ⊕ q, is the proposition that is true when exactly one of p and q is true
and is false otherwise.

The truth table for the exclusive or of two propositions is displayed


in Table 4.

Table 4 :
Propositions 9

The truth table for the Exclusive or of two propositions

p q p⊕q
TT F
TF T
FT T
FF F
Conditional Statements

Now we discuss several other important ways that propositions may be


combined.

Definition
Let p and q be the propositions. The implication p → q is the proposition
that is false when p is true and q is false and true otherwise. In this
implication p is called the hypothesis (or antecedent or premise) and q
is called the conclusion (or consequence).

The truth table for the implication p → q is shown in Table 5.

Table 5 :

The truth table for the implication p → q

p q p→q
TT T
TF F
FT T
FF T
Various terminology for indicating p → q are:

“If p, then q” ; “ p implies q”

“If p, q” ; “p only if q”
10 Propositions

“p is sufficient for q” ; “q if p”

“ q whenever p ; “q is necessary for p”

Remark
Note that p → q is false only in that case p is true but q is false, so that
it is true when both p and q are true, and when p is false (no matter
what truth value q has).

A useful way to remember that an implication is true when its hy-


pothesis is false is to think of a contract or an obligation. If the con-
dition specified by such a statement is false, no obligation is in force.
For example, the statement “If you make more than Rs.2,00,000, then
you must file a tax return” says nothing about someone making less
than Rs.2,00,000. You violate the obligation only if you make more than
Rs.2,00,000 and do not file a return. Similarly, the statement “If a cricket
player hits more than 60 runs, then a bonus of Rs.10,000 is awarded”
in the contract of a cricket player is violated only when the player hits
more than 60 runs, but the bonus is not awarded. This says nothing if
the player hits fewer than 60 runs.

The way we have defined implications is more general than meaning


attached to the implications in the English language. For instance, the
implication

“If it is sunny today, then we will go to the beach.”

is an implication used in normal language, since there is a relationship


between the hypothesis and the conclusion. Further, this implication is
considered valid unless it is indeed sunny today, but we do not go to the
beach.

Example 6 (Example of an always true implication)


Propositions 11

The implication

“If today is Friday, then 2 + 3 = 5”

is true from the definition of implication, since its conclusion is true.


(The truth value of the hypothesis does not matter then.)

Attention! The implication

“If today is Friday, then 2 + 3 = 6.”

is true every day except Friday, even though 2 + 3 = 6 is always false.

Example 7
What is the value of the variable x after the statement

“if 2 + 2 = 4 then x := x + 1”

if x = 0 before this statement is encountered? (The symbol: = stands


for assignment. The statement x := x + 1 means the assignment of the
value of x + 1 to x.)

Solution

Since 2 + 2 = 4 is true, the assignment statement x := x + 1 is


executed. Hence, if x = 0 before the statement is encountered, then
after the statement is encountered x has the value 0 + 1. That is after
this statement is encountered x has value 1.

We can build up compound propositions using the negation opera-


tor and the different connectives defined so far. Parentheses are used to
specify the order in which the various logical operators in a compound
proposition are applied. In particular, the logical operators in the in-
nermost parentheses are applied first. For instance, (p ∨ q) ∧ (¬r) is the
conjunction of p ∨ q and ¬r. To cut down on the number of parentheses
needed, we specify that the negation operator is applied before all other
12 Propositions

logical operators. This means that ¬p ∧ q is the conjunction of ¬p and q,


namely (¬p) ∧ q, not the negation of the conjunction of p and q, namely
¬(p ∧ q).

There are some related implications that can be formed from p → q.

1. The proposition q → p is called the converse of p → q.

2. The contrapositive of p → q is the proposition ¬q → ¬p.

3. The proposition ¬p → ¬q is called the inverse of p → q.

Example 8
Find the converse and the contra positive of the implication

“If today is Thursday, then I have a test today.”

Solution

1. The converse is

“If I have a test today, then today is Thursday.”

2. The contra positive of this implication is

“If I do not have a test today, then today is not Thursday.”

Definition
Let p and q be the propositions. The biconditional p ↔ q is the
proposition that is true when p and q have the same truth values and is
false otherwise.

The truth table for p ↔ q is shown in Table 6. Note that the bi-
conditional p ↔ q is true precisely when both the implications p → q
and q → p are true. Because of this, the terminology “p if and only if
q” is used for this biconditional. Other common ways of expressing the
Propositions 13

proposition p ↔ q are “p is necessary and sufficient for q” and “if p then


q, and conversely.”

Table 6 :

The truth table for the Biconditional p ↔ q

p q p↔q
TT T
TF F
FT F
FF T
Example 9
Translate the following English sentence into a logical expression.

“You can access the Internet from campus only if you are a computer
science student or you are not a freshman.”

Solution

There are many ways to translate this sentence into a logical ex-
pression. Although it is possible to represent the sentence by a single
prepositional variable, such as p, this would not be useful when analyz-
ing its meaning or reasoning with it. Instead, we will use propositional
variables to represent each sentence part and determine the appropriate
logical connectives between them. In particular, we let a, c, and f rep-
resent “You can access the Internet from campus,” “You are a computer
science student,” and “You are a freshman,” respectively. Noting that
“only if” is one way an implication can be expressed, this sentence can
be represented as
a → (c ∨ ¬f ).

Example 10
14 Propositions

Translate the following English sentence into a logical expression.

“You cannot ride the roller coaster if you are under 4 feet tall unless
you are older than 16 years old.”

Solution

There are many ways to translate this sentence into a logical ex-
pression. The simplest but least useful way is simply to represent the
sentence by a single propositional variable, say, p. Although this is
not wrong, doing this would not assist us when we try to use proposi-
tional variables to represent each of the sentence parts and to decide on
the appropriate logical connectives between them. In particular, we let
q, r, and s represent “You can ride the roller coaster,” “You are under 4
feet tall,” and “You are older than 16 years old,” respectively. Then the
sentence can be translated to

(r ∧ ¬s) → ¬q.

Of course, there are other ways to represent the original sentence as a


logical expression, but the one we have used should meet our needs.

Order of Precedence

To evaluate complex logical expressions, you must know the order of


precedence of the logical operators. The order of precedence from the
highest to the lowest is: (1)¬ (2)∧ (3) ∨ (4) → (5) ↔. Note that
parenthesized sub expressions are always evaluated first; if two operators
have equal precedence, the corresponding expression is evaluated from
left to right. For example, the expression (p → q)∧¬q → ¬p is evaluated
as [(p → q) ∧ (¬q)] → (¬p), and

p → q ↔ ¬q → ¬p is evaluated as (p → q) ↔ [(¬q) → (¬p)].


Propositions 15

Definition
A compound proposition that is always true, no matter what the truth-
values of the propositions that occur in it, is called a tautology. A
compound proposition that is always false is called a contradiction. A
proposition that is neither a tautology nor a contradiction is called a
contingency.

Tautology and contradictions are often important in mathematical


reasoning. The following example illustrates these types of propositions.

Example 11
We can construct examples of tautologies and contradictions using just
one proposition. Consider the truth of p ∨ ¬p andp ∧ ¬p, shown in Table
1. Since p ∨ ¬p is always true, it is a tautology. Since p ∧ ¬p is always
false, it is a contradiction.

Table 7:

Examples of a Tautology and a Contradiction

p ¬p p ∨ ¬p p ∧ ¬p
T F T F
T T T F
Exercises
1. Which of the following sentences are propositions? What are the
truth-values of those that are propositions?

1. Chennai is the capital of Tamil Nadu.

2. Mysore is the capital of Karnataka.

3. 2 + 3 = 5.

4. 5 + 7 =10.
16 Propositions

5. x + 2 = 11.

6. Answer this question.

7. x + y = y + x for every pair of real numbers x and y.

8. |x| < 0 for every real number x.

2. What is the negation of each of the following propositions?

1. Today is Monday.

2. There is no pollution in Mumbai.

3. 2 + 1 = 3.

4. The summer in New Delhi is hot and sunny.

3. Let p and q be the propositions

p : It is below freezing.

q : It is snowing.

Write the following propositions using p and q and logical connectives.

1. It is below freezing and snowing.

2. It is below freezing but not snowing.

3. It is not below freezing and it is not snowing.

4. It is either snowing or below freezing (or both).

5. If it is below freezing, it is also snowing.


Propositions 17

6. It is either below freezing or it is snowing, but it is not snowing if


it is below freezing.

7. That it is below freezing is necessary and sufficient for it to be


snowing.

4. Let p and q be the propositions

p : You drive over 65 miles per hour.

q : You get a speeding ticket.

Write the following propositions using p and q and logical connectives.

1. You do not drive over 65 miles per hour.

2. You drive over 65 miles per hour, but you do not get a speeding
ticket.

3. You will get a speeding ticket if you drive over 65 miles per hour.

4. If you do not drive over 65 miles per hour, then you will not get a
speeding ticket.

5. Driving over 65 miles per hour is sufficient for getting a speeding


ticket.

6. You get a speeding ticket, but you do not drive over 65 miles per
hour.

7. Whenever you get a speeding ticket, you are driving over 65 miles
per hour.

5. Determine whether each of the following implications is true or false.


18 Propositions

1. If 1 + 1 = 2, then 2 + 2 = 5.

2. If 1 + 1 = 3, then 2 + 2 = 4.

3. If 1 + 1 = 3, then 2 + 2 = 5.

4. If pigs can fly, then 1 + 1 = 3.

5. If 1 + 1 = 3, then God exists.

6. If 1 + 1 = 3, then pigs can fly.

7. If 1 + 1 = 2, then pigs can fly.

8. If 2 + 2 = 4, then 1 + 2 = 3.

6. For each of the following sentences, state what the sentence means if
the or is an inclusive or (that is, a disjunction) versus an exclusive
or. What of these meanings of or do you think is intended?

1. To take discrete mathematics, you must have taken calculus or a


course in computer science.

2. When you buy a new car from Hindustan Motor Company, you
get Rs.20,000 back in cash or a 8% car loan.

3. Dinner for two includes two items from column A or three items
from column B.

4. School is closed if more than 2 feet of snow falls or if the wind chill
is below −100.

7. Each inhabitant of a remote village always tells the truth or always


lies. A villager will only give a “Yes” or a “No” response to a question
Propositions 19

a tourist asks. Suppose you are a tourist visiting this area and come to
a fork in the road. One branch leads to the ruins you want to visit; the
other branch leads deep into the jungle. A villager is standing at the fork
in the road. What one question can you ask the villager to determine
which branch to take?

8. Write each of the following statements in the form “if p, then q” in


English.

1. It snows whenever the wind blows from the northeast.

2. The apple trees will bloom if it stays warm for a week.

3. That India win the championship implies that they beat Sri Lanka.

4. It is necessary to walk 8 miles to get to top of Long’s peak.

5. To get tenure as a professor, it is sufficient to be world famous.

6. If you drive more than 400 miles, you will need to buy gasoline.

7. Your guarantee is good only if you bought your CD player less


than 90 days ago.

9. Write each of the following propositions in the form “p if and only if


q” in English.

1. If it is hot outside you buy an ice cream cone, and if you buy an
ice cream cone it is hot outside.

2. For you to win the contest it is necessary and sufficient that you
have only the winning ticket.

3. You get promoted only if you have connections, and you have con-
nections only if you get promoted.
20 Propositions

4. If you watch television your mind will decay, and conversely.

5. The trains run late on exactly those days when I take it.

10. State the converse and contra positive of each of the following im-
plications.

1. If it snows today, I will ski tomorrow.

2. I come to class whenever there is going to be a quiz.

3. A positive integer is a prime only if it has no divisors other than 1


and itself.

11. Construct a truth table for each of the following compound propo-
sitions.

a) p ∧ ¬p b) p ∨ ¬p

c) (p ∨ ¬q) → q d)(p ∨ q) → (p ∧ q)

e) (p → q) ↔ (¬q → ¬p) f) (p → q) → (q → p)

12. Construct a truth table for each of the following compound propo-
sitions.

a) p → ¬q b) ¬p ↔ q

c) (p → q) ∨ (¬p → q) d) (p → q) ∧ (¬p → q)

e) (p ↔ q) ∨ (¬p ↔ q) f) (¬p ↔ ¬q) ↔ (p ↔ q)

13. Construct a truth table for each of the following compound propo-
sitions.

a) p → (¬q ∨ r) b) ¬p → (q → r)
Propositions 21

c) (p → q) ∨ (¬p → r) d) (p → q) ∧ (¬p → r)

e) (p ↔ q) ∨ (¬q ↔ r) f) (¬p ↔ ¬q) ↔ (q ↔ r)

14. Construct a truth table for (p ↔ q) ↔ (r ↔ s).

15. Show that each of the following implications is a tautology by using


truth tables.

a) (p ∧ q) → p b)p → (p ∨ q)

c) ¬p → (p → q) d) (p ∧ q) → (p → q)

e) ¬(p → q) → p f) ¬(p → q) → ¬q

16. Show that each implication in Exercise 15 is a tautology without


using truth tables.

Answers

1. (a) Yes, T (b) Yes, F (c) Yes, T (d) Yes, F

(e) No (f) No (g) Yes, T (h) Yes, F

2. (a) Today is not Monday (b) There is pollution in Mumbai (c) 2 + 1 6=


3. (d) The summer in New Delhi is not hot or it is not sunny.

3. (a) p∧q (b) p∧¬q (c) ¬p∧¬q (d) p∨q (e) p → q (f) (p∨q)∧(p → ¬q)
(g) q ↔ p

4. (a) ¬p (b) p ∧ ¬q (c) p → q (d) ¬p → ¬q

(e) p → q (f) q ∧ ¬p (g) q → p

5. (a) False (b) True (c) True (d) True

(e) True (f) True (g) False (h) True

6. (a) Inclusive or: It is allowable to take discrete mathematics if you


have had calculus or computer science, or both. Exclusive or: It is allow-
22 Propositions

able to take discrete mathematics if you have had calculus or computer


science, but not if you have had both. Most likely the inclusive or is
intended.

(b) Inclusive or: You can take the rebate, or you can get a low-interest
loan, or you can get both the rebate and a low interest loan. Exclusive
or: You can take the rebate, or you can get a low-interest loan, but
you cannot get both the rebate and a low interest loan. Most likely the
exclusive or is intended.

(c) Inclusive or: You can order two items from column A and none
from column B, or three items from column B and none from column
A, or five items including two from column A and three from column B.
Exclusive or: You can order two items from column A or three items from
column B, but not both. Almost certainly the exclusive or is intended.

(d) Inclusive or: More than 2 feet of snow or wind chill below −100,
or both, will close school. Exclusive or: More than 2 feet of snow or
wind chill below −100, but not both, will close school. Certainly the
inclusive or is intended.

7. “If were to ask you whether the right branch leads to the ruins, would
you answer yes?”

8. (a) If the wind blows from the northeast, then is snows.

(b) If it stays warm for a week, then the apple trees will bloom.

(c) If India win the championship, then they beat Sri Lanka

(d) If you get to the top of Long’s Peak, then you must have walked
8 miles.

(e) If you are world-famous, then you will get tenure as a professor.
Propositions 23

(f) If you drive more than 400 miles, then you will need to buy
gasoline.

(g) If your guarantee is good, then you must have bought your CD
player less than 90 days ago.

9. (a) You buy an ice cream cone if and only if it is hot outside.

(b) You win the contest if and only if you hold the only winning
ticket.

(c) You get promoted if and only if you have connections.

(d) Your mind will decay if and only if you watch television.

(e) The train runs late if and only if it is a day I take the train.

10. (a) Converse: “I will ski tomorrow only if it snows today”. Contra-
positive: “If I do not ski tomorrow, then it will not have snowed today”.

(b) Converse: “If I come to class, then there will be a quiz”. Contra-
positive: “If I do not come to class, then there will not be quiz”.

(c) Converse: “A positive integer is a prime if it has no divisors other


than 1 and itself”. Contrapositive: “If a positive integer has a divisor
other than 1 and itself, then it is not prime”.

11.
(a) p ¬p p ∧ ¬p (b) p ¬p p ∨ ¬p
T F F T F T
F T F F T T
24 Propositions

(c) pq ¬q p ∨ ¬q (p ∨ ¬q) → q
TT F T T
TF T T F
FT F F T
FF T T F

(d) pq p∨q p∧q (p ∨ q) → (p ∧ q)


TT T T T
TF T F F
FT T F F
FF F F T

(e) (p → q) ↔
pq p→q ¬q ¬p ¬q → ¬p
(¬q → ¬p)
TT T F F T T
TF F T F F T
FT T F T T T
FF T T T T T

(e) (p → q) ↔
pq p→q ¬q ¬p ¬q → ¬p
(¬q → ¬p)
TT T F F T T
TF F T F F T
FT T F T T T
FF T T T T T
Propositions 25

(f) pq p→q q→p (p → q) → (q → p)


TT T T T
TF F T T
FT T F F
FF T T T

12.
(a) pq p → ¬q (b) pq ¬p ↔ q
TT F TT F
TF T TF T
FT T FT T
FF T FF F

(c) (p → q) ∨ (d) (p → q) ∧
pq pq
(¬p → q) (¬p → q)
TT T TT T
TF T TF F
FT T FT T
FF T FF F

(e) (p ↔ q) ∨ (f) (¬p → ¬q) ↔


pq pq
(¬p ↔ q) (p ↔ q)
TT T TT T
TF T TF T
FT T FT T
FF T FF T
26 Propositions

13.

(a) pqr p → (¬q ∨ r) (b) pqr ¬p → (q → r)


TTT T TTT T
TTF F TTF T
TFT T TFT T
TFF T TFF T
FTT T FTT T
FTF T FTF F
FFT T FFT T
FFF T FFF T

(c) (p → q)∨ (d) (p → q)∧


pqr pqr
(¬p → r) (¬p → r)
TTT T TTT T
TTF T TTF T
TFT T TFT F
TFF T TFF F
FTT T FTT T
FTF T FTF F
FFT T FFT T
FFF T FFF F
Propositions 27

(e) (p ↔ q)∨ (f) (¬p ↔ ¬q) ↔


pqr pqr
(¬q ↔ r) (q ↔ r)
TTT T TTT T
TTF T TTF F
TFT T TFT T
TFF F TFF F
FTT F FTT F
FTF T FTF T
FFT T FFT F
FFF T FFF T

14.
28 Propositions

(p ↔ q) ↔
pqrs p↔q r↔s
(r ↔ s)
TTTT T T T
TTTF T F F
TTFT T F F
TTFF T T T
TFTT F T F
TFTF F F T
TFFT F F T
TFFF F T F
FTTT F T F
FTTF F F T
FTFT F F T
FTFF F T F
FFTT T T T
FFTF T F F
FFFT T F F
FFFF T T T

15.

(a) pq p∧q (p ∧ q) → p (b) pq p∨q p → (p ∨ q)


TT T T TT T T
TF T T TF T T
FT F T FT T T
FF F T FF F T
Propositions 29

(c) pq ¬p p→q ¬p → (p → q)
TT F T T
TF F F T
FT T T T
FF T T T

(d) pq p∧q p→q (p ∧ q) → (p → q)


TT T T T
TF F F T
FT F T T
FF F T T

(e) pq p→q ¬(p → q) ¬(p → q) → p


TT T F T
TF F T T
FT T F T
FF T F T

(f) pq p→q ¬(p → q) ¬q ¬(p → q) → ¬q


TT T F F T
TF F T T T
FT T F F T
FF T F T T

16. In each case we will show that if the hypothesis is true, then the
conclusion is also.

(a) If the hypothesis p ∧ q is true, then by the definition of conjunction,


the conclusion p must also be true.

(b) If the hypothesis p is true, by the definition of disjunction, the con-


30 Propositions

clusion p ∨ q is also true.

(c) If the hypothesis ¬p is true, that is, if p is false, then the conclusion
p → q is true.

(d) If the hypothesis p ∧ q is true, then both p and q are true so that the
conclusion p → q is also true.

(e) If the hypothesis ¬(p → q) is true, then p → q is false, so that the


conclusion p is true (and qis false).

(f) If the hypothesis ¬(p → q) is true, then p → q is false, so that p is


true and q is false. Hence, the conclusion ¬q is true.
Chapter 2
Logical Equivalences

Compound propositions that have the same truth-values in all possible


cases are called logically equivalent. We can also define this notion
as follows.

Definition
The proposition p and q are logically equivalent if p ↔ q is a tautology.

Notations

1. The notation p ⇔ q denotes that p and q are logically equivalent.

2. Sometimes the notation p ≡ q is also used to denote that p and q


are logically equivalent.

One way to determine whether two propositions are equivalent is to use


a truth table. In particular, the propositions p and q are equivalent if
and only if the column giving their truth-values agree. The following

31
32 Logical Equivalences

example illustrates this method.

Example 1
Show that ¬(p∨q) and ¬p∧¬q are logically equivalent. This equivalence
is one of De Morgan’s laws for propositions named after the English
mathematician Augustus De Morgan of the mid-nineteenth century.

Solution

The truth tables for these propositions are displayed in Table 1.


Since the truth-values of the propositions ¬(p ∨ q) and ¬p ∧ ¬q agree for
all possible combinations of the values of p and q, it follows that these
propositions are logically equivalent.

Table 1:

Truth table showing ¬(p ∨ q) and ¬p ∧ ¬q are logically equivalent

p q p∨q ¬(p ∨ q) ¬p ¬q ¬p ∧ ¬q
T T T F F F F
T F T F F T F
F T T F T F F
F F F T T T T
Example 2
Show that the propositions p → q and ¬p ∨ q are logically equivalent.

Solution

We construct the truth table for these propositions in Table 2. Since


the truth values of p → q and ¬p∨q agree, these propositions are logically
equivalent.

Table 2:

Truth table showing ¬p ∨ q and p → q are logically equivalent


Logical Equivalences 33

p q ¬p ¬p ∨ q p→q
TT F T T
TF F F F
FT T T T
FF T T T
Example 3
Show that the propositions p ∨ (q ∧ r) and (p ∨ q) ∧ (p ∨ r) are logically
equivalent. This is the distributive law of disjunction over conjunction.

Solution

We construct the truth table for these propositions in Table 3. Since


the truth values of p∨(q ∧r) and (p∨q)∧(p∨r) agree, these propositions
are logically equivalent.

Table 3 :

Truth table showing p ∨ (q ∧ r) and (p ∨ q) ∧ (p ∨ r) are logically


equivalent

p q r q∧r p ∨ (q ∧ r) p∨q p∨r (p∨q)∧(p∨r)


TTT T T T T T
TTF F T T T T
TFT F T T T T
TFF F T T T T
FTT T T T T T
FTF F F T F F
FFT F F F T F
FFF F F F F F
Remark
A truth table of a compound proposition involving three different propo-
sitions requires eight rows. A truth table of a compound proposition
34 Logical Equivalences

involving n different propositions requires 2n rows.

Example 4
Verify that p ∧ T ≡ p and p ∨ F ≡ p.

Solution

We show that p ∧ T is logically equivalent to p and p ∨ F is logically


equivalent to p by constructing the following truth tables.

p T p∧T p F p∨F
T T T T F T
F T F F F F

Example 5
Verify that ¬(¬p) ≡ p.

Solution.
Verification is made through the following truth table.

p ¬p ¬¬p
T F T
F T F

Table 4 contains some important equivalence. In these equivalences,


T denotes any proposition that is always true and F denotes any propo-
sition that is always false. Verification of some of the equivalences are
already done. We leave the verification of the rest to the exercises.
Table 4: Logical Equivalences
Logical Equivalences 35

Equivalence Name
p∧T⇔p
Identity laws
p∨F⇔p
p∨T⇔T
Domination laws
p∧F⇔F
p∨p⇔p
Idempotent laws
p∧p⇔p
¬(¬p) ⇔ p Double negation
law
p∨q ⇔q∨p
Commutative
p∧q ⇔q∧p
laws
(p ∨ q) ∨ r ⇔ p ∨ (q ∨ r)
Associative laws
(p ∧ q) ∧ r ⇔ p ∧ (q ∧ r)
p ∨ (q ∧ r) ⇔ (p ∨ q) ∧ (p ∨ r)
Distributive laws
p ∧ (q ∨ r) ⇔ (p ∧ q) ∨ (p ∧ r)
¬(p ∧ q) ⇔ ¬p ∨ ¬q
De Morgan’s laws
¬(p ∨ q) ⇔ ¬p ∧ ¬q

Table 5 : Some Useful Logical Equivalences

p ∨ ¬p ⇔ T
P ∧ ¬p ⇔ F
(p → q) ⇔ (¬p ∨ q)
The associative law for disjunction shows that the expression p ∨ q ∨ r
is well defined, in the sense that it does not matter whether we first take
the disjunction of p and q and then the disjunction of p ∨ q with r, or if
we first take the disjunction of q and r and then take the disjunction of p
and q ∨ r. Similarly, the expression p ∧ q ∧ r is well defined. By extending
this reasoning, it follows that p1 ∨ p2 ∨ ... ∨ pn and p1 ∧ p2 ∧ ... ∧ pn
36 Logical Equivalences

are well defined whenever p1 , p2 , ... , pn are propositions. Furthermore,


note that De Morgan’s laws extend to

¬(p1 ∨ p2 ∨ ... ∨ pn ) ⇔ (¬p1 ∧ ¬p2 ∧ ... ∧ ¬pn )

and
¬(p1 ∧ p2 ∧ ... ∧ pn ) ⇔ (¬p1 ∨ ¬p2 ∨ ... ∨ ¬pn ).

Example 6
Verify that p ∨ p ≡ p and p ∧ p ≡ p

Solution

Verification is made through the following truth tables.

p p p∧p p p p∨p
T T T T T T
F F F F F F

The logical equivalences in Table 4, as well as any others that have been
established (such as those shown in table 5), can be used to construct ad-
ditional logical equivalences. The reason for this is that a proposition in a
compound proposition can be replaced by one that is logically equivalent
to it without changing the truth-value of the compound proposition.

Example 7
Show that ¬(p ∨ (¬p ∧ q)) and ¬p ∧ ¬q are logically equivalent.

Solution

We could use a truth table to show that these compound propositions


are equivalent. Instead, we will establish the equivalence by developing
a series of logical equivalences, using one of the equivalence in Table 5
Logical Equivalences 37

at a time starting with ¬(p ∨ (¬p ∨ ¬q)) and ending with¬p ∧ ¬q. We
have the following equivalences.

¬(p ∨ (¬p ∧ q) ≡ ¬p ∧ ¬(¬p ∧ q) using the second De Morgan’s law

≡ ¬p ∧ [¬(¬p) ∨ ¬q] from the first De Morgan’s law

≡ ¬p ∧ (p ∨ ¬q) from the double negation law

≡ (¬p ∧ p) ∨ (¬p ∧ ¬q) from the second distributive law

≡ F ∨ (¬p ∧ ¬q) since ¬p ∧ p ⇔ F

≡ (¬p ∧ ¬q) ∨ F from the commutative law

≡ ¬p ∧ ¬q from the identity law for F.

Consequently ¬(p ∨ (¬p ∧ q)) and ¬p ∧ ¬q are logically equivalent.

Example 8
Show that (p ∧ q) → (p ∨ q) is a tautology,

Solution

We could use a truth table to show that these compound propositions


are equivalent. Instead, to show that this statement is a tautology, we
will use logical equivalences to demonstrate that it is logically equivalent
to T. (Note that this could also be done using a truth table).

(p ∧ q) → (p ∨ q) ⇔ ¬(p ∧ q) ∨ (p ∨ q) by Example 3

⇔ (¬p ∨ ¬q) ∨ (p ∨ q) by the first De Morgan’s law

⇔ (¬p ∨ p) ∨ (¬q ∨ q)by the associative and

commutative laws for disjunction.

⇔ T ∨ T by Example 1 and the commutative law for disjunction

⇔ T by the domination law.


38 Logical Equivalences

A truth table can be used to determine whether a compound propo-


sition is a tautology. This can be done by hand for a proposition with
a smaller number of variables, but when the number of variables grows,
this become impractical. For instance, there are 220 = 1, 048, 576 rows
in the truth-value table for a proposition with 20 variables. Clearly, you
need a computer to help you determine, in this way, whether a com-
pound proposition in 20 variables is a tautology. But when there are
1000 variables, can even a computer determine in a reasonable amount
of time whether a compound proposition is a tautology? Checking every
one of the 21000 (a number with more than 300 decimal digits) possi-
ble combinations of truth values simply cannot be done by a computer
in even trillions of years. Furthermore, no other procedures are known
that a computer can follow to determine in a reasonable amount of time
whether a compound proposition in such a large number of variables is
a tautology.

Exercises

1. Use truth table to verify the following equivalences.

a) p ∧ T ⇔ p b) p ∨ F ⇔ p

c) p ∧ F ⇔ F d) p ∨ T ⇔ T

e) p ∨ p ⇔ p f) p ∧ p ⇔ p

2. Use truth tables to verify the commutative laws.

a) p ∨ q ⇔ q ∨ p b) p ∧ q ⇔ q ∧ p

3. Use truth tables to verify the distributive law p∧(q∨r) ⇔ (p∧q)∨(p∧r)

4. Verify the following equivalences, which are known as the absorption


laws.
Logical Equivalences 39

a) [p ∨ (p ∧ q)] ⇔ p b) [p ∧ (p ∨ q)] ⇔ p

5. Show that (p → q) → r and p → (q → r) are not equivalent.

6. Show that ¬p ↔ q and p ↔ ¬q are logically equivalent.

7. Show that ¬(p ↔ q) and ¬p ↔ q are logically equivalent.

8. Show that (s∗)∗ = s.

9. Why are the duals of two equivalent, compound propositions also


equivalent, where these compound propositions contain only
the operators ∧, ∨ and ¬?

10. Find a compound proposition involving the proposition p, q, and r


that is true when exactly two of p, q, and r are true and is false other-
wise. (Hint: Form a disjunction of conjunctions. Include a conjunction
for each combination of values for which the proposition is true. Each
conjunction should include each of the three propositions or their nega-
tions.)

Answers
p q p∨q q∨p
T T T T
2. (a) T F T T
F T T T
F F F F
p q p∧q q∧p
T T T T
(b) T F F F
F T F F
F F F F
4. (a) If p is true, then p ∨ (p ∧ q) is true since the first proposition
40 Logical Equivalences

in the disjunction is true. On the other hand, if p is false, then p ∧ q is


also false, so p ∨ (p ∧ q) is false. Since p and p ∨ (p ∧ q) always have the
same truth value, they are equivalent.

(b) If p is false, then p∧(p∨q) is false since the first part of the conjunction
is false. On the other hand, if p is true, then both parts of the conjunction
are true since p ∨ q is also true. Since p and p ∧ (p ∨ q) always have the
same truth value, they are equivalent.

5. These are not logically equivalent since when p, q, and r are all false,
(p → q) → r is false, but p → (q → r) is true.

6. The proposition ¬p ↔ q is true when ¬p and q have the same truth


values, which means that p and q have different truth values. Simi-
larly, p ↔ ¬q is true in exactly the same cases. Therefore, these two
expressions are logically equivalent.

7. The proposition ¬ (p ↔ q) is true when p ↔ q is false, which means


that p and q have different truth values. Since this is precisely when
¬p ↔ q is true, the two expressions are logically equivalent.

8. If we take duals twice, every ∨ changes to an ∧ and then back to an


∨, every ∧ changes to an ∨ and then back to an ∧, every T changes to
an F and then back to a T, every F changes to a T and then back an

F. Hence, (s∗ ) = s.

9. Let p and q be equivalent compound propositions involving only


the operators ∧, ∨, and ¬, and T and F. Note that ¬p and ¬q are
also equivalent. Use De Morgan’s laws as many times as necessary to
push negations in as far as possible within these compound propositions,
changing ∨s to ∧s, and vice versa, and changing Ts to Fs, and vice versa.
This shows that ¬p and ¬q are the same as p∗ and q ∗ except that each
atomic proposition pi within them is replaced by its negation. From this
Logical Equivalences 41

we can conclude that p∗ and q ∗ are equivalent since ¬p and ¬q are.

10.(p ∧ q ∧ ¬r) ∨ (p ∧ ¬q ∧ r) ∨ (¬p ∧ q ∧ r)


Chapter 3
Quantifiers

Introduction

Statements involving variables, such as

“x > 4,” “x = y + 2 ” and “x + y = z,”

are often found in mathematics. These statements are neither true nor
false when the values of the variables are not specified. In this chapter
we will discuss the ways of producing propositions from such statements.

The statement “x is greater than 4” has two parts. The first part,
the variable x, is the subject of the statement. The second part- the
predicate, “is greater than 4”- refers to a property that the subject of
the statement can have. We can denote the statement “x is greater than
4” byP (x), where P denotes the predicate “is greater than 4” and x is
the variable. P is called the propositional function. The statement
P (x) is also said to be the value of the propositional function P at

42
Quantifiers 43

x. Once a value has been assigned to the variable x, the statement P (x)
becomes a proposition and has a truth-value. Consider the following
example.

Example 1
Let P (x) denote the statement “x > 4”. What are the truth values of
P (5) and P (2)?

Solution

The statement P (5) is obtained by setting x = 5 in the statement


“x > 4”. Hence, P (5) which is the statement “5 > 4” is true. However,
P (2), which is the statement “2 > 4” is false.

Statements Involving More Than One Variable

We can also have statements that involve more than one variable.
For instance consider the statement “x = y + 2”. We can denote this
statement by Q(x, y), where x and y are variables and Q is the predicate.
When values are assigned to the variables x and y, the statement Q(x, y)
has a truth-value.

Example 2
Let Q(x, y) denote the statement “x = y +2”. What are the truth-values
of the propositions Q(1, 2) and Q(2, 0)?

Solution

Setting x = 1 and y = 2 in the statement Q(x, y), we obtain Q(1, 2)


and it is the statement “1 = 2 + 2”, which is false. The statement
Q(2, 0) is the proposition “2 = 0 + 2” which is true.

Example 3
Let R(x, y, z) denote the statement “x + y = z”. When values are as-
signed to the variables x, y, and z this statement has a truth value. What
44 Quantifiers

are the truth values of the propositions R(1, 2, 3) and R(0, 0, 1)?

Solution

The proposition R(1, 2, 3) is obtained by setting x = 1, y =


2 and z = 3 in the statement R(x, y, z). We see that R(1, 2, 3) which
is the statement “1 + 2 = 3, which is true whereas, R(0, 0, 1) which is
the statement “0 + 0 = 1” is false.

In general, a statement involving the n variables x1 , x2 , . . . , xn


can be denoted by P (x1 , x2 , . . . , xn )

A statement of the form P (x1 , x2 , . . . , xn ) is the value of the


propositional function P at the n−tuple (x1 , x2 , . . . , xn ). P is
called predicate.

Quantifiers

When all the variables in a propositional function are assigned val-


ues, the resulting statement has a truth value. However, there is an-
other important way, called quantification, to create proposition from a
propositional function. We discuss two types of quantifications, namely,
universal quantification and existential quantification.

Many mathematical statements assert that a property is true for


all values of a variable in a particular domain, called the universe of
discourse(UD) or the domain. Such a statement is expressed using a
universal quantification. The universal quantification of a propositional
function is the proposition that assert that P (x) is true for all values of
x in the universe of discourse. The universe of discourse specifies the
possible values of the variable x.

Definition
The universal quantification of P (x) is the proposition
Quantifiers 45

“P (x) is true for all values of x in the universe of discourse.”

Notation
∀xP (x) denotes the universal quantification of P (x). Here ∀ is called
the universal quantifier. The proposition ∀xP (x) is also expressed as

“for all xP (x)” or “for every xP (x)”

Remark
It is best to avoid the word “any” since it is often ambiguous as to
whether it means “every’ or “some.”.

Example 4
Express the statement

“Every student in this class has studied calculus”

as a universal quantification.

Solution

Let P (x) denote the statement

“ x has studied calculus”

Then the statement “Every student in this class has studied calculus”
can be written as ∀xP (x), where the universe of discourse consists of the
students in this class.

This statement can also be expressed as

∀xS(x) → P (x)

where S(x) is the statement

“ x is in this class”.
46 Quantifiers

P (x) is as before, and the universe of discourse is the set of all students.

Example 4 illustrates that there is often more than one good way to
express quantification.

Example 5
Let P (x) be the statement “x + 1 > x.” What is the truth-value of the
quantification ∀xP (x), where the universe of discourse is the set of real
numbers?

Solution

Since P (x) is true for all real numbers x, the quantification ∀xP (x)
is true.

Example 6
Let Q(x) be the statement “x < 2.” What is the truth-value of the
quantification ∀xQ(x), where the universe of discourse is the set of real
numbers?

Solution

Q(x) is not true for all real numbers x, since, for instance, Q(3) is
3 < 2 which is false. Thus ∀xQ(x)is false.

When all of the elements in the universe of discourse can be listed-


say, x1 , x2 , . . . , xn -it follows that the universal quantification ∀x P (x)
is the same as the conjunction P (x1 ) ∧ P (x2 ) ∧ · · · ∧ P (xn ), since this
conjunction is true if and only if P (x1 ), P (x2 ), · · · , P (xn ) are all
true.

Example 7
What is the truth-value of ∀xP (x), where P (x) is the statement “x2 <
10” and the universe of discourse consists of the positive integers not
exceeding 4?
Quantifiers 47

Solution

The statement ∀xP (x) is the same as the conjunction

P (1) ∧ P (2) ∧ P (3) ∧ P (4),

since the universe of discourse consists of the integers 1,2,3, and 4. Since
P (4), which is the statement “42 < 10” is false, it follows that ∀xP (x)
is false.

The Existential Quantifier

Many mathematical statements asserts the existence of an element


with a certain property. Such statements are expressed using existential
quantification. With existential quantification, we form a proposition
that is true if and only if P (x)is true for at least one value of x in the
universe of discourse.

Definition
The existential quantification of P (x) is the proposition

“There exists an element x in the universe of discourse such that


P (x) is true.”

Notation
We use the notation
∃x P (x)

for the existential quantification of P (x). Here ∃ is called the existential


quantifier. The existential quantification ∃x P (x) is also expressed as

“There is an x such that P (x),”

“There is at least one x such that P (x),”


48 Quantifiers

or

“For some x, P (x).”

Example 8
Let P (x) denote the statement “x > 3.” What is the truth value of the
quantification ∃x P (x), where the universe of discourse is the set of real
numbers?

Solution
Since “x > 3” is true - for instance, when x = 5 - the existential quan-
tification of P (x), which is ∃ xP (x), is true.

Example 9
Let Q(x) denote the statement “x = x + 1.” What is the truth value of
the quantification ∃xQ(x), where the universe of discourse is set of real
numbers?

Solution

Since Q(x) is false for every real numbers x, the existential quantifi-
cation of Q(x), which is ∃xQ(x), is false.

When all of the elements in the universe of discourse can be listed-say,


x1 , x2 , . . . , xn -it follows that the existential quantification ∃x P (x) is
the same as the disjunction P (x1 ) ∨ P (x2 ) ∨ · · · ∨ P (xn ), since this dis-
junction is true if and only if at least one of P (x1 ), P (x2 ), · · · , P (xn )
is true.

Example 10
What is the truth value of ∃x P (x) where P (x) is the statement “x2 >
10” and the universe of discourse consists of the positive integers not
exceeding 4?

Solution
Quantifiers 49

Since the universe of discourse is {1, 2, 3, 4}, the proposition ∃xP (x)
is the same as the disjunction P (1) ∨ P (2) ∨ P (3) ∨ P (4). Since P (4),
which is the statement “42 > 10,” is true, it follows that ∃xP (x) is true.

Table 1 summarizes the meaning of the universal and the existential


quantifiers.

Table 1 : Quantifiers

Statement When True? When False?


∀x P (x) P (x) is true for ev- There is an x for
ery x which P (x) is false
∃xP (x) There is an x for P (x) is false for ev-
which P (x) is true ery x
De Morgan’s Laws

¬[(∀x)P (x)] ≡ (∃x)[¬P (x)]


¬[(∃x)P (x)] ≡ (∀x)[¬P (x)]

At the end of this chapter, we like to point out that what we discussed
in Sections 1 and 2 is propositional logic; it deals with unquanti-
fied propositions. However, as we saw throughout this section, not all
propositions can be symbolized in propositional logic, so quantifiers are
needed. The area of logic that deals with quantified propositions is
known as predicate logic.

Exercises

Determine the truth value of each proposition, where the UD consists of


the numbers ±1, ±2, and 0.
1. (∀x)(x2 = 4)
2. (∃x)(x3 + 2x2 = x + 2)
3. (∀x)(x5 + 4x = 5x3 )
50 Quantifiers

4. ¬(∀x)(x3 = x)
Let P (x) : x2 > x, Q(x) : x2 = x, and the UD is the set of all integers.
Determine the truth value of each proposition.
5. (∀x)[¬P (x)]
6. (∃x)[P (x) ∧ Q(x)]
7. (∃x)[P (x) ∨ Q(x)]
Negate each proposition, where x is an arbitrary integer.
8. (∀x)(x2 > 0)
9. (∃x)(x2 6= 5x − 6)
Rewrite each sentence symbolically, where the UD consists of real num-
bers.

10. The product of any two real numbers x and y is positive.

11. For each real number x, there is some real number y such that
x·y =x

Rewrite each in words, where UD is the set of integers.


12.(∀x)(x2 ≥ 0)
13. (∃x)(∃y)(x + y = 7)
14. (∃x)(∀y)(y − x = y).
Chapter 4
Arguments

Introduction

Two important questions that arise in the study of mathematics are:

(i) When is a mathematical argument correct?

(ii) What methods can be used to construct mathematical argu-


ments?

This chapter helps us to answer these questions by describing various


forms of correct and incorrect mathematical arguments.

A theorem is a statement that can be shown to be true. We demon-


strate that a theorem is true with a sequence of statements that form
an argument, called a proof. To construct proofs, methods are needed
to derive new statements from old ones. The statements used in a proof
can include axioms or postulates (which are the underlying assumptions
about mathematical structures), the hypothesis of the theorem to be

51
52 Arguments

proved and previously proved theorems. The rules of inference, which


are the means used to draw conclusions from other assertions, tie to-
gether the steps of a proof.

In this chapter rules of inference will be discussed. This will help


clarify what makes up a correct proof. Some common forms of incorrect
reasoning, called fallacies, will also be described. Then various methods
commonly used to prove theorems will be introduced.

The terms lemma and corollary are used for certain types of theorems.

1. A lemma (plural lemmas or lemmata) is a simple theorem used


in the proof of other theorems. Complicated proofs are usually
easier to understand when they are proved using a series of lemmas,
where each lemma is proved individually.

2. A corollary is a proposition that can be established directly from


a theorem that has been proved.

3. A conjecture is a statement whose truth value is unknown. When


a proof of a conjecture is found, the conjecture becomes a theorem.
Many times conjectures are shown to be false, so they are not
theorems.

4. Goldbach’s conjecture (See the end section of this chapter) is a


statement whose truth value is still unknown.

5. Four colour problem was another conjecture till 1976 (See the end
section of this chapter). After the proof was given in 1976, four
colour conjectures is now called four colour theorems.

Rules of Inference We will now introduce rules of inference for propo-


sitional logic. These rules provide the justification of the steps used to
Arguments 53

show that a conclusion follows logically from a set of hypothesis.

Table 1, given in the next page lists some important rules of inference.
The verifications of these rules of inference can be found in Examples
and as Exercises of the previous Chapter.

Here are some examples of arguments using the rules of inference.

Example 1
Suppose that the implication “if it snows today, then we will go skiing”
and its hypothesis, “it is snowing today,” are true. Then, by modus
ponens, it follows that the conclusion of the implication, “we will go
skiing,” is true.

Example 2
State which rule of inference is the basis of the following arguments:

“It is below freezing now. Therefore, it is either below freezing or


raining now”.

Solution

Let p be the proposition “It is below freezing now” and q the


proposition “It is raining now”. Then this argument is of the form

p
...p ∨ q

This is an argument that uses the addition rule.


54 Arguments

Table 1 : Rules of Inference


Rules of Tautology Name
Inference
p
. . . p∨q p → (p ∨ q) Addition
p∧q
...p (p ∧ q) → p Simplification
p
q
. . . p∧q ((p) ∧ (q)) → (p ∧ q) Conjunction
p
p→q
...q [p ∧ (p → q)] → q Law of De-
tachment
¬q
p→q
. . . ¬p [¬q ∧ (p → q)] → ¬p Law of the
Contrapos-
itive
p→q
q→r
. . . p→r [(p → q) ∧ (q → r)] → Hypothetical
(p → r) syllogism
p∨q
¬p
...q [(p ∨ q) ∧ ¬p] → q Disjunctive
syllogism
Example 3
State which rule of inference is the basis of the following arguments: “It
is below freezing and raining now. Therefore, it is below freezing now.”

Solution

Let p be the proposition “It is below freezing now,” and let q be


Arguments 55

the proposition “It is raining now”. This argument is of the form

p∧q
...p

This argument uses the simplification rule.

The tautology (p ∧ (p → q)) → q is the basis of the rule of inference


called modus ponens, or the law of detachment. The tautology is
written in the following way:

p
p→q
...q

Using this notation, the hypotheses are written in a column and the
conclusion below a bar. (The symbol . . . denotes “therefore.”) Modus
ponens states that if both an implication and its hypothesis are known
to be true, then the conclusion of this implication is true.

Example 4
The implication “if n is divisible by 3, then n2 is divisible by 9,” is true.
Consequently, if n is divisible by 3, then by modus ponens, it follows
that n2 is divisible by 9.

Example 5
State which rule of inference is used in the argument:

If it rains today, then we will not have a barbecue1 today. If we do


not have a barbecue today, then we will have a barbecue tomorrow.
Therefore, if it rains today, then we will have a barbecue tomorrow.
1
barbecue – a social gathering in the open air at which barbecued food
is served.
56 Arguments

barbecued food – food cooked on a metal frame over hot coals in an open
fire

Solution

Let p be the proposition “It is raining today”, let q be the proposi-


tion “We will not have a barbecue today,” and let r be the proposition
“We will have a barbecue tomorrow.” Then this argument is of the form

p→q
q→r
. . . p→r

Hence, this argument is a hypothetical syllogism.

Valid and Invalid Arguments

Definition
An argument is called valid if whenever all the hypotheses are true, the
conclusion is also true. Consequently, showing that q logically follows
from the hypothesis p1 , p2 , . . . , pn is the same as showing that the
implication
(p1 ∧ p2 ∧ . . . ∧ pn ) → q

is true. Otherwise, the argument is invalid, a fallacy.

Attention!
A valid argument can leads to a incorrect conclusion if one or more false
propositions are used within the argument. For example:

If 101 is divisible by 3, then 1012 is divisible by 9. 101 is divisible by


3. Consequently, 1012 is divisible by 9” is a valid argument based on
modus ponens. However, the conclusion of this argument is false, since
9 does not divide 1012 =10,201. The false proposition “101 is divisible
by 3” has been used in the argument, which means that the conclusion
Arguments 57

of the argument may be false.

When there are many premises, several rules of inference are often
needed to show that an argument is valid. This is illustrated by the
following examples, where the steps of arguments are displayed step by
step, with the reason for each step explicitly stated. These examples also
show how arguments in English can be analyzed using rules of inference.

Example 6
Show that the hypotheses “It is not sunny this afternoon and it is colder
than yesterday,” “We will go swimming only if it is sunny,” “If we do
not go swimming, then we will take a canoe2 trip,” and “If we take a
canoe trip, then we will be home by sunset” lead to the conclusion “We
will be home by sunset.”
2
canoe – a light narrow boat with both ends sharp that is usually pro-
pelled by paddling

Solution

Let p be the proposition “It is sunny this afternoon,” q the propo-


sition “It is colder than yesterday,” r the proposition “We will go swim-
ming”, s the proposition “We will take a canoe trip,” and t the propo-
sition “We will be home by sunset.” Then the hypotheses become¬p ∧
q, r → p, ¬r → s, and s → t. The conclusion is simply t.

We construct an argument to show that our hypotheses lead to the


desired conclusion as follows.

Step − Reason

1. ¬p ∧ q − Hypothesis

2. ¬p − Simplification using Step 1


58 Arguments

3. r → p − Hypothesis

4. ¬r − Modus tollens using Steps 2 and 3

5. ¬r → s − Hypothesis

6. s − Modus ponens using Steps 4 and 5

7. s → t − Hypothesis

8. t − Modus ponens using Steps 6 and 7

Example 7
Show that the hypothesis “If you send me an e-mail message, then I will
finish writing the program,” “If you do not send me an e-mail message,
then I will go to sleep early,” and “If I go to sleep early, then I will wake
up feeling refreshed” lead to the conclusion “If I do not finish writing
the program, then I will wake up feeling refreshed.”

Solution

Let p be the proposition “You send me an e-mail message,” q


the proposition “I will finish writing the program,” r the proposition
“I will go to sleep early,” and s the proposition “I will wake up feeling
refreshed,” Then the hypothesis are p → q, ¬p → r and r → s. The
desired conclusion is ¬q → s.

The following arguments shows that our hypothesis lead to the de-
sired conclusion.

Step − Reason

1. p → q − Hypothesis

2. ¬q → ¬p − Contrapositive of Step 1

3. ¬p → r − Hypothesis
Arguments 59

4. ¬q → r − Hypothetical syllogism using Steps 2 and 3

5. r → s − Hypothesis

6. ¬q → s − Hypothetical syllogism using Steps 4 and 5

Exercises

1. What rule of inference is used in each of the following arguments?

a) Aswin is mathematics student. Therefore, Aswin is either a mathe-


matics student or a computer science student.

b) Josmi is mathematics student and a computer science student. There-


fore, Josmi is mathematics student.

c) If it is rainy, then the pool will be closed. It is rainy. Therefore, the


pool is closed

d) If it snows today, the university will close. The university is not closed
today. Therefore, it did not snow today.

e) If I go swimming, then I will stay in the sun too long. If I stay in the
sun too long, then I will sunburn. Therefore, if I go swimming, then I
will sun burn.

2. Construct an argument using rules of inference to show that the hy-


potheses “Asok works hard,” “If Asok works hard, then he is a dull boy,”
“Aok is a dull boy imply he will not get the job” imply the conclusion
“Asok will not get the job”.

3. What rules of inference are used in the following famous argument?


“All men are mortal. Socrates is a man. Therefore, Socrates is mortal.”

4. For each of the following sets of premises, what relevant conclusion or


conclusions can be drawn? Explain the rules of inference used to obtain
60 Arguments

each conclusion from the premises.

a) “If I take the day off, it either rains or snows.” “I took Tuesday off
or I took Thursday off”. It was sunny on Tuesday.” It did not snow on
Thursday.”

b) “If I eat spicy foods, then I have strange dreams.” “I have strange
dreams if there is thunder while I sleep.” “I did not have strange
dreams.”

c) “I am either clever or lucky.” I am not lucky.” “If I am lucky, then I


will win the lottery.

d) “Every computer science student has a personal computer.”

e) “Ralph does not have a personal computer.” “Ann has a personal


computer.”

f) “What is good for corporations is good for the United States.” “


What is good for the United States is good for you.” “What is good for
corporations is for you to buy lots of stuff.”

g) “All rodents gnaw their food.” “Mice are rodent.” “Rabbits do not
gnaw their food.” “Bats are no rodents.”

5. For each of the following arguments, explain which rules of inference


are used for each step.

a) “Arjun, a student in this class, knows how to write programs in JAVA.


Every one who knows how to write programs in JAVA can get high-
paying job. Therefore, someone in this class can get high paying job.”

b) “Somebody in this class enjoys whale watching cares. Every person


who enjoys whale watching cares about ocean pollution. Therefore there
is a person in this class who cares about ocean pollution.”
Arguments 61

c) “Each of the 93 students in this class owns a personal computer.


Everyone who owns a personal computer can use a word processing pro-
gram. Therefore, Allen, a student in this class, can use a word processing
Program.”

d) “Everyone in Kannur District lives within 50 miles of the ocean. Some-


one in Kannur District has never seen the ocean. Therefore, someone
who lives within 50 miles of the ocean has never seen the ocean.”

6. Determine whether each of the following arguments is valid. If an


argument is correct, what rule of inference is being used? If it is not,
what fallacy occurs?

a) If n is a real number such that n > 1, then n2 > 1. Suppose that


n2 > 1. Then n > 1.

b) The number log2 3 is irrational if it is not the ratio of two integers.


Therefore, since log2 3 cannot be written in the form a/b where a and b
are integers, it is irrational.

c) If n is a real number withn > 3, then n2 > 9. Suppose that n2 ≤ 9.


Then n ≤ 3.

d) A positive integer n is either a perfect square or it has an even number


of positive integer divisors. n has an odd number of positive integer
divisors. Then n is a perfect square.

e) If n is a real number withn > 2, then n2 > 4. Suppose that n ≤ 2.


Then n2 ≤ 4.

7. Prove the proposition P (0), where P (n) is the proposition “If n is a


positive integer greater than 1, then n2 > n.” What kind of proof did
you use?

8. Let P (n) be the proposition “ If a and b are positive real numbers,


62 Arguments

then (a + b)n ≥ an + bn . “ Prove that P(1) is true. What kind of proof


did you use?

9. Prove that if n is an integer and n3 + 5 is odd, then n is even using

(a) An indirect proof. (b) a proof by contradiction.

10. Prove that the sum of two odd integers is even.

11. Prove that the sum of an irrational number and a rational number
is irrational using a proof by contradiction.

12. Prove or disprove that the product of two irrational numbers is


irrational.

13. Prove or disprove that n2 − 79n + 1601 is prime whenever n is a


positive integer.

14. Show that 3 3 is irrational.

15. Prove that if x and y are real numbers, then max(x, y) + min(x, y) =
x + y (Hint: Use a proof by cases with the two cases corresponding to
x ≥ y and x < y, respectively.)

16. Prove that if x and y are real numbers then |x|+|y| ≥ |x + y| (where
|x| represents the absolute value of x if x ≥ 0 and equal −x if x ≤ 0).

17. Use a proof by cases to show that

min(a, min(b, c)) = min(min(a, b), c) whenever a, b and c are real num-
bers.

18. Prove that if n is a positive integer, then n is odd if and only if


5n + 6 is odd.

19. Let p be prime. Prove that a2 ≡ b2 (mod p) if and only if a ≡ b(mod p)


or a ≡ −b(mod p).
Arguments 63

20. Prove or disprove that if m and n are integers such that mn = 1,


then either m=1 and n=1, or else m = -1 and n = -1.

21. Prove or disprove that every positive integer can be written as the
sum of the squares of two integers.

22. We define the floor and ceiling functions on the set of real numbers,
respectively, as below: For real number x,

(floor function) bxc = the largest integer n such that n ≤ x

(ceiling function) dxe = the smallest integer n such that x ≤ n

That is, bxc , called the floor of x, denotes the greatest integer that does
not exceed x and dxe , called the ceiling of x, denotes the least integer
that does not exceed x.

For example b1.2c = 1, b−1.2c = −2, b3c = 3;

d1.2e = 2, d−1.2e = −1, d3e = 3.

Prove or disprove each of the following statements about the floor and
ceiling functions.

a) dbxce = bxc for all real numbers x.

b) b2xc = 2 bxc Whenever x is a real number.

c) dxe + dye − dx + ye = 0 or 1 whenever x an y are real numbers.

d) dxye = dxe dye for all real numbers x and y.

e) x2 = x+1
   
2 for all real numbers x.

23. Prove that if x is a positive real number, then


jp k √
a) dxe = b xc.
64 Arguments
lp m √
b) dxe = d xe.

24. Prove that if m is a positive integer and x is a real number, then


     
1 2 m−1
bmxc = bxc + x + + x+ + ··· + x + .
m m m

25. Prove that at least one of the real numbers a1 , a2 , . . . , an is


greater than or equal to the average of these numbers. What kind of
proof did you use?

26. Prove that if n is an integer, the following four statements are


equivalent: (i) n is even, (ii) n+1 is odd, (iii) 3n+1 is odd, (iv) 3n is
even.

27. Prove or disprove that there are three consecutive odd positive inte-
gers that there are primes, that is, odd primes of the form p, p+2, and
p+4

28. Give a constructive proof of the proposition: “For every positive


integer n there is an integer divisible by more than n primes.”

29. Show that the propositions p1 , p2 , p3 , p4 and p5 can be shown to be


equivalent by proving that the implications p1 → p4 , p3 → p1 , p4 →
p2 , p2 → p5 and p5 → p3 are true.

Answers

1. a) Addition b) Simplification

c) Modus ponens d) Modus tollens

e) Hypothetical syllogism

2. Let w be “Asok works hard,” let d be “Asok is a dull boy”, and let j
be “Asok will get the job.” The hypotheses are w, w → d, and d → ¬ j.
Arguments 65

Using modus ponens and the first two hypotheses, d follows. Using
modus ponens and the last hypothesis, which is the desired conclusion,
¬ j: “Asok will not get the job”, follows.

3. Universal instantiation is used to conclude that “If Socrates is a man,


then Socrates is mortal.” Modus ponens is then used to conclude that
Socrates is mortal.

4. a) Valid conclusions are “I did not take Tuesday off,” “I took Thursday
off,” “It rained on Thursday.”

b) “I did not eat spicy foods and it did not thunder” is a valid con-
clusion.

c) “I am clever” is a valid conclusion.

d) “Ralph is not a computer science student” is a valid conclusion.

e) “That you buy lots of stuff is good for the U.S. and is good for
you” is a valid conclusion.

f) “ Mice gnaw their food” and “Rabbits are not rodents” are valid
conclusions.

5. a) Let c(x) be “x is in this class,” j(x) be “x knows how to write


programs in JAVA,” and h(x) be “x can get a high-paying job.” The
premises are c(Arjun), j(Arjun), ∀x(j(x) → h(x)). Using universal in-
stantiation and the last premise, j(Arjun) follows. Using conjunction
and the first premise, c(Arjun)∧h(Arjun) follows. Finally, using existen-
tial generalization, the desired conclusion, ∃x(c(x) ∧ h(x)) follows.

b) Let c(x) be “x is in this class,” w(x) be “x enjoys whale watching,”


and p(x) be “x cares about ocean pollution.” The premises are ∃x(c(x)∧
w(x)) and ∀x(w(x) → p(x)). From the first premise, c(y) ∧ w(y) for a
particular person y. Using simplification, w(y) follows. Using the second
66 Arguments

premise and universal instantiation, w(y) → p(y) follows. Using modus


ponens, p(y) follows, and by conjunction, c(y) ∧ p(y) follows. Finally, by
existential generalization, the desired conclusion, ∃x(c(x)∧p(x)), follows.

c) Let c(x) be “x is in this class,” p(x) be “x owns a PC,” and w(x)


be “x can use a word-processing program.” The premises are c (Allen),
∀x(c(x) → p(x)), and ∀x(p(x) → w(x)). Using the second premise
and universal instantiation, c(Allen) →p(Allen) follows. Using the first
premise and modus ponens, p(Allen) follows. Using the third premise
and universal instantiation, p(Allen)→w(Allen) follows. Finally, using
modus ponens, w(Allen), the desired conclusion, follows.

d) Let j(x) be “x is in Kannur District”f (x) be “x lives within 50 miles


of the ocean,” and s(x) be “x has seen the ocean. “The premises are
∀x(j(x) → f (x)) and ∃ x(j(x) ∧ ¬ s(x)). The second hypothesis and
existential instantiation imply that j(y) ∧ ¬ s(y) for a particular person
y. By simplification, j(y) for this person y. Using universal instantiation
and the first premise, j(y) → f (y), and by modus ponens, f (y) follows.
By simplification, ¬ s(y) follows from j(y) ∧ ¬ s(y). So f (y) ∧ ¬ s(y)
follows by conjunction. Finally, the desired conclusion, ∃ x(f (x)∧¬ s(x)),
follows by existential generalization.

6. a) Fallacy of affirming the conclusion

b) Fallacy of begging the question

c) Valid argument using modus tollens

d) Valid argument using disjunctive syllogism

e) Fallacy of denying the hypothesis

7. The proposition is vacuously true since 0 is not a positive integer.


Vacuous proof.
Arguments 67

8. P (1) is true since (a + b)1 = a + b ≥ a1 + b1 = a + b. Direct proof.

9. a) Assume that n is odd, so n = 2k + 1 for some integer k. Then


n3 + 5 = 2(4k 3 + 6k 2 + 3k + 3). Since n3 + 5 is two times some intger,
it is even.

b) Suppose that n3 + 5 is odd and n is odd. Since n is odd and the


product of two odd numbers is odd, it follows that n2 is odd and then
that n3 is odd. But then 5 = (n3 + 5) − n3 would have to be even since
it is the diffrence of two odd numbers. Therefore, the supposition that
n3 + 5 and n were both odd is wrong.

10. Let n = 2k + 1 and m = 2l + 1 be odd integers. Then n + m =


2(k + l + 1) is even.

11. Suppose that r is rational and i is irrational and s = r + i is rational


. Then by Exercise 10, s + (−r) = i is rational, which is a contradiction.
√ √ √
12. Since 2 · 2 = 2 is rational and 2 is irrational, the product of
two irrational numbers is not necessarily irrational.

13. n = 1601 is a counterexample.


1
a
14. Suppose that 3 3 = b where a, b ∈ Z, b 6= 0, and gcd (a, b) = 1.
a3
Then 3 = b3 , so that 3b3 = a3 . Hence 3|a3 , which can happen only if 3|a.
Let a = 3m. Then 3b3 = 27m3 , or b3 = 9m3 . Thus 3|b3 , which shows
that 3|b. This is a contradiction of the assumption that gcd(a, b) = 1.

15. If x ≤ y, then max (x, y) + min(x, y) = y + x = x + y. If x ≥ y,


then max (x, y) + min(x, y) = x + y. Since these are the only two cases,
the equality always holds.

16. There are four cases. Case 1 : x ≥ 0 and y ≥ 0. Then |x| + |y| =
x + y = |x + y|. Case 2 : x < 0 and y < 0. Then x| + |y| = −x + (−y)
= −(x + y) = |x + y| since x + y < 0. Case 3 : x ≥ 0 and y < 0. Then
68 Arguments

|x| + |y| = x + (−y). If x ≥ −y, then |x + y| = x + y. But since y < 0,


−y > y, so that |x| + |y| = x + (−y) > x + y = |x + y|. If x < −y, then
|x + y| = −(x + y) = −x + (−y). But since x ≥ 0, x ≥ −x, so that
|x| + |y| = x + (−y) ≥ −x + (−y) = |x + y|. Case 4 : x < 0 and y ≥ 0.
Identical to Case 3 with the roles of x and y reversed.

17. There are three cases to consider : Case 1, a is smallest, or tied for
smallest; Case 2, b is smallest, or tied for smallest; Case 3, c is smallest, or
tied for smallest. Since one of a, b, and c is smallest, or tied for smallest,
these three cases cover all possibilities. In Case 1, a ≤ min(b, c), so the
left-hand side is a and the right hand side is also a since min (a, c) = a.
The argument in the other two cases is similar.

18. First, assume that n is odd, so that n = 2k + 1 for some integer k.


Then 5n + 6 = 5(2k + 1) + 6 = 10k + 11 = 2(5k + 5) + 1. Hence 5n + 6
is odd. To prove the converse, suppose that n is even, so that n = 2k
for some integer k. Then 5n + 6 = 10k + 6 = 2(5k + 3), so that 5n + 6
is even. Hence n is odd if and only if 5n + 6 is odd.

19. a2 = b2 (mod p) if and only if p|(a2 − b2 ) = (a + b)(a − b). By


the uniqueness of prime factorization, this is equivalent to p|(a − b) or
p|(a + b), which is the same as a ≡ −b (mod p).

20. This proposition is true. Suppose that m is neither 1 nor −1. Then
mn has a factor m larger than 1. On the other hand, mn = 1, and 1 has
no such factor. Hence m = 1 or m = −1. In the first case n = 1, and in
1
the second case n = −1, since n = m.

21. The positive integer 3 is not the sum of two squares of integers, so
that the proposition is false.

22. a) True; since bxc is already an integer, dbxce = bxc


Arguments 69

1
b) False; x = 2 is a counter example.

c) True; if x or y is an integer, then using property 4b in Table 1


of Section 1.6, the difference is 0. If neither x nor y is an integer, then
x = n + ε and y = m + δ, where n and m are integers and ε and δ are
positive real numbers less than 1. Then m + n < x + y < m + n + 2, so
dx + ye is either m + n + 1 or m + n + 2. Therefore, the given expression
is either (n + 1) + (m + 1) − (m + n + 1) = 1 or (n + 1) + (m + 1)
−(m + n + 2) = 0, as desired.
1
d) False; x = 4 and y = 3 is a counterexample.
1
e) False; x = 2 is a counter example.

23. a) If x is positive integer, then the two side are equal. So suppose
that x = n2 +m+ε, where n2 is the largest perfect square less than x, m
√ p √
is a nonnegative integer, and 0 < ε ≤ 1. Then x and bxc = n2 + m
are between n and n + 1, so both sides equal n.

b) If x is a positive integer, then the two sides are equal. So suppose


that n + 1 x = n2 − m − ε, where n2 is the smallest perfect square
greater than x, m is a nonnegative integer, and ε is a real number with
√ p √
0 < ε ≤ 1. Then both x and dxe = n2 − m are between n − 1 and
n. Therefore, both sides of the equation equal n.
r

24. Let x = n + m + ε, where n is an integer, r is a nonnegative integer
1
less thanm, and ε is a real number with 0 ≤ ε < m . The left-hand side is
bnm
j + r + mεck = nm+r. On the right-handjside, the terms
k bxc through
x + (m+r−1)
m are all just n and terms from x + (m−r)
m on are all n+1.
Therefore, the right-hand side is (m − r)n + r(n + 1) = nm + r, as well.

25. We will give a proof by contradiction. Suppose that a1 , a2 . . . , an


are all less thanA, where A is the average of these numbers. Then
70 Arguments

a1 + a2 + · · · + an < nA. Dividing both sides by n shows that A =


(a1 +a2 +···+an )
n < A, which is a contradiction.

26. We will show that the four statements are equivalent by showing
that (i) implies (ii), (ii) implies (iii), (iii) implies (iv), and (iv) implies
(i). First, assume that n is even. Then n = 2k for some integer k. Then
n + 1 = 2k + 1, so that n + 1 is odd. This shows that (i) implies (ii).
Next, suppose that n + 1 is odd, so that n + 1 = 2k + 1 for some integer
k. Then 3n + 1 = 2n + (n + 1) = 2(n + k) + 1, which shows that 3n + 1 is
odd, showing that (ii) implies (iii). Next, suppose that 3n + 1 is odd, so
that 3n + 1 = 2k + 1 for some integer k. Then 3n = (2k + 1) − 1 = 2k,
so that 3n is even. This shows that (iii) implies (iv). Finally, suppose
that n is not even. Then n is odd, so n = 2k + 1 for some integer k.
Then 3n = 3(2k + 1) = 6k + 3 = 2(3k + 1) + 1, so that 3n is odd. This
completes an indirect proof that (iv) implies (i).

27. The integers 3, 5, and 7 are three primes of the desired form.

28. Assume we have the first n + 1 prime numbers p1 , p2 , . . . , pn+1 .


Then p1 p2 . . . pn+1 is divisible by more than n primes.

29. Suppose that p1 , p2 , . . . , pn are all the primes congruent to 3 mod-


ule 4, except for 3. Let q = 4p1 p2 . . . pn + 3. Then q = 3(mod4), and
q is not divisible by pi , i = 1, 2, . . . , n, or by 3. Since q must have at
least one prime factor that is congruent to 3 module 4, there must be
a prime of this type not in our list. This is a nonconstructive existence
proof.

30. Suppose that p1 → p4 → p2 → p5 → p3 → p1 . To prove that


one of these propositions implies any of the others, just use hypothetical
syllogism repeatedly.
Chapter 5
Proof Methods

Methods of Proving Theorems

Now we discuss how different types of statements are proved by ex-


plicitly describing the methodology of constructing proofs.

Because many theorems are implications, the techniques for proving


implications are important. Recall that p → q is true unless p is true but
q is false. Note that when the statement p → q is proved, it need only
be shown that q is true if p is true; it is not usually the case that q is
proved to be true. The following discussion will give the most common
techniques for proving implications.

Direct Proof

The implication p → q can be proved by showing that if p is true, then q


must also be true. This shows that combination p true and q false never
occurs. A proof of this kind is called a direct proof. To carry out such

71
72 Proof Methods

a proof, assume that p is true and use rules of inference and theorems
already proved to show that q must also be true.

Example 1
Give a direct proof of the theorem “If n is odd, then n2 is odd.”

Solution

Assume that the hypothesis of this implication is true, namely, sup-


pose that n is odd. Then n = 2k + 1, where kis an integer. It follows
that n2 = (2k + 1)2 = 4k 2 + 4k + 1 =2(2k 2 + 2k)+1. That is, n2 is 1
more than twice an integer; that is, n2 is 1 more than an even integer.
Therefore, n2 is odd.

Contrapositive Method [Proof by Contraposition]

Since the implication p → q is equivalent to its contra positive, ¬q → ¬p,


the implication p → q can be proved by showing that its contrapositive
¬q → ¬p, is true. This related implication is usually proved directly, but
any proof technique can be used. An argument of this type is called an
indirect proof.

Example 2
Give an indirect proof of the theorem “If 3n + 2 is odd, then n is odd”

Solution

Here take p : 3n + 2 is odd.

q: n is odd.

To prove that p → q, we prove its contrapositive ¬q → ¬p.

For this assume that the conclusion of this implication is false; namely,
assume that n is even. Then n = 2k for some integer k. It follows that
3n + 2 = 3(2k) + 2 = 6k + 2 =2(3k + 1), so 3n + 2 is even (Since it is
Proof Methods 73

a multiple of 2). Since the negation of the conclusion of the implication


implies that the hypothesis is false, the original implication is true.

Vacuous Proof

Suppose that the hypothesis p of an implication p → q is false. Then


the implication p → q is true, because the statement has the formF →
T or F → F, then hence is true. Consequently, if it can be shown that p
is false, then a proof, called a vacuous proof, of the implication p → q
can be given. Vacuous proofs are often used to establish special cases of
theorems that state that an implication is true for all positive integers
[i.e., a theorem of the kind ∀nP (n) and P (n) is a propositional function].

Example 3
Show that the proposition P (0) is true where P (n) is the propositional
function “If n > 1 then n2 > n.”

Solution

Note that the proposition P (0) is the implication “If 0 > 1, then
2
0 > 0.” Since the hypothesis 0 > 1 is false, the implication P (0) is
automatically true.

Remark
The fact that the conclusion of this implication, 02 > 0, is false is irrel-
evant to the truth-value of the implication, because an implication with
a false hypothesis is guaranteed to be true.

Trivial Proof

Suppose that the conclusion q of an implication p → q is true, since the


statement has the formT → T or F → T, which are true. Hence, if it can
be shown that q is true, then a proof, called a trivial proof, of p → q
can be given. Trivial proofs are often important when special cases of
74 Proof Methods

theorems are proved.

Example 4
Let P (n) be the proposition “If a and b are positive integers with a ≥ b,
then an ≥ bn .” Show that the proposition P (0) is true.

Solution

The proposition P (0) is “If a ≥ b, thena0 ≥ b0 = 1.” Since a0 =


b0 = 1, the conclusion of P (0) is true. Hence, P (0) is true. This is
an example of a trivial proof. Note that the hypothesis, which is the
statement “a ≥ b,” was not needed in this proof.

Contradiction Method

Suppose that a contradiction q can be found so that ¬p → q is true,


that is, ¬p → F is true. Then the proposition ¬p must be false. Conse-
quently, pmust be true. This technique can be used when a contradiction,
such as r ∧ ¬r, can be found so that it is possible to show that the impli-
cation ¬p → (r ∧ ¬r) is true. An argument of this type is called a proof
by contradiction.

Example 5

Prove that 2 is irrational by giving a proof by contradiction.

Solution

Let p be the proposition “ 2 is irrational.” Suppose that ¬p is true.

Then 2is rational. We will show that this leads to a contradiction.

Under the assumption that 2 is rational, there exists integers a and

b with 2 = a/b, where a and b have no common factors (So that the

fraction a/b is in lowest terms). Since 2 = a/b, when both sides of this
Proof Methods 75

equation are squared, it follows that

2 = a2 /b2

Hence, 2b2 = a2

This means that a2 is even, implying that a is even (See Example 19).
Furthermore, since a is even, a = 2c for some integer c. Thus

2b2 = 4c2 ,

so b2 = 2c2 .

This means that b2 is even. Hence, b must be even as well.



It has been shown that ¬p implies that 2 = a/b, where a and bhave
no common factors, and 2 divides a and b. This is a contradiction since
we have shown that ¬p implies both r and ¬r where r is the statement
that a and bare integers with no common factors. Hence, ¬p is false, so

that p : “ 2 is irrational” is true.

Indirect Proof by Contradiction

An indirect proof of an implication can be rewritten as a proof by


contradiction. In an indirect proof we show that p → q is true by using a
direct proof to show that ¬q → ¬p is true. That is, in an indirect proof
of p → q we assume that ¬q is true and show that ¬p must also be true.
To rewrite an indirect proof of p → q as a proof by contradiction, we
suppose that both p and ¬q are true. Then we use the steps from the
direct proof of ¬q → ¬p to show that ¬p must also be true. This leads
to the contradictionp ∧ ¬p, completing the proof by contradiction. The
following example illustrates how an indirect proof of an implication can
be rewritten as a proof by contradiction.
76 Proof Methods

Example 6
Give a proof by contradiction of the theorem “if n2 is even, then n is
even.”

Solution

Here we take p: n2 is even

q: n is even

The method is as follows: We prove p → q using proof by contradiction


discussed just above. For this we assume p and¬q. Then following the
steps of contrapositive method we get¬q → ¬p. Then we have p ∧ ¬p
which is a contradiction. Hence ¬q is false and hence q is true.

We assume that n2 is even and that then n is not even. Now n


is not even implies n is an odd number of the form n = 2k + 1. Then
n2 = (2k + 1)2 = 4k 2 + 4k + 1 = 4(k 2 + k) + 1 ; that is, n2 is an even
integer plus 1 and hence n2 odd. Hence we have both n2 even and n2
odd; that is, p ∧ ¬p which is a contradiction. Hence ¬q is false and hence
q is true; that is, n is even.

Example 7
Give a proof by contradiction of the theorem “if 3n+2 is odd, then n is
odd.”

Solution

We assume that 3n+2 is odd and that n is not odd, so that n is


even. Following the same steps as in the above example, we can show
that if n is even, then 3n+2 is even. This contradicts the assumption
that 3n+2 is odd. This completes the proof.

Proof by Cases
Proof Methods 77

To prove an implication of the form

(p1 ∨ p2 ∨ . . . ∨ pn ) → q

the tautology

[(p1 ∨ p2 ∨ . . . ∨ pn ) → q] ↔ [(p1 → q) ∧ (p2 → q) ∧ . . . ∧ (pn → q)]

can be used as a rule of inference. This shows that the original impli-
cation with a hypothesis made up of a disjunction of the propositions
p1 , p2 , . . . , pn can be proved by proving each of the n implications
pi → q, i = 1, 2, . . . , n, individually. Such an argument is called a
proof by cases. Sometimes to prove that an implication p → q is true,
it is convenient to use a disjunction p1 ∨ p2 ∨ ... ∨ pn instead of p as
the hypothesis of the implication, where p and p1 ∨ p2 ∨ ... ∨ pn are
equivalent.

Example 8
Prove the implication “If n is an integer not divisible by 3, then n2 ≡
1(mod3).”

Solution

Let p be the proposition “ n is not divisible by 3” and let q be the


proposition “n2 ≡ 1(mod3)”. Then p is equivalent to p1 ∨ p2 where p1
is “n ≡ 1(mod3)” and p2 is “n ≡ 2(mod3).” Hence, to show that p → q
it can be shown that p1 → q and p2 → q. It is easy to give direct proof
of these two implications:

First, suppose that p1 is true. Then n ≡ 1(mod3), so that n = 3k + 1


78 Proof Methods

for some integer k. Thus,

n2 = 9k 2 + 6k + 1 = 3(3k 2 + 2k) + 1.

It follows that n2 ≡ 1(mod3). Hence, the implication p1 → q is true.


Next, suppose that p2 is true. Then n ≡ 2(mod3), so that n = 3k + 2
for some integer k. Thus,

n2 = 9k 2 + 12k + 4 = 3(3k 2 + 4k + 1) + 1.

Hence, n2 ≡ 1(mod3), so the implication p2 → q is true.

Since it has been shown that both p1 → q and p2 → q are true, it can
be concluded that (p1 ∨ p2 ) → q is true. Moreover, since p is equivalent
to p1 ∨ p2 , it follows that p → q is true.

Proving “if and only if ” Theorems

To prove a theorem that it is an equivalence, that is, one that is


a statement of the form p ↔ q where p and q are propositions, the
tautology
(p ↔ q) ↔ [(p → q) ∧ (q → p)]

can be used. That is, the proposition “p if and only if q,” can be proved
if both the implications “if p, then q” and “if q, then p” are proved.

Example 9
Prove the theorem “The integer n is odd if and only if n2 is odd”.

Solution

The theorem has the form “p if and only if q,” where p is “ n is odd”
and q is “n2 is odd”. To prove this theorem, we need to show that p → q
and q → p are true.
Proof Methods 79

We have already shown (In a previous example ) that p → q is true.


We will use an indirect proof to prove that q → p. Assume that its
conclusion is false, namely, that n is even. Then n = 2k for some integers
k. Thenn2 = 4k 2 = 2(2k 2 ), so n2 is even (since it is a multiple of 2).
i.e., we have show that ¬p → ¬q. This completes the indirect proof of
q → p.

Since we have shown that both p → q and q → p are true, we have


shown that “p if and only if q”. Hence the theorem is true.

Proving Equivalence of Several Propositions

Sometimes a theorem states that several propositions are equivalent.


Such a theorem states that propositions p1 , p2 , p3 , ..., pn are equivalent.
This can be written as

p1 ↔ p2 ↔ ... ↔ pn .

which states that all n propositions have the same truth-values. One
way to prove these mutually equivalent is to use the tautology

[p1 ↔ p2 ↔ ... ↔ pn ] ↔ [(p1 → p2 ) ∧ (p2 → p3 ) ∧ ... ∧ (pn → p1 )]

This shows that if the implications p1 → p2 , p2 → p3 , . . . , pn → p1


can be shown to be true, then the propositions p1 , p2 , . . . , pn are all
equivalent.

Example 10
Prove that when n is an integer, the following three statements are
equivalent.
p1 : n mod 3 = 1 or n mod 3 = 2
80 Proof Methods

p2 : n is not divisible by 3

p3 : n2 ≡ 1(mod3)

Solution

To show that the statements are equivalent, we can prove that the
implications p1 → p2 , p2 → p3 and p3 → p1 are true.

We will use a direct proof to show that p1 → p2 is true. Assume that


n mod 3 =1 or 2. By the division algorithm, n = 3q + r where 0 ≤ r < 3.
By the definition of mod, we have r = n mod3 = 1. Since n is divisible
by 3 if and only if r = 0, the assumption that n mod 3 = 1 or 2 implies
that n is not divisible by 3. This completes the proof that p1 → p2 is
true.

We have already shown that p2 → p3 is true in Example 8.

We will use an indirect proof to show that p3 → p1 is true. We


assume that the conclusion of this implication is false, namely, that n
mod3 is neither 1 nor 2. Since n mod 3 equals 0,1 or 2, we see that n
mod 3 = 0. This means that 3 divides n , so that n = 3k for some integer
k. This implies thatn2 = 9k 2 = 3(3k 2 ), which show that n2 ≡ 0(mod 3),
so that p3 is false. This completes the indirect proof that p3 → p1 and
it also completes the proof of the theorem.

Theorems and Quantifiers

Many theorems are stated as propositions that involve quantifiers. A


variety of methods are used to prove theorems that are quantifications.
We will describe some of the most important of these here.

Existence Proof
Proof Methods 81

Many theorems are assertions that objects of a particular type exist.


A theorem of this type is a proposition of the form ∃xP (x), where P is
a predicate. A proof of a proposition of the form ∃xP (x) is called an
existence proof. We discuss two ways to prove a theorem of this type:

1. Sometimes an existence proof of ∃xP (x) can be given by finding


an element a such that P (a) is true. Such an existence proof is
called constructive.

2. It is possible to give an existence proof that is nonconstructive;


that is, we do not find an element a such that P (a) is true, but
rather prove that ∃xP (x) is true in some other way.

One common method of giving a non-constructive existence proof is to


use proof by contradiction and show that the negation of the existential
quantification implies a contradiction.

The concept of a constructive existence proof is illustrated by the fol-


lowing example.

Example 11 (A Constructive Existence Proof )


Show that there are n consecutive composite2 positive integers for every
positive integern. Note that this asks for proof of the quantification:
∀n ∃x (x + i is composite for i = 1, 2, . . . , n).

Solution

Let x = (n + 1)! + 1

Consider the integers

x + 1, x + 2, . . . , x + n.

Note that i + 1 divides x + i = (n + 1)! + (i + 1) for i = 1, 2, ... , n.


82 Proof Methods

Hence, n consecutive composite positive integers have been given.


1
Prime is an integer p which is not 0 or ±1 and is divisible by no
integers except ±1 and ±p.
±2, ±3, ±5, ±7 and ±11 are some prime numbers.
2
Composite is an integer that has two or more prime factors. For
example, 4, 6, 9 or 10 are composite numbers.

Remark
Note that in the solution above, a number x such x + i is composite for
i = 1, 2, . . . , n has been produced. Hence, this is an example of a
constructive existence proof.

Example 12 (A non constructive Existence Proof )


Show that for every positive integer n there is a prime greater than n.
This problem asks for a proof of an existential quantification, namely
∃xQ(x), where Q(x) is the proposition “x is prime and x is greater than
n,” and the universe of discourse is the set of positive integers.

Solution

Let n be a positive integer. To show that there is a prime greater


than n, consider the integer n!+1. Since every integer has a prime factor,
there is at least one prime dividing n!+1 (One possibility is that n! +1
is already prime). Note that when n !+1 is divided by an integer less
than or equal to n, the remainder equals 1. Hence, any prime factor of
this integer must be greater than n. This proves the result.

Remark
The argument in the above example is a non-constructive existence proof
because a prime larger than n has not been produced. It has simply been
shown that one must exist.
Proof Methods 83

Counter Examples

Suppose a statement of the form ∀xP (x) is false. How can we show this?
Recall that the propositions ¬∀xP (x) and ∃x¬P (x) are equivalent. This
means that if we find an element a such that P (a) is false, then we have
shown that ∃x¬P (x) is true, which means that ∀xP (x) is false. An
element a for which P (a) is false is called a counterexample.

Note that only one counterexample needs to be found to show that


∀xP (x) is false.

Example 13
Show that the assertion “All primes are odd” is false.

Solution

The statement “All primes are odd” is a universal quantification,


namely;
∀x O(x),

where O(x) is the proposition “x is odd” and the universe of discourse


is the set of primes. Note that x = 2 is a counterexample, since 2 is a
prime number that is even. Hence the statement “All prime numbers
are odd” is false.

Attention!
It is a common mistake to assume that one or more examples establish
the truth of a statement. No matter how many examples there are where
P (x) is true; the universal quantification ∀xP (x) may still be false. An
illustration is given in the following example.

Example 14
Is n2 − n + 41 prime for all non-negative integers n? That is, “is the
statement ∀nP (n) a theorem,” where P (n) is the statement “n2 − n + 41
84 Proof Methods

is prime” and the universe of discourse is the set of non-negative integers?

Solution

To determine whether n2 − n + 41 is prime for all non-negative inte-


gers, we might begin by examining whether it is prime for the smallest
non-negative integers. It can be verified that n2 − n + 41 is prime for all
non-negative integers not exceeding 40. However, if we decided this was
enough checking, we would come to the wrong conclusion. It is not true
that n2 − n + 41 is prime for all non-negative integers. When n = 41, it
is composite; for, 412 − 41 + 41 = 412 is a square of prime.

Remark
The above examples illustrate the crucial point that a statement may
not be true, even though there are many examples for which it is true.

Exercises

1. What rule of inference is used in each of the following arguments?

a) Aswin is mathematics student. Therefore, Aswin is either a mathe-


matics student or a computer science student.

b) Josmi is mathematics student and a computer science student. There-


fore, Josmi is mathematics student.

c) If it is rainy, then the pool will be closed. It is rainy. Therefore, the


pool is closed

d) If it snows today, the university will close. The university is not closed
today. Therefore, it did not snow today.

e) If I go swimming, then I will stay in the sun too long. If I stay in the
sun too long, then I will sunburn. Therefore, if I go swimming, then I
will sun burn.
Proof Methods 85

2. Construct an argument using rules of inference to show that the hy-


potheses “Asok works hard,” “If Asok works hard, then he is a dull boy,”
“Aok is a dull boy imply he will not get the job” imply the conclusion
“Asok will not get the job”.

3. What rules of inference are used in the following famous argument?


“All men are mortal. Socrates is a man. Therefore, Socrates is mortal.”

4. For each of the following sets of premises, what relevant conclusion or


conclusions can be drawn? Explain the rules of inference used to obtain
each conclusion from the premises.

a) “If I take the day off, it either rains or snows.” “I took Tuesday off
or I took Thursday off”. It was sunny on Tuesday.” It did not snow on
Thursday.”

b) “If I eat spicy foods, then I have strange dreams.” “I have strange
dreams if there is thunder while I sleep.” “I did not have strange
dreams.”

c) “I am either clever or lucky.” I am not lucky.” “If I am lucky, then I


will win the lottery.

d) “Every computer science student has a personal computer.” “Ralph


does not have a personal computer.” “Ann has a personal computer.”

e) “What is good for corporations is good for the United States.” “


What is good for the United States is good for you.” “What is good for
corporations is for you to buy lots of stuff.”

f) “All rodents gnaw their food.” “Mice are rodent.” “Rabbits do not
gnaw their food.” “ Bats are no rodents.”

5. For each of the following arguments, explain which rules of inference


are used for each step.
86 Proof Methods

a) “Arjun, a student in this class, knows how to write programs in JAVA.


Every one who knows how to write programs in JAVA can get high-
paying job. Therefore, someone in this class can get high paying job.”

b) “Somebody in this class enjoys whale watching cares. Every person


who enjoys whale watching cares about ocean pollution. Therefore there
is a person in this class who cares about ocean pollution.”

c) “Each of the 93 students in this class owns a personal computer.


Everyone who owns a personal computer can use a word processing pro-
gram. Therefore, Allen, a student in this class, can use a word processing
Program.”

d) “Everyone in Kannur District lives within 50 miles of the ocean. Some-


one in Kannur District has never seen the ocean. Therefore, someone
who lives within 50 miles of the ocean has never seen the ocean.”

6. Determine whether each of the following arguments is valid. If an


argument is correct, what rule of inference is being used? If it is not,
what fallacy occurs?

a) If n is a real number such that n > 1, then n2 > 1. Suppose that


n2 > 1. Then n > 1.

b) The number log2 3 is irrational if it is not the ratio of two integers.


Therefore, since log2 3 cannot be written in the form a/b where a and b
are integers, it is irrational.

c) If n is a real number with n > 3, then n2 > 9. Suppose that n2 ≤ 9.


Then n ≤ 3.

d) A positive integer n is either a perfect square or it has an even number


of positive integer divisors. n has an odd number of positive integer
divisors. Then n is a perfect square.
Proof Methods 87

e) If n is a real number with n > 2, then n2 > 4. Suppose that n ≤ 2.


Then n2 ≤ 4.

7. Prove the proposition P (0), where P (n) is the proposition “If n is a


positive integer greater than 1, then n2 > n.” What kind of proof did
you use?

8. Let P (n) be the proposition “ If a and b are positive real numbers,


then (a + b)n ≥ an + bn . “ Prove that P(1) is true. What kind of proof
did you use?

9. Prove that if n is an integer and n3 + 5 is odd, then n is even using

(a) An indirect proof. (b) a proof by contradiction.

10. Prove that the sum of two odd integers is even.

11. Prove that the sum of an irrational number and a rational number
is irrational using a proof by contradiction.

12. Prove or disprove that the product of two irrational numbers is


irrational.

13. Prove or disprove that n2 − 79n + 1601 is prime whenever n is a


positive integer.

14. Show that 3 3 is irrational.

15. Prove that if x and y are real numbers, then max(x, y) + min(x, y) =
x + y (Hint: Use a proof by cases with the two cases corresponding to
x ≥ y and x < y, respectively.)

16. Prove that if x and y are real numbers then |x|+|y| ≥ |x + y| (where
|x| represents the absolute value of x if x ≥ 0 and equal −x if x ≤ 0).

17. Use a proof by cases to show that


88 Proof Methods

min(a, min(b, c)) = min(min(a, b), c) whenever a, b and c are real num-
bers.

18. Prove that if n is a positive integer, then n is odd if and only if


5n + 6 is odd.

19. Let p be prime. Prove that a2 ≡ b2 (modp) if and only if a ≡ b(modp)


or a ≡ −b(modp).

20. Prove or disprove that if m and n are integers such that mn = 1,


then either m=1 and n=1, or else m = -1 and n = -1.

21. Prove or disprove that every positive integer can be written as the
sum of the squares of two integers.

22. We define the floor and ceiling functions on the set of real numbers,
respectively, as below: For real number x,

(floor function) bxc = the largest integer n such that n ≤ x

(ceiling function) dxe = the smallest integer n such that x ≤ n

That is, bxc , called the floor of x, denotes the greatest integer that does
not exceed x and dxe , called the ceiling of x, denotes the least integer
that does not exceed x.

For example b1.2c = 1, b−1.2c = −2, b3c = 3;

d1.2e = 2, d−1.2e = −1, d3e = 3.

Prove or disprove each of the following statements about the floor and
ceiling functions.

a) dbxce = bxc for all real numbers x.

b) b2xc = 2 bxc Whenever x is a real number.


Proof Methods 89

c) dxe + dye − dx + ye = 0 or 1 whenever x an y are real numbers.

d) dxye = dxe dye for all real numbers x and y.

e) x2 = x+1
   
2 for all real numbers x.

23. Prove that if x is a positive real number, then


jp k √
a) dxe = b xc.
lp m √
b) dxe = d xe.

24. Prove that if m is a positive integer and x is a real number, then


     
1 2 m−1
bmxc = bxc + x + + x+ + ··· + x + .
m m m

25. Prove that at least one of the real numbers a1 , a2 , . . . , an is


greater than or equal to the average of these numbers. What kind of
proof did you use?

26. Prove that if n is an integer, the following four statements are


equivalent: (i) n is even, (ii) n+1 is odd, (iii) 3n+1 is odd, (iv) 3n is
even.

27. Prove or disprove that the there are three consecutive odd positive
integers that there are primes, that is, odd primes of the form p, p+2,
and p+4

28. Give a constructive proof of the proposition: “For every positive


integer n there is an integer divisible by more than n primes.”

29. Prove that there are infinitely many primes congruent to 3 modulo 4.
Is your proof constructive or nonconstructive? (Hint: One approach is to
assume that there are only finitely many such primes p1 , p2 , . . . , pn .
Let q = 4p1 p2 . . . pn + 3. Show that q must have a prime factor congru-
90 Proof Methods

ent to 3 modulo 4 not among the n primes p1 , p2 , . . . , pn .)

30. Show that the propositions p1 , p2 , p3 , p4 and p5 can be shown to be


equivalent by proving that the implications p1 → p4 , p3 → p1 , p4 →
p2 , p2 → p5 and p5 → p3 are true.

31. Prove that there are irrational numbers a and b such that ab is
rational. Is your proof constructive or non-constructive? [Hint: Let
√ √
a = 2 and b = 2. Show that either ab or (ab )b is rational].

32. Prove that it is impossible to cover completely with dominos the 8×8
chessboard with two squares at opposite corners of the board removed.

Answers

1. a) Addition b) Simplification

c) Modus ponens d) Modus tollens

e) Hypothetical syllogism

2. Let w be “Asok works hard,” let d be “Asok is a dull boy”, and let j
be “Asok will get the job.” The hypotheses are w, w → d, and d → ¬ j.
Using modus ponens and the first two hypotheses, d follows. Using
modus ponens and the last hypothesis, which is the desired conclusion,
¬ j: “Asok will not get the job”, follows.

3. Universal instantiation is used to conclude that “If Socrates is a man,


then Socrates is mortal.” Modus ponens is then used to conclude that
Socrates is mortal.

4. a) Valid conclusions are “I did not take Tuesday off,” “I took Thursday
off,” “It rained on Thursday.”

b) “I did not eat spicy foods and it did not thunder” is a valid con-
clusion.
Proof Methods 91

c) “I am clever” is a valid conclusion.

d) “Ralph is not a computer science student” is a valid conclusion.

e) “That you buy lots of stuff is good for the U.S. and is good for
you” is a valid conclusion.

f) “Mice gnaw their food” and “Rabbits are not rodents” are valid
conclusions.

5. a) Let c(x) be “x is in this class,” j(x) be “x knows how to write


programs in JAVA,” and h(x) be “x can get a high-paying job.” The
premises are c(Arjun), j(Arjun), ∀x(j(x) → h(x)). Using universal in-
stantiation and the last premise, j(Arjun) follows. Using conjunction
and the first premise, c(Arjun)∧h(Arjun) follows. Finally, using existen-
tial generalization, the desired conclusion, ∃x(c(x) ∧ h(x)) follows.

b) Let c(x) be “x is in this class,” w(x) be “x enjoys whale watching,”


and p(x) be “x cares about ocean pollution.” The premises are ∃x(c(x)∧
w(x)) and ∀x(w(x) → p(x)). From the first premise, c(y) ∧ w(y) for a
particular person y. Using simplification, w(y) follows. Using the second
premise and universal instantiation, w(y) → p(y) follows. Using modus
ponens, p(y) follows, and by conjunction, c(y) ∧ p(y) follows. Finally, by
existential generalization, the desired conclusion, ∃x(c(x)∧p(x)), follows.

c) Let c(x) be “x is in this class,” p(x) be “x owns a PC,” and w(x)


be “x can use a word-processing program.” The premises are c (Allen),
∀x(c(x) → p(x)), and ∀x(p(x) → w(x)). Using the second premise
and universal instantiation, c(Allen) →p(Allen) follows. Using the first
premise and modus ponens, p(Allen) follows. Using the third premise
and universal instantiation, p(Allen)→w(Allen) follows. Finally, using
modus ponens, w(Allen), the desired conclusion, follows.
92 Proof Methods

d) Let j(x) be “x is in Kannur District”f (x) be “x lives within 50 miles


of the ocean,” and s(x) be “x has seen the ocean. “The premises are
∀x(j(x) → f (x)) and ∃ x(j(x) ∧ ¬ s(x)). The second hypothesis and
existential instantiation imply that j(y) ∧ ¬ s(y) for a particular person
y. By simplification, j(y) for this person y. Using universal instantiation
and the first premise, j(y) → f (y), and by modus ponens, f (y) follows.
By simplification, ¬ s(y) follows from j(y) ∧ ¬ s(y). So f (y) ∧ ¬ s(y)
follows by conjunction. Finally, the desired conclusion, ∃ x(f (x)∧¬ s(x)),
follows by existential generalization.

6. a) Fallacy of affirming the conclusion

b) Fallacy of begging the question

c) Valid argument using modus tollens

d) Valid argument using disjunctive syllogism

e) Fallacy of denying the hypothesis

7. The proposition is vacuously true since 0 is not a positive integer.


Vacuous proof.

8. P (1) is true since (a + b)1 = a + b ≥ a1 + b1 = a + b. Direct proof.

9. a) Assume that n is odd, so n = 2k + 1 for some integer k. Then


n3 + 5 = 2(4k 3 + 6k 2 + 3k + 3). Since n3 + 5 is two times some intger,
it is even.

b) Suppose that n3 + 5 is odd and n is odd. Since n is odd and the


product of two odd numbers is odd, it follows that n2 is odd and then
that n3 is odd. But then 5 = (n3 + 5) − n3 would have to be even since
it is the diffrence of two odd numbers. Therefore, the supposition that
n3 + 5 and n were both odd is wrong.
Proof Methods 93

10. Let n = 2k + 1 and m = 2l + 1 be odd integers. Then n + m =


2(k + l + 1) is even.

11. Suppose that r is rational and i is irrational and s = r + i is rational.


Then by Exercise 10, s + (−r) = i is rational, which is a contradiction.
√ √ √
12. Since 2 · 2 = 2 is rational and 2 is irrational, the product of
two irrational numbers is not necessarily irrational.

13. n = 1601 is a counterexample.


1
a
14. Suppose that 3 3 = b where a, b ∈ Z, b 6= 0, and gcd (a, b) = 1.
3
a
Then 3 = b3 , so that 3b = a3 . Hence 3|a3 , which can happen only if 3|a.
3

Let a = 3m. Then 3b3 = 27m3 , or b3 = 9m3 . Thus 3|b3 , which shows
that 3|b. This is a contradiction of the assumption that gcd(a, b) = 1.

15. If x ≤ y, then max (x, y) + min(x, y) = y + x = x + y. If x ≥ y,


then max (x, y) + min(x, y) = x + y. Since these are the only two cases,
the equality always holds.

16. There are four cases. Case 1 : x ≥ 0 and y ≥ 0. Then |x| + |y| =
x + y = |x + y|. Case 2 : x < 0 and y < 0. Then x| + |y| = −x + (−y)
= −(x + y) = |x + y| since x + y < 0. Case 3 : x ≥ 0 and y < 0. Then
|x| + |y| = x + (−y). If x ≥ −y, then |x + y| = x + y. But since y < 0,
−y > y, so that |x| + |y| = x + (−y) > x + y = |x + y|. If x < −y, then
|x + y| = −(x + y) = −x + (−y). But since x ≥ 0, x ≥ −x, so that
|x| + |y| = x + (−y) ≥ −x + (−y) = |x + y|. Case 4 : x < 0 and y ≥ 0.
Identical to Case 3 with the roles of x and y reversed.

17. There are three cases to consider : Case 1, a is smallest, or tied for
smallest; Case 2, b is smallest, or tied for smallest; Case 3, c is smallest, or
tied for smallest. Since one of a, b, and c is smallest, or tied for smallest,
these three cases cover all possibilities. In Case 1, a ≤ min(b, c), so the
94 Proof Methods

left-hand side is a and the right hand side is also a since min (a, c) = a.
The argument in the other two cases is similar.

18. First, assume that n is odd, so that n = 2ki + 1 for some integer k.
Then 5n + 6 = 5(2k + 1) + 6 = 10k + 11 = 2(5k + 5) + 1. Hence 5n + 6
is odd. To prove the converse, suppose that n is even, so that n = 2k
for some integer k. Then 5n + 6 = 10k + 6 = 2(5k + 3), so that 5n + 6
is even. Hence n is odd if and only if 5n + 6 is odd.

19. a2 = b2 (mod p) if and only if p|(a2 − b2 ) = (a + b)(a − b). By


the uniqueness of prime factorization, this is equivalent to p|(a − b) or
p|(a + b), which is the same as a ≡ −b (mod p).

20. This proposition is true. Suppose that m is neither 1 nor −1. Then
mn has a factor m larger than 1. On the other hand, mn = 1, and 1 has
no such factor. Hence m = 1 orm = −1. In the first case n = 1, and in
1
the second case n = −1, sincen = m.

21. The positive integer 3 is not the sum of two squares of integers, so
that the proposition is false.

22. a) True; since bxc is already an integer, dbxce = bxc


1
b) False; x = 2 is a counter example.

c) True; if x or y is an integer, then using property 4b in Table 1 of


Section 1.6, the difference is 0. If neither x nor y is an integer, then
x = n + ε andy = m + δ, where n and m are integers and ε and δ are
positive real numbers less than 1. Thenm + n < x + y < m + n + 2, so
dx + ye is either m + n + 1 orm + n + 2. Therefore, the given expression
is either (n + 1) + (m + 1) − (m + n + 1) = 1 or (n + 1) + (m + 1)
−(m + n + 2) = 0, as desired.
1
d) False; n + 1x = 4 and y = 3 is a counterexample.
Proof Methods 95

1
e) False; x = 2 is a counter example.

23. a) If x is positive integer, then the two side are equal. So suppose
thatx = n2 + m + ε, where n2 is the largest perfect square less than x, m
√ p √
is a nonnegative integer, and 0 < ε ≤ 1. Then x and bxc = n2 + m
are between n and n + 1, so both sides equal n.

b) If x is a positive integer, then the two sides are equal. So suppose


thatn + 1x = n2 − m − ε, where n2 is the smallest perfect square greater
than x, m is a nonnegative integer, and ε is a real number with 0 <
√ p √
ε ≤ 1. Then both x and dxe = n2 − m are between n − 1 andn.
Therefore, both sides of the equation equaln.
r

24. Letx = n + m + ε, where n is an integer, r is a nonnegative integer
1
less thanm, and ε is a real number with 0 ≤ ε < m . The left-hand
side is bnm k bxc
j + r + mεck= nm + r. On the right-hand jside, the terms
(m+r−1) (m−r)
through x + m are all just n and terms from x + m on are
alln + 1. Therefore, the right-hand side is (m − r)n + r(n + 1) = nm + r,
as well.

25. We will give a proof by contradiction. Suppose that a1 , a2 . . . , an


are all less thanA, where A is the average of these numbers. Then
a1 + a2 + · · · + an < nA. Dividing both sides by n shows that A =
(a1 +as +···+an )
n < A, which is a contradiction.

26. We will show that the four statements are equivalent by showing
that (i) implies (ii), (ii) implies (iii), (iii) implies (iv), and (iv) implies
(i). First, assume that n is even. Then n = 2k for some integerk. Then
n + 1 = 2k + 1, so that n + 1 is odd. This shows that (i) implies (ii).
Next, suppose that n + 1 is odd, so that n + 1 = 2k + 1for some integer
k. Then 3n + 1 = 2n + (n + 1) = 2(n + k) + 1, which shows that 3n + 1 is
odd, showing that (ii) implies (iii). Next, suppose that 3n + 1 is odd, so
96 Proof Methods

that 3n + 1 = 2k + 1 for some integer k. Then 3n = (2k + 1) − 1 = 2k,


so that 3n is even. This shows that (iii) implies (iv). Finally, suppose
that n is not even. Then n is odd, so n = 2k + 1 for some integer k.
Then 3n = 3(2k + 1) = 6k + 3 = 2(3k + 1) + 1, so that 3n is odd. This
completes an indirect proof that (iv) implies (i).

27. The integers 3, 5, and 7 are three primes of the desired form.

28. Assume we have the first n + 1 prime numbersp1 , p2 , . . . , pn+1 .


Then p1 p2 . . . pn+1 is divisible by more than n primes.

29. Suppose that p1 , p2 , . . . , pn are all the primes congruent to 3 mod-


ule 4, except for 3. Let q = 4p1 p2 . . . pn + 3. Then q = 3(mod4), and
q is not divisible by pi , i = 1, 2, . . . , n, or by 3. Since q must have at
least one prime factor that is congruent to 3 module 4, there must be
a prime of this type not in our list. This is a nonconstructive existence
proof.

30. Suppose thatp1 → p4 → p2 → p5 → p3 → p1 . To prove that one


of these propositions implies any of the others, just use hypothetical
syllogism repeatedly.
√ √
31. Let a = 2 and b = 2. If c = √ ab is rational, we are done. If c is
 √  2
√ 2 √ 2
rational, then cb = (ab )b = 2 = 2 = 2 is rational. This
proof is nonconstructive.

32. Every domino placed on a chessboard covers exactly one white and
one black square. Hence a set of dominos covers exactly the same number
of white squares and black squares. Since removing opposite corners
leaves a board with 2 more black squares than white squares or 2 more
white squares than black squares, no set of dominos can cover the board
with opposite corners removed.
Chapter 6
Mathematical Induction

Introduction

Mathematical induction is a powerful method of proof that is frequently


used to establish the validity of statements that are given in terms of
the natural numbers. We start with the following fundamental property
of the set N of natural numbers.

Well-Ordering Property of N: Every nonempty subset of N has a


least element.

The following is a more detailed statement of the well-ordering prop-


erty:

Well-Ordering Property of N:
If S is a subset of N and if S 6= Φ, then there exist m ∈ S such that
m ≤ k for all k ∈ S.

On the basis of the Well-Ordering Property, we shall derive a version

97
98 Mathematical Induction

of the Principle of Mathematical Induction that is expressed in terms of


subsets of N.

Example 1
Prove that there is no positive integer between 0 and 1.

Solution

Suppose that a is a positive integer between 0 and 1. Let S = {n ∈


+
Z |0 < n < 1}. Since 0 < a < 1, it follows that a ∈ S and hence S
is nonempty. Therefore, by the well-ordering principle, S has a least
element, say, l, where 0 < l < 1. This implies 0 < l2 < l < 1, so l2 ∈ S.
But l2 < l, a contradiction to the assumption that l is the least element
of S. Hence there is no positive integer between 0 and 1.

Example 2
Prove that every nonempty set of nonnegative integers has a least ele-
ment.

Solution

Let S be a set of nonnegative integers.

Case 1 Suppose 0 ∈ S. Since 0 is less than every positive integer, 0 is


less than every nonzero element in S also, so 0 is a least element in S.

Case 2 Suppose 0 ∈
/ S. Then S contains only positive integers. So, by
the well-ordering principle, S contains a least element.

Thus, in both cases, S contains a least element.

Principle of Mathematical Induction (Weak Version)

Theorem 1 [Principle of Mathematical Induction]


Let S be a subset of N that possesses the two properties:
Mathematical Induction 99

1) The number 1 ∈ S.

2) For every k ∈ N, if k ∈ S, thenk + 1 ∈ S.

Then we have S = N.

Proof (Using Well-Ordering Property of N)


Suppose to the contrary that S 6= N. Then the set N\S is not an empty
subset of N, so by the Well-Ordering Property it has a least element m.
i.e., m is the least element in N such that m ∈
/ S.

Since 1 ∈ S by hypothesis (1), and m ∈


/ S, we have m 6= 1. Hence
m > 1. But this implies that m − 1 is also a natural number. Since
m − 1 < m and m is the least element in N such that m ∈
/ S, we
conclude that m − 1 ∈ S.

We now apply hypothesis (2), to the element k = m − 1 in S, to infer


that k +1 = (m−1)+1 = m belongs to S. But this statement contradicts
the fact thatm ∈
/ S. Since m was obtained from the assumption that
N\S is not empty, we have N\S = Φ. Therefore we must have S = .

This completes the proof.

Theorem 2 [Principle of Mathematical Induction]


Let n0 be a fixed integer. Let S be a set of integers satisfying the
following conditions:
1)n0 ∈ S.
2) If k is an arbitrary integer ≥ n0 such that k ∈ S, then k + 1 ∈ S.

Then S contains all integers n ≥ n0 .

Example 3
Prove that for each n ∈ N, the sum of the first n natural numbers is
100 Mathematical Induction

given by
1
1 + 2 + ··· + n = n(n + 1).
2
Solution

To prove the formula, we let S be the set of all n ∈ N for which the
formula is true.

i.e., let S = {n ∈ N : 1 + 2 + · · · + n = 12 n(n + 1)}.

We have to show that S = N . By Principle of Mathematical Induction,


we have to verify that conditions (1) and (2) are satisfied.
1
If n = 1, then we have 1 = 2 · 1 · (1 + 1) so that 1 ∈ S, and (1) is
satisfied.

Next, we assume that k ∈ S and wish to infer from this assumption


that k + 1 ∈ S. Indeed, if k ∈ S, then

1
1 + 2 + ... + k = k(k + 1).
2

If we add k + 1 to both sides of the assumed equality, we obtain

1
1 + 2 + ... + k + (k + 1) = k(k + 1) + (k + 1)
2

1
= (k + 1)(k + 2).
2
Since this is the stated formula for n = k +1, we conclude that k +1 ∈ S.
Therefore, condition (2) is satisfied. Consequently, by the Principle of
Mathematical Induction, we infer that S = N, so the formula holds for
all n ∈ N.

Attention!
Careless use of the Principle of Mathematical Induction can lead to ob-
Mathematical Induction 101

viously absurd conclusions. An illustration is given below:

1. Claim: If n ∈ N and if the maximum of the natural numbers p and


q is n, then p = q.

“Proof (!!!)”. Let S be the subset of N for which the claim is true.
Evidently, 1 ∈ S “since” if p, q ∈ N and their maximum is 1, then both
equal 1 and so p = q. Now assume that k ∈ S and that the maximum of
p and q is k + 1. Then the maximum of p − 1 and q − 1 is k. But since
k ∈ S, then p − 1 = q − 1 and therefore p = q. Thus, k + 1 ∈ S, and we
conclude that the assertion is true for all n ∈ N.

The error in the “proof ” of the assertion is that 1 need not be an


element in S. We have “noted that” 1 ∈ S based on the assumption (that
need not be true always) “if p, q ∈ N and their maximum is 1”.

The following is the most commonly used version of the Principle of


Mathematical Induction.

Principle of Mathematical Induction (Most common form)

For eachn ∈ N, let P (n) be a statement about n. Suppose that:

1) P (1) is true

2) For every k ∈ N, if P (k) is true, then P (k + 1) is true.

Then P (n) is true for all n ∈ N.

Remarks

1. This is a special case of Second Principle of Mathematical Induc-


tion (with n0 = 1) which we will discuss shortly.

2. The assumption that “P (k) is true” [in the first part of condition
102 Mathematical Induction

(2)] is called induction hypothesis (or induction argument).

Example 4
For each n ∈ N, the sum of the squares of the n natural numbers is given
by
1
12 + 22 + · · · + n2 = n(n + 1)(2n + 1).
6
Prove this.

Solution

Here P (n) : 12 + 22 + · · · + n2 = 16 n(n + 1)(2n + 1)


1
We note that P (1) [taking n = 1] is true, since 12 = 6 · 1 · 2 · 3.

As induction hypothesis, we assume P (k) is true; then

1
12 + 22 + · · · + k 2 = k(k + 1)(2k + 1).
6

Adding (k + 1)2 to both sides, we obtain

1
12 + 22 + · · · + k 2 + (k + 1)2 = k(k + 1)(2k + 1) + (k + 1)2
6

1
= (k + 1)(2k 2 + k + 6k + 6)
6
1
= (k + 1)(k + 2)(2k + 3).
6
Consequently, P (k + 1) is true. Hence by the Principle of Mathematical
Induction, P (n) is true for all n ∈ N. i.e., the formula is valid for all
n ∈ N.

Example 5
Given two real numbers a and b, prove that a − b is a factor of an − bn
for all n ∈ N.
Mathematical Induction 103

Solution

Here P (n) : a − b is a factor of an − bn .

We note that P (1)[taking n = 1] is true, since a − b is a factor of a1 − b1 .

As induction hypothesis, we assume P (k) is true; i.e., we assume that


a − b is a factor of ak − bk . Then

ak+1 − bk+1 = ak+1 − abk + abk − bk+1

= a(ak − bk ) + bk (a − b).

By the induction hypothesis, a − b is a factor of ak − bk and hence of


a(ak − bk )and a − b is obviously a factor of bk (a − b). Therefore, a − b is
a factor of a(ak − bk ) + bk (a − b) and hence that of ak+1 − bk+1 . i.e., we
have proved that P (k + 1) is true. Hence it follows from Mathematical
Induction that P (n) is true for alln ∈ N. i.e., a − b is a factor of an − bn
for all n ∈ N.

Remark/Special case:
A variety of divisibility results can be derived from the fact in Example
4. For example, since 11 − 7 = 4, we see that 11n − 7n is divisible by 4
for alln ∈ N.

Example 6
Establish the inequality
2n ≤ (n + 1)!

by Mathematical Induction.

Solution

Here P (n) : 2n ≤ (n + 1)!


104 Mathematical Induction

We note that P (1) [taking n = 1] is true, since 21 = 2 = (1 + 1)!

As induction hypothesis, we assume P (k) is true; i.e., we assume that

2k ≤ (k + 1)!. Then
2k+1 = 2 · 2k

≤ 2(k + 1)!, using induction hypothesis,

≤ (k + 2)(k + 1)!, since 2 ≤ k + 2

= (k + 2)!

i.e., inequality holds for k + 1. i.e., we have proved that P (k + 1) is


true. Hence it follows from Mathematical Induction that P (n) is true
for alln ∈ N. i.e., 2n ≤ (n + 1)! for all n ∈ N.

Example 7
Prove the following formula for the sum of the terms in a “geometric
progression”.
1 − rn+1
1 + r + r2 + ... + rn =
1−r
Solution

First, if n = 1, then 1+r = (1−r2 )/(1−r). As induction hypothesis,


assume the truth of the formula for n = k and adding the term rk+1 to
1−r k+1 1−r k+2
both sides, we get 1 + r + rk + ... + rk+1 = 1−r + rk+1 = 1−r

which is the formula forn = k + 1. Therefore, Mathematical Induction


implies the validity of the formula for all n ∈ N.

Remark
The result in Example 5 can also be proved without using Mathematical
Induction. If we let Sn = 1+r+r2 +...+rn , then rSn = r+r2 +...+rn+1 ,
Mathematical Induction 105

so that
(1 − r)Sn = Sn − rSn = 1 − rn+1

Now division by 1 − r gives the stated formula.

Example 8 (An example showing that the Careless use of the Principle
of Mathematical Induction can lead to obviously absurd conclusions.)
You may read the following statement and its proof. Find the mistake
in the “proof”.

Statement : Every person in a set of n people is of the same sex.

Proof: P (n) : Everyone in a set of n people is of the same sex.

We note that P (1) [taking n = 1] is true, since in a set of 1 people


there is only one people, and hence everyone in that set (actually only
one person) is of the same sex.

As induction hypothesis, we assume P (k) is true; i.e., we assume


that everyone in a set of k people is of the same sex. To show that
P (k + 1) is true, consider a set A = {a1 , a2 , . . . , ak+1 } of k + 1 people.
Partition A into two overlapping sets, B = {a1 , a2 , . . . , ak } and C =
{ a2 , . . . , ak+1 }. Since B and C contain k elements, by the inductive
hypothesis, everyone in B is of the same sex and everyone in C is of the
same sex. Since B and C overlap, everyone in B ∪ C = A must be of
the same sex; that is, everyone in A is of the same sex.

Solution (Mistake in the “proof”).

In the proof we have mentioned that “B and C overlap”. It is not


true when k = 2. For example, if A has only two elements a1 and a2
(with a1 6= a2 ), then B = {a1 } and C = { a2 } do not overlap. Due this
we get a wrong “proof”. Actually the statement is false. Moreover, if a1
is male and a2 is female, P (1) is true, but P (2) is false, as “every person
106 Mathematical Induction

in A = {a1 , a2 } is of the same sex” is false.

Strong Version of Induction

Theorem 3 [Second Principle of Mathematical Induction]

Let n0 ∈ N and let P (n) be a statement for each natural number


n ≥ n0 . Suppose that:

1) The statement P (n0 ) is true.

2) For all k ≥ n0 , the truth of P (k) implies the truth of P (k + 1).

Then P (n) is true for all n ≥ n0 .

Proof (Using Well-Ordering Property of N) Let

S = {n ∈ Z| P (n) is true }.

Since P (n0 ) is true by condition (1), n0 ∈ S.

Now assume (2). i.e., assume that for all k ≥ n0 , P (k) is true. Then
n0 , n0 + 1, ..., k belong to S. So, by condition (2), k + 1 also belong to
S. Therefore, by Theorem 2, S contains all integers Thus, P (n) is true
for every integer n ≥ n0 .

This completes the proof.

The number n0 in (1), is called the base, which serves as the starting
point,) and the implication in (2), which can be written P (k) ⇒ P (k+1),
is called the bridge, since it connects the case k to the case (k + 1).

The following example illustrates the importance of second version


of Mathematical Induction.

Example 9
Prove that 2n > 2n + 1 is true for n ∈ N and n = 3.
Mathematical Induction 107

Solution

We cannot apply first version of Mathematical Induction, since the


inequality 2n > 2n + 1 is false for n = 1, 2. But it is true for n = 3.

To apply second version of Mathematical Induction, we choose n0 = 3.


As induction hypothesis, we assume that 2k > 2k + 1. Then multiplica-
tion by 2 gives

2k+1 > 2(2k + 1) = 4k + 2 = 2k + (2k + 2)

> 2k + 3, since 2k + 2 > 3

= 2(k + 1) + 1.

i.e., we have shown that for all k ≥ 3, the truth of 2k > 2k + 1 implies
the truth of 2k+1 > 2(k + 1) + 1. Hence, with the base n0 = 3, we can
apply Mathematical Induction to conclude that the inequality holds for
all n ≥ 3.

Attention!
There are statements that are true for many natural numbers but that
are not true for all of them. For example, the formula p(n) = n2 − n + 41
gives a prime number for n = 1, 2, ..., 40. However, p(41) = 412 − 41 +
41 = 412 is divisible by 41, so it is not a prime number.

Exercises
1 1 1 n
1. Prove that 1·2 + 2·3 + ... + for all n ∈ N.
n(n+1) = n+1
2
1
2. Prove that 13 + 23 + ... + n3 = 2 n(n + 1) for all n ∈ N.
Pn h i2
3. Show that r=1 r3 = n(n+1) 2 for n ∈ N.
108 Mathematical Induction

4. Prove that 1 + 2(2!) + · · · + n(n!) = (n + 1)! + 1 for all n ∈ N.


1 1
5. Prove that 1 + 22 + ··· + n2 < 2 − n1 . for all n ∈ N.

6. Prove that 3 + 11 + · · · + (8n − 5) = 4n2 − n for all n ∈ N.

7. Prove that 12 + 32 + · · · + (2n − 1)2 = (4n3 − n)/3 for all n ∈ N.

8. Prove that 12 − 22 + 32 + ... + (−1)n+1 n2 = (−1)n+1 n(n + 1)/2 for all


n ∈ N.

9. Prove that n3 + 5n is divisible by 6 for all n ∈ N.

10. Prove that 52n − 1 is divisible by 8 for all n ∈ N.

11. Prove that 5n − 4n − 1 is divisible by 16 for all n ∈ N.

12. Prove that n3 + (n + 1)3 + (n + 2)3 is divisible by 9 for all n ∈ N.

13. Conjecture a formula for the sum

1 1 1
+ + ··· + ,
1·3 3·5 (2n − 1) · (2n + 1)

and prove your conjecture by using Mathematical Induction.

14. Conjecture a formula for the sum of the first n odd natural numbers
1 + 3 + ... + (2n − 1), and prove your formula by using Mathematical
Induction.

15. Prove that n < 2n for all n ∈ N.

16. Prove that 2n < n! for all n ≥ 4, n ∈ N.

17. Prove that 2n − 3 ≤ 2n−2 for all n ≥ 5, n ∈ N

18. Show that 2n > n2 for n ∈ N and n ≥ 5.

19. Show that nn > 2n for n ∈ N and n ≥ 3.


Mathematical Induction 109

20. Find all natural numbers n such that n2 − 2n . Prove your assertion.

21. Find the largest natural number m such that n3 − n is divisible by


m for all n ∈ N. Prove your assertion.

22. Let S be a subset of N such that (a) 2k ∈ S for all k ∈ N, and (b) if
k ∈ S and k ≥ 2, then k − 1 ∈ S. Prove that S = N.
√ √ √ √
23. Prove that 1/ 1 + 1/ 2 + ... + 1/ n > n for all n ∈ N.

24. Let the numbers xn be defined as follows: x1 = 1, x2 = 2, and


xn+2 = 12 (xn+1 +xn ) for all n ∈ N. Use the Principle of Strong Induction
to show that 1 ≤ xn ≤ 2 for all n ∈ N.
Chapter 7
Recursion

A recursive process is one in which objects are defined in terms of other


objects of the same type. Using some sort of recurrence relation, the
entire class of objects can then be built up from a few initial values and
a small number of rules. The Fibonacci numbers, which we discuss in
a later chapter, are most commonly defined recursively. Care, however,
must be taken to avoid self-recursion, in which an object is defined in
terms of itself, leading to an infinite nesting.

Recursive Definition of a Function

Let a be a nonnegative integer and X = {a, a + 1 , a + 2, . . .}. An


inductive definition of a function f with domain X consists of
three parts:

Basis Step: A few initial values f (a), f ( a + 1), . . . , f (a + k − 1) are


specified. Equations that specify such initial values are initial conditions.

110
Recursion 111

Recursive Step: A formula to compute f (n)from the k preceding func-


tional values f (n − 1), f (n − 2), . . . , f (n − k) is made. Such a formula
is a recurrence relation (or recursive formula).

Terminal Step: Only values thus obtained are valid functional values.
(Usually we drop this step from the recursive definition.)

A function is said to be recursively defined if the function def-


inition refers to itself. In a recursive definition of f , f (n) may be
defined using the values f (k), where k 6= n, so not all recursively defined
functions can be defined inductively (An example of this kind will follow
immediately).

Remark

The recursive definition of f consists of a finite number of initial con-


ditions and a recurrence relation.

Example 1
Show that recursion can be employed to find the minimum and maxi-
mum of three or more real numbers. Hence find min{5, −7, 4, −9} and
max{5, −7, 4, −9}.

Solution

Let w, x, y, and z be four numbers.

Then

min{w, x, y, z} = min{w, {min{x, min{ y, z}}}}.

Similarly,

max{w, x, y, z} = max{w, {max{x, max{ y, z}}}}.


112 Recursion

Hence

min{5, −7, 4, −9} = min{5, {min{−7, min{ 4, −9}}}} = −9.


| {z }
−9
| {z }
−9
| {z }
−9

Also

max{5, −7, 4, −9} = max{5, {max{−7, max{ 4, −9}}}} = 5.


| {z }
4
| {z }
4
| {z }
5

Example 2 (Not all recursively defined functions can be de?ned induc-


tively)

The 91-function f , invented by John McCarthy (US mathematician,


one of the fathers of artificial intelligence (AI)), is defined recursively on
the set of nonnegative integers as follows:
(
x − 10 if x > 100
f (x) =
f (f (x + 11)) if 0 ≤ x ≤ 100

Compute

(i) f (99) and (ii) f (f (99))

Solution

(i) As 99 ≤ 100, we have

f (99) = f (f (99 + 11)) = f (f (110))


Recursion 113

As 110 > 100, we have

f (110) = 110 − 10 = 100.

Thus,
f (99) = f (100).

Again since 100 ≤ 100, we have

f (100) = f (f (100 + 11)) = f (f (111))

As 111 > 100, we have

f (111) = 111 − 10 = 101.

Thus,
f (100) = f (101)

As 101 > 100, we have

f (101) = 101 − 10 = 91.

Thus,
f (99) = f (100) = f (101) = 91.

(ii) As f (99) = 91 ≤ 100, it follows that

f (f (99)) = f (91) = f (f (91 + 11)) = f (f (102))

As 102 > 100, we have

f (102) = 102 − 10 = 92.


114 Recursion

Thus,
f (f (99)) = f (92).

As 92 ≤ 100, it follows that

f (92) = f (f (92 + 11)) = f (f (103))

As 103 > 100, we have

f (103) = 103 − 10 = 93.

Thus,
f (f (99)) = f (93).

If we continue like this we obtain after a finite number of stages,

f (f (99)) = f (99).

Already, we have f (99) = 91. Thus,

f (f (99)) = 91.

Factorial Function

The product of the positive integers from 1 to n, inclusive, is called n


factorial and is usually denoted by n! That is,

n! = 1 · 2 · 3 . . . (n − 2)(n − 1)n.

It is also convenient to define 0! = 1, so that the function is defined for


Recursion 115

all nonnegative integers. Thus we have

0! = 1, 1! = 1, 2! = 1·2 = 2, 3! = 1·2·3 = 6, 4! = 1·2·3·4 = 24,

5! = 1 · 2 · 3 · 4 · 5 = 120, 6! = 1 · 2 · 3 · 4 · 5 · 6 = 720

and so on. Observe that

5! = 5 · 4! = 5 · 24 = 120, and 6! = 6 · 5! = 6 · 120 = 720.

This is true for every positive integer n; that is,

n! = n · (−1)!

Accordingly, the factorial function may also be defined as follows:

Definition (Factorial Function)

(a) If n = 0, then n! = 1

(b) If n > 0, then n! = n · (n − 1)!

Hence if let f be defined by f (n) = n! (where n is a nonnegative


integer) is the factorial function, then it can be defined recursively
as follows:

(a) [Initial Condition] f (n) = 0,

(b) [Recursive Formula] f (n) = n · f (n − 1)

Using this recursive formula, f (4) is determined as follows:

f (4) = 4 · f (4 − 1) = 4 · f (3) = 4 · 3 · f (3 − 1)

= 4 · 3 · f (2) = 4 · 3 · 2 · f (2 − 1) = 4 · 3 · 2 · f (1)
116 Recursion

= 4 · 3 · 2 · 1f (1 − 1) = 4 · 3 · 2 · 1 · f (0) = 4 · 3 · 2 · 1 = 24.
|{z}
1

Example 3
A popular handshake problem is that there are n guests at a party.
Not being able to shake hands with oneself, and not counting multiple
handshakes with the same person, the problem is to find the number of
handshakes.

Solution

We define recursively the number of handshakes h(n) made in a party


of n people.

(a) [Initial Condition] If n = 1, then there is no handshake and so h(n) =


0,

(b) [Recursive Formula] Let x be one of the guests. The number of


handshakes made by the remaining n − 1 guests among themselves, by
de?nition, is h(n−1). Now person x shakes hands with each of these n−1
guests, yielding n − 1 handshakes. So the total number of handshakes
made equals h(n − 1) + (n − 1).

i.e., h(n) = h(n − 1) + (n − 1), n ≥ 2.

In particular,
h(1) = 0,

h(2) = h(2 − 1) + (2 − 1) = h(1) + 1 = 0 + 1 = 1,

h(3) = h(3 − 1) + (3 − 1) = h(2) + 2 = 1 + 2 = 3,

h(4) = h(4 − 1) + (4 − 1) = h(3) + 3 = 3 + 3 = 6,

and so on.
Recursion 117

Finding Explicit Formula from Recursive Relation

To find an explicit formula for f (n) corresponding to a recursive relation,


we proceed as follows:

Step 1) apply the recurrence formula iteratively and look for a pattern
to predict an explicit formula;

Step 2) use induction to prove that the formula does indeed hold for
every possible value of the integer n. The following example illustrates
this method.

Example 4
Obtain an explicit formula corresponding to the recursive relation

h(n) = h(n − 1) + (n − 1), n≥2

Solution

Step 1) h(n) = h(n − 1) + (n − 1), n≥2

= h(n − 2) + (n − 2) + (n − 1)

= h(n − 3) + (n − 3) + (n − 2) + (n − 1)
..
.
= h(1) + 1 + 2 + · · · + (n − 2) + (n − 1)

= 0 + 1 + 2 + · · · + (n − 2) + (n − 1)

Step 2) In the chapter Mathematical Induction, we have seen that

n(n + 1)
1 + 2 + ··· + n = .
2
118 Recursion

Hence the final stage in step 2 gives

n(n − 1)
h(n) = .
2

Exercises

In exercise 1-4, compute the first four terms of the sequence defined
recursively.

1. a1 = 1
an = an−1 + 3, n ≥ 2
2. a0 = 1
an = an−1 + n, n ≥ 1
3. a1 = 1
n
an = n−1 an−1 , n≥2
4. a1 = 1, a2 = 2
an = an−1 + an−2 , n ≥ 3

Define recursively each number sequence.

5. 1, 4, 7, 10, 13,. . . 6. 3, 8, 13, 18, 23,. . .

7. 0, 3, 9, 21, 45,. . .

A function of theoretical importance in the study of algorithms is Acker-


mann’s function, named after the German mathematician and logician
Wilhelm Ackermann(1896-1962). It is defined recursively on the set of
nonnegative integers as follows:

 n+1 if m = 0


A(m, n) = A(m − 1, 1) if n = 0

 A(m − 1, A(m, n − 1)) otherwise

Recursion 119

Compute A(0, 7), A(1, 1) and A(2, 2).

Answers
1.a2 = 4, a3 = 7, a4 = 10

2.a1 = 2, a2 = 4, a3 = 7

3.a2 = 2, a3 = 3, a4 = 4

4.a3 = 3, a4 = 5

5.a1 = 1, an = an−1 + 3, n ≥ 2

6.a1 = 3, an = an−1 + 5, n ≥ 2

7.a1 = 0, an = 2an−1 + 3, n ≥ 2
Chapter 8
Division Algorithm

We start with a familiar result that is so fundamental in number theory.


We will prove it using Well-Ordering Property of the natural numbers.

Theorem 1 (Division Algorithm) Given integers a and b, with b > 0,


there exist unique integers q and r satisfying

a = qb + r 0 ≤ r < b.

The integers q and r are called, respectively, the quotient and remain-
der in the division of a by b.

Proof We first claim that the set

S = {a − xb| x an integer, a − xb ≥ 0}

is nonempty. To prove the claim, it suffices to exhibit a value of x making


a − xb nonnegative. Because the integer b ≥ 1, we have |a| b ≥ |a| , and

120
Division Algorithm 121

so
a − (−|a|)b = a + |a|b ≥ a + |a| ≥ 0.

For the choice x = −|a|, then, a − xb lies in S. Now by the Well-


Ordering Property of the natural numbers1 , the nonempty subset S of
Ncontains a smallest integer, say, r. By the definition of S, there exists
an integer q satisfying

r = a − qb ( 0 ≤ r )

We argue that r < b. If this were not the case, then r ≥ band

a − (q + 1)b = (a − qb) − b = r − b ≥ 0

The implication is that the integer a − (q + 1)b has the proper form
to belong to the set S. But a − (q + 1)b = r − b < r, leading to a
contradiction of the choice of r as the smallest member of S. Hence,
r < b.

Now we turn to show the uniqueness of q and r. Suppose that a as


two representations of the desired form, say,

a = qb + r = q 0 b + r0 . . . (1)

where 0 ≤ r < b, 0 ≤ r0 < b. . . . (2)

Then
r0 − r = b(q − q 0 )

and

|r0 − r| = |b(q − q 0 )| = b |q − q 0 | . . . . (3)


122 Division Algorithm

Also, from the inequalities in (2), we have

−b < −r ≤ 0 . . . (4)

and 0 ≤ r0 < b. . . . (5)

Adding (4) and (5), we obtain

−b < r0 − r < b

That is,
|r0 − r| < b.

Thus, from (3), we have


b|q − q 0 | < b,

which gives
0 ≤ |q − q 0 | < 1.

Because |q − q 0 | is a nonnegative integer, the only possibility is that

|q − q 0 | = 0.

Hence q = q 0 .

This, when substituting in (1), gives

r = r0 .

This completes the proof.


1
Well-Ordering Property of N : Every nonempty subset of N has a
least element.

Example 1
Division Algorithm 123

Find the quotient q and the remainder r when

1. 107 is divided by 13.

2. −123 is divided by 5.

Solution

1. 107 = 8 · 13 + 3; so q = 8 and r = 3.

2. Though
−123 = (−24) · 5 + (−3)

is true, this is not the equation we search for in the form of Division
Algorithm. In the Division Algorithm, the remainder can never be neg-
ative.

But −123 can be written as −123 = (−25) · 5 + 2 where 0 ≤ r (=


2) < 5. Thus, q = −25 and r = 2.

Div and Mod Operators

We now define the binary operators, div and mod:

a div b =quotient when a is divided by b

a mod b = remainder when a is divided by b.

These operators are used to find quotients and remainders. As an


example, 107 div 13 = 8 and 107 mod 13 = 3. Also,

−123 div 5 = −25 and −123 mod 5 = 2.

Remark

By Division algorithm we have,

a = qb + r 0 ≤ r < b.
124 Division Algorithm

It now follows that

q = a div b and r = amodb.

q = a div b is usually denoted as ba/bc.

Therefore,
r = amodb = a − bq = a − b · ba/bc .

Card dealing

Example 2
As an application of both div and mod operators, let us consider a
standard deck of 52 playing cards. They are originally assigned the
numbers 0 through 51 in order. Use the suit labels 0 = clubs, 1 =
diamonds, 2 = hearts, and 3 = spades to identify each suit, and the card
labels 0 = ace, 1 = deuce, 2 = three, . . . , and 12 = king to identify
the cards in each suit. Suppose card x is drawn at random from a well-
shuffled deck, where 0 ≤ x ≤ 51. How do we identify the card?

Solution

First, we need to determine the suit to which the card belongs. It


is given by x div 13. Next, we need to determine the card within the
suit; this is given by xmod13. Thus, card x is card (xmod13) in suit
(x div 13). For example, let x = 25. Since 25 div 13 = 1, the card is a
diamond. Now 25mod13 = 12, so it is a king. Thus, card 25 is the king
of diamonds.

The Two Queens Puzzle

We know that there are two queens on an 8 × 8 chessboard, and


one queen can capture the other if they are on the same row, column,
or diagonal. The 64 squares on the board are numbered 0 through 63.
Division Algorithm 125

Suppose one queen is in square x and the other in square y, where


0 ≤ x, y ≤ 63. Using Div and Mod Operators, discuss when one queen
can capture the other?

Solution
Column label 0 1 2 3 4 5 6 7

Row label ↓
0 0 1 2 3 4 5 6 7
1 8 9 10 11 12 13 14 15
2 16 17 18 19 20 21 22 23
3 24 25 26 27 28 29 30 31
4 32 33 34 35 36 37 38 39
5 40 41 42 43 44 45 46 47
6 48 49 50 51 52 53 54 55
7 56 57 58 59 60 61 62 63

Because the squares are labelled 0 through 63, we can label each row
with the numbers 0 through 7 and each column with the same numbers
0 through 7. Clearly, each row label = br/8cand each column label =
c mod 8, where 0 ≤ r, c ≤ 63. Thus, the queen in square x lies in row
bx/8c and column x mod 8, and that in square y lies in row by/8cand
column y mod 8. Hence we have the following:

1. The two queens will be in the same row if and only if bx/8c =
by/8c, and

2. The two queens will be in the same column if and only if xmod8
= ymod8.
126 Division Algorithm

For example, if x = 25 and y = 30, b25/8c = 3 = b30/8c and the two


queens lie on the same row.

Now we determine when they lie on the same diagonal? There are 15
northeast diagonals and 15 southeast diagonals.

Suppose two queens Q1 and Q2 lie on the same diagonal, and Q1 at


ithe row and jth column, then Q2 must be at i + kthe row and j + kth
column, for some integer k. Conversely, if Q1 is at ithe row and jth
column, and Q2 be at i + kthe row and j + kth column, for some integer
k, then Q1 and Q2 lie on the same diagonal. Hence two queens Q1
and Q2 lie on the same diagonal if and only if the absolute value of the
difference of their row labels (i.e., |i + k − i| = |k|) equals that of the
difference of their column labels (i.e., |j + k − j| = |k|); that is:

The two queens will be in the same diagonal if and only if


|bx/8c − by/8c| = |xmod8 − ymod8|.

For example, if queens are at squares numbered 17 and 53 one queen


captures the other, because if x = 17, y = 53, then

|bx/8c − by/8c| = |b17/8c − b53/8c| = |2 − 6| = 4 = 17mod8


| {z } − 53mod8
| {z } .
1 5

But if x = 24, y = 13, then one queen cannot capture the other, because

|b24/8c − b13/8c| = |3 − 1| = 2 6= 5 = |24mod8


{z } − 13mod8
| {z } .
0 5

Theorem 2 (The Pigeonhole Principle)


If m pigeons are assigned to n pigeonholes, where m > n, then at least
two pigeons must occupy the same pigeonhole.
Division Algorithm 127

Proof
We prove this by the method of contradiction. Let there be m pigeons
and n pigeonholes where m > n. Assume that no two pigeons occupy
the same pigeonhole. In this case, every pigeon must occupy a distinct
pigeonhole, so n ≥ m, which is a contradiction to the above condition.
Thus, two or more pigeons must occupy same pigeonhole

Divisibility

Suppose that r = 0 in the division algorithm. Then

a = qb + 0 = qb.

Then we say that b divides a. We also say that a is divisible by the


positive integer b. In this case we could say that b is a divisor of a, that
b is a factor of a, or that a is a multiple of b.

Notation We write b|a to indicate that a is divisible by b and write


b 6 |a to indicate that a is not divisible by b.

Example 3 (An application of pigeonhole principle)


Let b be an integer ≥ 2. Suppose b + 1 integers are randomly selected.
Prove that the difference of two of them is divisible by b.

Solution

Let q be the quotient and r the remainder when an integer a is divided


by b. Then, by the division algorithm, a = bq + r, where 0 ≤ r < b. The
b+1 integers yield b+1 remainders (pigeons), but there are only b possible
remainders (pigeonholes). Therefore, by the pigeonhole principle, two of
the remainders must be equal.

Let x and y be the corresponding integers. Then x = bq1 + r and


128 Division Algorithm

y = bq2 + r for some quotients q1 and q2 . Therefore,

x − y = (bq1 + r) − (bq2 + r)

= b(q1 − q2 )

Thus, x − y is divisible by b.

Theorem 3
Let a and b positive integers such that a|b and b|a. Then a = b.

Proof
a|b and b|a. implies there are integers q1 and q2 such that

b = q1 a and a = q2 b.

As both a and b are positive integers q1 and q2 in the above equations


are also positive integers. Substituting b = q1 a in a = q2 b, we obtain

a = q2 (q1 a)

i.e., a = (q2 q1 )a.

Now dividing by the positive integer a, the above yields

1 = q2 q1 .

As q1 and q2 are positive integers, the above implies q1 = q2 = 1. Then


from any one of the equations b = q1 a and a = q2 b, we obtain

a = b.

Theorem 4
Let a, b, c, α, and β be any integers. Then
Division Algorithm 129

1. If a|b and b|c, then a|c. (Transitive Property)

2. If a|b and a|c, then a|(αb + βc).

3. If a|b, then a|bc.

Proof is left as an Exercise.

Remark
Condition 2 in theorem 4 says that if a is a factor of b and c, then a is
also a factor of any linear combination of b and c.

In particular a|b + c and a|b − c because of the following observations:


Since α, β ∈ Z we can choose any integer values for α and β. In partic-
ular put α = β = 1 in condition 2 then we get a|b + c and by choosing
α = 1 and β = −1 we get the other.

Notation
Let x be a positive real number. The number of positive integers ≤ x is
denoted by bxc . For example, if x = 10.65 then bxc = b10.65c = 10.

Theorem 5
Let a and b be any positive integers. Then the number of positive
integers ≤ a and divisible by b is ba/bc .

Proof
Suppose there are kpositive integers ≤ a and divisible by b. We need to
show that k = ba/bc . The positive multiples of b less than or equal to a
are b, 2b, · · · , kb. Clearly, kb ≤ a, that is, k ≤ a/b. Further, (k+1)b > a.
Thus, k + 1 > a/b or a/b − 1 < k. Therefore,

a a
−1<k ≤
b b

Thus, k is the largest integer less than or equal to a/b, so k = ba/bc .


130 Division Algorithm

For example, if a = 27 and b = 4, then the number of positive integers


≤ 27 and divisible by 4 is ba/bc = b27/4c = b6.75c = 6. We know that
those six numbers are 4, 8, 12, 16, 20 and 24.

Union, Intersection, and Complement

Let A be a finite set and |A| the number of elements in A. For example,
if A = {12, 13, 24, 100, 108}, then |A| = 5.

Definition
Let A and B be sets. The union of the sets A and B, denoted byA ∪ B,
is the set that contains those elements that are either in A or in B, or in
both. That is,
A ∪ B = {x|x ∈ A or x ∈ B}

Using disjunction symbol, the above takes the form

A ∪ B = {x|x ∈ A ∨ x ∈ B}

Definition
Let A and B be sets. The intersection of the sets A and B, denoted by
A ∩ B, is the set containing those elements in both A and B. That is,

A ∩ B = {x|x ∈ A and x ∈ B}.

Using conjunction symbol, the above takes the form

A ∩ B = {x|x ∈ A ∧ x ∈ B}.

Once the universal set U has been specified, the complement of a set can
be defined as follows:

Definition
Division Algorithm 131

Let U be the universal set. The absolute complement, or, simply,


complement of a set A, denoted by A0 is the set of elements which
belong to U but which do not belong to A; that is,

A0 = {x : x ∈ U, x ∈
/ A}.

We note that A0 is the complement of A with respect to U . In other


words, the complement of the set A is U − A.

Theorem 6 (The Inclusion-Exclusion Principle)


Let A1 , A2 , · · · , An be n finite sets. Then

n
[ X X \
Ai = |Ai | − Ai Aj
i=1 1≤i≤n 1≤i≤j≤n

X \ \ n
\
+ Ai Aj Ak − · · · + (−1)n+1 Ai
1≤i<j<k≤n i=1

Proof
We first prove this result for two sets.

Let A and B be finite sets. Let |A ∩ B| = n, |A| = n + r, and


|B| = n + s for some integers n, r, s ≥ 0. Then

|A ∪ B| = n + r + s = (n + r) + (n + s) − n = |A| + |B| − |A ∩ B|.

Likewise,

|A ∪ B ∪ C| = |A| + |B| + |C| − |A ∩ B| − |B ∩ C| − |C ∩ A|+

|A ∩ B ∩ C|.

The result for n sets follows similarly, or by an application of


132 Division Algorithm

Mathematical Induction.

Example 4
Find the number of positive integers ≤ 2076 and divisible by neither 4
nor 5.

Solution

Let A = {x ∈ N|x ≤ 2076 and divisible by 4} and

B = {x ∈ N|x ≤ 2076 and divisible by 5}.

Then
|A ∪ B| = |A| + |B| − |A ∩ B|

= b2076/4c + b2076/5c − b2076/20c

= 519 + 415 − 103 = 831

Thus, among the first 2076 positive integers, there are 2076−831 = 1245
integers not divisible by 4 or 5.

Even and Odd Integers

Put b = 2 in the division algorithm

a = qb + r (0 ≤ r < b).

Then we get

a = 2q + r, where 0 ≤ r < 2.

So the possibilities of rare 0 or 1.

1. When r = 0, a = 2q; such integers are even integers.

2. When r = 1, a = 2q + 1; such integers are odd integers.


Division Algorithm 133

It follows from this definition that every integer is either even or odd,
but not both.

Properties

1. The sum of any two even integers is even.

2. The product of any two even integers is even.

3. The sum of any two odd integers is even.

4. The product of any two odd integers is odd.

5. The sum of an even integer and an nod integer is odd.

6. The product of an even integer and an odd integer is even.

7. If the square of an integer is even, then the integer is even.

8. If the square of an integer is odd, then the integer is odd

Exercises

Find the quotient and the remainder when the first integer is divided by
the second.
1.68, 132.357, 753. − 128, 134. − 73, 35

Find the number of positive integers ≤ 2029 and

5. (a) Divisible by 17 (b) Divisible by 63

6. Prove that the sum of any two odd integers is even.

7. Prove that the sum of an even integer and an odd integer is odd.

8. Prove that the product of any two consecutive integers is even.

9. Prove that the sum of any two integers of the form 4k + 1 is even.
134 Division Algorithm

10. 2n3 + 3n2 + n is an even integer.

11. n3 − n is divisible by 2.
n(n+1)(2n+1)
12. Forn ≥ 1,prove that 6 is an integer

13. (The Two Queens Puzzle) There are two queens on an 8 × 8 chess-
board. One can capture the other if they are on the same row, col-
umn, or diagonal. The 64 squares on the board are numbered 0 through
63. Suppose one queen is in square x and the other in square y, where
0 ≤ x, y ≤ 63. Can one queen capture the other?

14. Find the number of positive integers ≤ 3000 and divisible by 3, 5, 7

15. Show that the number of leap years l after 1600 and not exceeding
a given year y is given by

l = by/4c − by/100c + by/400c − 388.

Answers/Hints to Selected Exercises

12. By the Division Algorithm, n has one of the forms 6k,6k+1, . . . , 6k+
5;establish the result in each of these six cases.

14. 1629.
Chapter 9
Prime and Composite Numbers

Any integer a > 1 is divisible by the positive integers 1 and a ;if these
exhaust the positive divisors of a, then it is said to be a prime number.

Definition
A positive integer p > 1 is called a prime number or simply a prime,
if its only positive divisors are 1 and p. An integer greater than 1 that
is not a prime is termed composite.

By definition, 1 is neither a prime nor a composite. It is just the multi-


plicative identity or the unit.

Example 1
The first six primes are 2, 3, 5,7,11 and 13.

Lemma
Every integer n ≥ 2 has a prime factor.

Proof

135
136 Prime and Composite Numbers

We prove this by induction.

The given statement is clearly true when n = 2. Now assume it is


true for every positive integer n ≤ k, where k ≥ 2. Consider the integer
k + 1.

Case 1 If k + 1 is a prime, then k + 1 is a prime factor of itself.

Case 2 If k + 1 is not a prime, k + 1 must be a composite, so it must


have a factor d ≤ k. Then, by the inductive hypothesis, d has a prime
factor p. So p is a factor of k + 1, by theorem 4 in chapter 1.

That is the result is result is true for k + 1 also. Hence by induction,


the statement is true for every integer ≥ 2; that is, every integer ≥ 2 has
a prime factor.

Theorem 1 (Euclid)
There is an infinite number of primes.

Proof
The proof is by contradiction. Let p1 = 2, p2 = 3, p3 = 5, p4 = 7, . . .
be the primes in ascending order, and suppose that there is a last prime,
called pn . Now consider the positive integer

N = p1 p2 · · · pn + 1.

Because N > 1, we may put the Fundamental Theorem of Arithmetic


to conclude that N is divisible by some prime p. But p1 , p2 , . . . , pn are
the only prime numbers, so that p must be equal to one of p1 , p2 , . . . , pn .
Combining the divisibility relation p|p1 p2 · · · pn with p|N, we arrive at
p|N − p1 p2 · · · pn or, equivalently, p|1. The only positive divisor of the
integer 1 is 1 itself and, because p > 1,a contradiction arises. Thus, no
finite list of primes is complete. Hence the number of primes is infinite.
Prime and Composite Numbers 137

Theorem 2

Every composite number n has a prime factor ≤ b nc .

Proof
The Proof is by contradiction. Let n be a composite number. Then it
has factors other than 1. We choose two positive integers a and b such

that n = ab, where 1 < a < n and 1 < b < n. Suppose a > n and
√ √ √
b > n. Then n = ab > n · n = n,that is we get n > n which is
√ √
impossible. Therefore, either a ≤ n or b ≤ n. Since both a and b are
√ √
integers, it follows that either a ≤ b nc or b ≤ b nc .

By Lemma every positive integer ≥ 2 has a prime factor. Any such


factor of a or b is also a factor of a · b = n, so n must have a prime factor

≤ b nc .

Remark

The above theorem says that if an integer n has no prime factors ≤



b nc ,then n is a prime; otherwise it is a composite number.

Example 2
Determine whether 1601 is a prime number.

Solution
√  √ 
We have 1601 = 40. Therefore the primes which are ≤ 1601
are 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, and 37. Since none of them is a
factor of 1601 (verify), Hence by above theorem 1601 is a prime.

Sieve of Eratosthenes

The technique, called the Sieve of Eratosthenes in honor of the Greek


mathematician Eratosthenes (ca. 276 - ca. 194 B.C.), for finding all
primes below a given integer n is based on Theorem 2. It gives the
following fact:
138 Prime and Composite Numbers


“ If an integer a > 1 is not divisible by any prime p ≤ a, then a is
a prime.”

The method of Sieve of Eratosthenes is as follows: Write down


the integers from 2 to n in their natural order and then systemati-
cally eliminate all the composite numbers by striking out all multiples

2p, 3p, 4p, 5p, . . . of all primes p ≤ n. (Attention! Never eliminate
p). The integers that are left on the list – those that do not fall through
the “sieve’ – are primes.
1
Eratosthenes was a Greek mathematician.

Example 3
Using Sieve of Eratosthenes find all primes not exceeding 100.

Solution

Consider a sequence of consecutive integers 2, 3, 4, 5, . . . , 100. We



have to consider all multiplies of p, where p is a prime and p ≤ 100.

The primes less than 100 = 10 are 2, 3, 5 and 7.

Taking the first prime 2, we begin by crossing out all even integers
from our listing, except 2 itself (See the Table below.)
Prime and Composite Numbers 139

2 3 \
4
/ 5 \
6
/ 7 \/8 9 1
Z
0
Z
11 1
Z
2
Z 13 \
14
/ 15 16
Z


Z 17 18
Z


Z 19 2
Z
0
Z
21 2
Z
2
Z 23 2
Z
4
Z 25 26
Z


Z 27 28
Z


Z 29 3
Z
0
Z
31 3
Z
2
Z 33 3
Z
4
Z 35 36
Z


Z 37 38
Z


Z 39 4
Z
0
Z
41 4
Z
2
Z 43 4
Z
4
Z 45 46
Z


Z 47 48
Z


Z 49 5
Z
0
Z
51 5
Z
2
Z 53 5
Z
4
Z 55 56
Z


Z 57 58
Z


Z 59 6
Z
0
Z
61 6
Z
2
Z 63 6
Z
4
Z 65 66
Z


Z 67 68
Z


Z 69 7
Z
0
Z
71 7Z
Z
2
 73 7Z
Z
4
 75 76
Z


Z 77 78
Z


Z 79 8Z
Z
0

81 8Z
Z
2
 83 8Z
Z
4
 85 86
Z


Z 87 88
Z


Z 89 9
Z
0
Z
91 9Z
Z
2
 93 9Z
Z
4
 95 96
Z


Z 97 98
Z


Z 99 100
H
 
H
The first of the remaining integers is 3, which must be a prime. We
keep 3, but strike all higher multiples of 3, so that 9, 15, 21, . . . are now
removed (the even multiples of 3 having been removed in the previous
step).

Now, the smallest integer after 3 that has not yet been deleted is 5.
It is not divisible by either 2 or 3 – otherwise it would have been crossed
out – hence, it is also a prime. All proper multiples of 5 being composite
numbers, we next remove 10, 15, 20, . . . (some of these are, of course,
already crossed out), while retaining 5 itself.

Now, the first surviving integer is 7 and is a prime, for it is not divis-
ible by 2, 3, or 5, the only primes that precede it. After eliminating the

proper multiples of 7, the largest prime less than 100 = 10, all com-
posite integers in the sequence 2, 3, 4, 5, . . . , 100 have fallen through
the sieve.

The positive integers that remain are 2, 3, 5, 7, 11, 13, 17, 19, 23,
29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, are all of the
primes less than 100.
140 Prime and Composite Numbers

Example 4
Prove that there is no polynomial f (n) with integral coefficients that
will produce primes for all integers n.

Solution

The proof is by contradiction. Suppose there exist a polynomial


f (n)such that f (n) is prime for all integers n,

Let f (n) = ak nk + ak−1 nk−1 + · · · + a1 n + a0 where ak 6= 0. Let b be


some integer. Since f (n) is always a prime, f (b) must be a prime say p;
that is,

f (b) = ak bk + ak−1 bk−1 + · · · + a1 b + a0 = p . . . . (1)

Let t be an arbitrary integer. Then consider f (b + tp)

f (b + tp) = ak (b + tp)k + ak−1 (b + tp)k−1 + · · · + a1 (b + tp) + a0

= (ak bk + ak−1 bk−1 + · · · + a1 b + a0 ) + p · g(t)

where g(t) is a polynomial in t. Thus,

f (b + tp) = p + pg(t), by equation (1), = p[1 + g(t)].

So p|f (b + tp). But every value of f is a prime, so f (b + tp) must be a


prime and hence f (b + tp). = p. Thus, f (b) = p = f (b + tp). This implies
f takes on the same value infinitely many times, since t is an arbitrary
integer.

But f (n) is a polynomial of degree k, so it cannot assume the same


value more than k times, which gives a contradiction.

Thus, no polynomial with integral coefficients exists that will gener-


ate only primes.
Prime and Composite Numbers 141

A Number-Theoretic function

Let x be a positive real number. Then π(x) denotes the number of


primes ≤ x.

For example, π(10) = 4, and π(100) = 25 . Using the summation


notation, π(x) can be defined as
P
π(x) = p≤x 1 where p denotes a prime.

The following theorem gives a formula for π(n), where n is a positive


integer.

Theorem 3

Let p1 , p2 , · · · , pt be the primes ≤ n. Then

√ X n  X n 
π(n) = n − 1 + π( n) − +
i
pi i<j
pi pj

X  n
 
n

t
− + · · · + (−1)
p i pj pk p1 p2 · · · p t
i<j<k

Example 5
Find the number of primes ≤ 100.

Solution
√ √
Here n = 100. Then π( n) = π( 100) = π(10) = 4. The four primes
≤ 10 are 2, 3, 5, and 7; call them p1 , p2 , p3 , and p4 , respectively. Then,
by Theorem 3,
       
100 100 100 100
π(100) = 100 − 1 + 4 − + + +
2 3 5 7
           
100 100 100 100 100 100
+ + + + + +
2·3 2·5 2·7 3·5 3·7 5·7
142 Prime and Composite Numbers
         
100 100 100 100 100
− + + + +
2·3·5 2·3·7 2·5·7 3·5·7 2·3·5·7
= 103 − (50 + 33 + 20 + 14) + 16 + 10 + 7 + 6 + 4 + 2)

−(3 + 2 + 1 + 0) + 0 = 25.

The Prime Number Theorem

π(x)
lim =1
x→∞ x/ ln x

That is, as x gets larger, π(x) approaches x/ ln x.

Theorem 4
For every positive integer n, there are n consecutive integers that are
composite numbers.

Proof
Consider the n consecutive integers (n + 1)! + 2,(n + 1)! + 3, . . . (n +
1)! + (n + 1), where n ≥ 1. Suppose 2 ≤ k ≤ n + 1, then k|(n + 1)!, so
k|[(n + 1)! + k], by Theorem 4 in chapter 1, for every k. Therefore, each
of them is a composite number.

Thus, the n consecutive integers (n + 1)! + 2,(n + 1)! + 3, . . . , (n +


1)! + (n + 1) are composites.

Example 6
Find six consecutive integers that are composites.

Solution

By Theorem 4, there are six consecutive integers beginning with (n +


1)! + 2 = (6 + 1)! + 2 = 5042, namely, 5042, 5043, 5044, 5045, 5046,
and 5047.

Fibonacci Numbers
Prime and Composite Numbers 143

In 1202, Italian mathematician Leonardo Pisano (also known as


Fibonacci) pondered the question: Given optimal conditions, how many
pairs of rabbits can be produced from a single pair of rabbits in one
year? This thought experiment dictates that suppose that rabbits never
die, the female rabbits always give birth to pairs, and each pair consists
of one male and one female.

Suppose two newborn rabbits are placed in a fenced-in yard and left
to, well, breed like rabbits. Also suppose:

1. Rabbits can’t reproduce until they are at least one month old, so
for the first month, only one pair remains.

2. At the end of the second month, the female gives birth, leaving
two pairs of rabbits. When month three rolls around, the orig-
inal pair of rabbits produce yet another pair of newborns while
their earlier offspring grow to adulthood. This leaves three pairs of
rabbit, two of which will give birth to two more pairs the follow-
ing month. The order goes as follows (under another assumption
that rabbits under consideration never die): 1, 1, 2, 3, 5, 8, 13,
21, 34, 55, 89, 144, . . . . Each number from third position is the
sum of the previous two. This sequence of numbers is known as
the Fibonacci numbers or the Fibonacci sequence. The ratio
between the numbers (1.618034) is frequently called the golden
ratio or golden number.

At first glance, Fibonacci’s experiment might seem to offer little


beyond the world of speculative rabbit breeding. But the sequence fre-
quently appears in the natural world- a fact that has intrigued scientists
for centuries. For instance, on many plants, the number of petals is a
Fibonacci number: buttercups have 5 petals; lilies and iris have 3 petals;
144 Prime and Composite Numbers

some delphiniums have 8; corn marigolds have 13 petals; some asters


have 21 whereas daisies can be found with 34, 55 or even 89 petals.

While describing the Fibonacci sequence we have observed that


first two elements are the number 1. Each number from third position is
the sum of the previous two. So mathematically, we can describe this as
follows: The Fibonacci sequence F = {Fn }is given by the statements

F1 = 1, F2 = 1 [initial conditions]

and Fn+1 = Fn−1 + Fn (n ≥ 2). [recurrence relation]

Using the recursive definition, we can list the first few terms of the
Fibonacci sequence as:

F = {1, 1, 2, 3, 5, 8, 13, 21, 34, 55, . . .}.

Theorem 5(Lucas)

b(n−1)/2c
!
X n−i−1
Fn = , n≥1
i=0 i

Theorem 6(Cassini’s Formula)

Fn−1 Fn+1 − Fn 2 = (−1)n , n≥1

Lucas Numbers

The numbers 1, 3, 4, 7, 11, ... , are called the Lucas numbers They
Prime and Composite Numbers 145

are defined recursively as follows:

L1 = 1, L2 = 3

Ln = Ln−1 + Ln−2 , n≥3

Binet’s formulas

Both Fibonacci numbers and Lucas numbers can be de?ned explicitly


using Binet’s formulas:
αn −β n
Fn = α−β and Ln = αn + β n

where
√ . √ .
α = (1 + 5 ) 2β = (1 − 5 ) 2

are the solutions of the quadratic equation x2 = x + 1.

Fermat numbers
n
Numbers of the form fn = 22 + 1are called Fermat numbers, due to the
French mathematician Pierre de Fermat. The first five Fermat numbers
are

f0 = 3, f1 = 5, f2 = 17, f3 = 257 and f4 = 65537.

Theorem 7
Letfn denote the nth Fermat number. Then fn = fn−1
2
− 2fn−1 + 2,
where n ≥ 1.

Proof
2
We shall substitute for fn−1 in the expression fn−1 − 2fn−1 + 2, simplify
it, and show that it equals fn :

n−1 n−1
2
fn−1 − 2fn−1 + 2 = (22 + 1)2 − 2(22 + 1) + 2
146 Prime and Composite Numbers

n n−1 n−1
= (22 + 2.22 + 1) − 2.22 −2+2
n
= 22 + 1

= fn

This completes the proof.

This theorem leads to a recursive definition of fn .

A Recursive Definition of fn ,

ie, f0 = 3
f1 = f02 − 2f0 + 2 = 9 − 2 · 3 + 2 = 5

and
f2 = f12 − 2f1 + 2 = 25 − 2 · 5 + 2 = 17

Example 7
Show that 641|f5 .

Solution

First notice that

641 = 5 · 27 + 1 . . . (1)
5
So 22 + 1 = 232 + 1 = 24 · 228 + 1

= 16 · 228 + 1 = (641 − 625)228 + 1

= (641 − 54 )228 + 1 = 641 · 228 − (5 · 27 )4 + 1

= 641 · 228 − (641 − 1)4 + 1, by equation (1)

= 641 · 228 − (6414 − 4 · 6413 + 6 · 6412 − 4 · 641 + 1) + 1


Prime and Composite Numbers 147

= 641(228 − 6413 + 4 · 6412 − 6 · 641 + 4)

Thus, 641|f5 .

Theorem 8
Every prime factor of fn is of the form k · 2n+2 + 1, where n ≥ 2.

Example 8
Show that f4 = 65537 is prime.

Solution

It suffices to show that f4 has no proper prime factors. By above


theorem, every prime factor of f4 is of the form 26 k + 1 = 64k + 1. By
Theorem 2 in Chapter 10, if f4 is composite, it must have a prime factor
√ 
≤ 65537 , that is, ≤ 256. The only prime of the form 64k + 1 and
≤ 256 is 193, but 193|65537; so f4 is a prime.

Exercises

Determine whether each is prime or composite.

1. 129 2. 217 3. 1001 4. 1729

5. Find the consecutive integers < 100 that are composite numbers.

Prove the following:

6. 2 and 3 are the only two consecutive integers that are primes.

7. If p and p2 + 8 are primes, the p3 + 4 is also a prime.

8. Let p and q be successive odd primes and p + q = 2r.Then r is


composite.

9. Let pn denote the nth prime. Then pn < 2n , where n ≥ 2.

10. Prove by contradiction that every integer ≥ 2 has a prime factor.


148 Prime and Composite Numbers

11. If p and p2 + 2 are primes, then p3 + 2 is also a prime.

12. Every odd prime is of the form 4n + 1 or 4n + 3.

13. If n is composite, then 2n − 1 is a composite

14. If n > 1 is an integer not of the form 6k + 3, prove that n2 + 2n is


composite.

15. Establish the formula π(n) in theorem 3.

16. The only prime of the form n3 − 1 is 7.

17. If p ≥ 5 is a prime number, show that p2 + 2 is composite.

18. Every integer of the form n4 + 4, with n > 1,is composite.

19. Any integer of the form 8n + 1, where n ≥ 1, is composite.


Chapter 10
The Greatest Common Divisor

Definition
If a and b are arbitrary integers, then an integer d is said to be a
common divisor of a and b if both d|a and d|b.

Remarks

1. Because 1 is a divisor of every integer, 1 is a common divisor of a


and b; hence, the set of positive common divisors is nonempty.

2. Now every integer divides zero, so that if a = b = 0, then every


integer serves as a common divisor of a and b. In this case, the set
of positive common divisors of a and b is infinite.

However, when at least one of a or b is different from zero, there are


only a finite number of positive common divisors. Among these, there is
a largest one, called the greatest common divisor of a and b.

149
150 The Greatest Common Divisor

Greatest Common Divisor

The greatest common divisor (gcd) of two integers a and b, not both
zero is the largest positive integer that divides both a and b; it is denoted
by (a, b).

Definition
Let a and b be given integers, with at least one of them different from
zero. The greatest common divisor of a and b, denoted by (a, b), is the
positive integer d satisfying the following:

1. d|a and d|b.

2. If d0 |a and d0 |b, then d0 ≤ d.

Example 1
The positive divisors of −12 are 1, 2, 3, 4, 6, 12, whereas those of 30
are 1, 2, 3, 5, 6, 10, 15, 30. Hence, the positive common divisors of −12
and 30 are 1, 2, 3, 6. Because 6 is the largest of these integers, it follows
that (−12, 30) = 6. In the same way, we can show that

(−5, 5) = 5, (8, 17) = 1, (−8, − 36) = 4

Note (a, −b) = (−a, b) = (−a, −b) = (a, b)

Relatively Prime Integers

Definition
Two integers a and b, not both of which are zero, are said to be
relatively prime whenever(a, b) = 1.

For example, 6 and 11 are relatively prime. Also 12 and 25 are relatively
prime.
The Greatest Common Divisor 151

Theorem 1
Any two consecutive Fibonacci numbers are relatively prime.

Proof
Proof of the Theorem is by the method of contradiction. Let Fn and
Fn+1 be two consecutive Fibonacci numbers and let p be a prime factor
of both Fn and Fn+1 . Then, p| ± 1, which is a contradiction. Thus,
(Fn+1 , Fn ) = 1. This completes the proof.

Lemma
Let fi denote the i th Fermat number. Then

f0 f1 . . . fn−1 = fn − 2, (Duncan’s identity)

where n ≥ 1.

Proof
n
We have numbers of the form fn = 22 + 1 are called Fermat numbers.

In the proof, when n = 1, LHS = f0 = 3 = 5 − 2 = f1 − 2 = RHS. Thus,


the result holds when n = 1.

Now assume the given result is true when n = k :

f0 f1 · · · fk−1 = fk − 2

Then
f0 f1 · · · fk−1 fk = (f0 f1 · · · fk−1 )fk

= (fk − 2)fk , by the inductive hypothesis

k k
= (22 − 1)(22 + 1)

k+1 k+1
= 22 − 1 = (22 + 1) − 2
152 The Greatest Common Divisor

= fk+1 − 2

So, if the result is true when n = k, it is also true when n = k + 1. Thus,


by induction, the result holds for every integer n ≥ 1.

Theorem 2 (Polya)
Let m and n be distinct nonnegative integers. Then fm and fn are
relatively prime.

Proof
Assume, for convenience, that m < n. Let d = (fm , fn ). Then d|fm and
d|fn . But fn − 2 = f0 f1 · · · fm · · · fn−1 .
Since d|fm , d|f0 f1 · · · fm. · · · fn . So d|(fn − 2), but d|fn ; therefore, d|2, by
Theorem 4 in chapter 8. Consequently, d must be 1 or 2. But Fermat
numbers are all odd, so d 6= 2. Therefore, d = 1; that is, (fm , fn ) = 1.

Theorem 3
There is an infinitude of primes.

Proof
We have every Fermat number has a prime factor. Therefore, by Polya’s
theorem, not two distinct Fermat numbers have common prime factors,
meaning each has a distinct prime factor. So, since there are infinitely
many Fermat numbers, there are also infinitely many primes.

Theorem 4
Let (a, b) = d. Then
1.(a, a − b) = d.

2.(a/d, b/d) = 1

Proof

1. Let d0 = (a, a − b). To show that d = d0 , we shall show that d ≤ d0


The Greatest Common Divisor 153

and d0 ≤ d.

To show that d ≤ d0 :

Since d is a common divisor of a and b, a = md and b = nd for some


integers m and n. Then a − b = (m − n)d. Thus d|a and d|(a − b); so d
is a common divisor of a and a − b. Then, by definition, d must be less
than or equal to (a, a − b); that is d ≤ d0 .

To show that d0 ≤ d :

Since d0 is a common factor of a and a−b, a = αd0 and a−b = βd0 for
some integers α and β. Then a−(a−b) = αd0 −βd0 ; that is, b = (α−β)d0 .
Thus, d0 is a common divisor of a and b, so d0 ≤ d.

Thus, d ≤ d0 and d0 ≤ d,so d = d0 .


a b
2. First we observe that although d and d have the appearance of
fractions, in fact, they are integers because d is a divisor both of a and
of b.

Now, knowing that


gcd(a, b) = d,

it is possible to find integers x and y such that

d = ax + by.

Upon dividing each side of this equation by d, we obtain the expression


a  
b
1= x+ y.
d d

a b a
Because d and d are integers, by Theorem 3, we can conclude that d
b
and d are relatively prime.
154 The Greatest Common Divisor

Linear Combinations

A linear combination of the integers a and b is a sum of multiples of


a and b, that is, a sum of the form αa + βb, where α and β are integers.

The next theorem indicates that the gcd (a, b) can be represented as
linear combination of a and b. This is illustrated by, say,

(−12, 30) = 6 = (−12)2 + 30 · 1

or
(−8, 36) = 4 = (−8)4 + (−36)(−1)

Now we state and prove the theorem.

Theorem 5 (Euler)
The gcd of the positive integers a and b is a linear combination of a and
b.

Proof
Consider the set S of all positive linear combinations of a and b:

S = {ma + nb|ma + nb > 0; m, n integers}.

Notice first that S is not empty:

For example, since a > 0, then the integer

a = am + b · 0

lies inS, where we choose m = 1 or n = −1 according as a is positive or


negative. Hence S is not empty.

Being a nonempty subset of N, by the Well-Ordering Principle, Smust


The Greatest Common Divisor 155

contain a smallest element d. Thus, from the very definition of S, there


exist integers α and β for which d = αa + βb.

Claim: d = (a, b).

Using the Division Algorithm, we obtain integers q and r such that


a = qd + r, where 0 ≤ r < d. Then r can be written in the form

r = a − qd = a − q(αa + βb)

= a(1 − qα) + b(−qβ)

If rwere positive, then this representation would imply r is a member of


S, contradicting the fact that d is the least integer in S (recall thatr < d).
Therefore,
r = 0,

and so a = qd,

or equivalently d|a.

By similar reasoning, d|b, the effect of which is to make d a common


divisor of a and b.

Now if d0 is an arbitrary positive common divisor of the integers a


andb,then by Theorem 4 in chapter 8 allows us to conclude that d0 |(αa +
βb);that is d0 |d. So d0 ≤ d

so that d is greater than every positive common divisor of aand b. Com-


bining all these information together, we obtain d = (a, b).

Corollary 1
If a and bare given integers, not both zero, then the set

T = {αa + βb|α, β are integers}


156 The Greatest Common Divisor

is precisely the set of all multiples of d = (a, b).

Proof Because d|a and d|b, we know that

d|(aα + bβ)

for all integers α, β. Thus, every member of T is a multiple of d.

Conversely, using the previous theorem, d may be written as

d = ax0 + by0

for suitable integers x0 and y0 , so that any multiple nd of d is of the


form
nd = n(ax0 + by0 ) = a(nx0 ) + b(ny0 ).

Hence, nd is a linear combination of a and b, and, by definition, lies in


T. This completes the proof.

It may happen that 1 and −1 are the only common divisors of a given
pair of integers a and b, whence (a, b) = 1. For example:

(2, 3) = 1, (−4, 9) = 1, and (−16, −35) = 1.

Theorem 6
If d = (a, b) and d0 is any common divisor of a and b, then d0 |d.

Proof
Since d = (a, b), Theorem 5, there exist α and β such that d = αa + βb.
If d0 is any common divisor of aand b,then d0 |a and d0 |b, by Theorem 4
in Chapter 1, d0 |(αa + βb); so d0 |d.

An Alternate Definition of gcd


The Greatest Common Divisor 157

A positive integer d is the gcd of a and b if

1) d|a and d|b; and

2) if d0 |a and d0 |b, then d0 |d, where d0 is a positive integer.

Theorem 7
Let a, b, and c be any positive integers. Then (ac, bc) = c(a, b).

Proof
Proof is left as an exercise.

The following theorem characterizes relatively prime integers in terms


of linear combinations.

Theorem 8 (Characterization of Relatively Prime Integers)


Let a and b be integers, not both zero. Then a and b are relatively prime
if and only if there exist integers α and β such that

1 = αa + βb.

Proof
If a and b are relatively prime so that (a, b) = 1,then Theorem 5 guar-
antees the existence of integers α and βsatisfying

1 = αa + βb.

For the converse, suppose that

1 = αa + βb.

for some choice of α and β and that

d = (a, b).
158 The Greatest Common Divisor

Becaused|a and d|b, Theorem 5 yields

d|(αa + βb).

Hence d|1.

d|1 implies either d = 1 or d = −1.

As d is positive integer, the only possibility is d is to equal 1. This


shows that a and bare relatively prime.

Corollary 2
If (a, b) = 1 = (a, c), then (a, bc) = 1.

Corollary 3
If a|c and b|c with (a, b) = 1, then ab|c.

Proof
As a|c and b|c, integers m and n can be found such that c = ma = nb.
Now the relations (a, b) = 1 allows us to write

1 = αa + βb

for some choice of integers α and β. Multiplying the last equation by c,


we obtain
c = c · 1 = c(αa + βb) = acα + bcβ.

If the appropriate substitutions are now made on the right-hand side,


then
c = a(bn)α + b(an)β = ab(nα + mβ).

Hence ab|c.

Attention! (a, b) = 1 is crucial in Corollary 2 as 6|24, 8|24, but 6 · 8/|24.


The Greatest Common Divisor 159

Note that(6, 8) 6= 1.

Our next result is of fundamental importance.

Theorem 9 (Euclid’s Lemma)


If a|bc with (a, b) = 1 then a|c.

Proof
Since(a, b) = 1, by Theorem 5 we can write

1 = αa + βb

where α and β are integers. Multiplication of this equation by c produces

c = 1 · c = (αa + βb)c = acα + bcβ. . . . (1)

Because a|ac and a|bc, it follows that a|(acα + bcβ), implies by Eq.
(1) that a|c.

The gcd of n Positive Integers

The gcd of n(≥ 2) positive integers a1 , a2 , . . . , an is the largest positive


integer that divides each ai . It is denoted by (a1 , a2 , . . . an ).

Example 2
Find (12, 18, 28), (12, 36, 60, 108), and (15, 28, 50).

Solution

a) The largest positive integer that divides 12, 18, and 28 is 2, so


(12, 18, 28) = 2.

b) 12 is the largest factor of 12, and 12 is a factor of 12, 36, 60, and 108;
so (12, 36, 60, 108) = 12.

c) Since (15, 28) = 1, the largest common factor of 15, 28, and 50 is 1;
that is, (15, 28, 50) = 1.
160 The Greatest Common Divisor

A linear Combination of n Positive Integers

A linear combination of n positive integers a1 , a2 , . . . , an is a sum


of the form α1 a1 + α2 a2 + · · · αn an , where α1 , α2 , . . . , αn are integers.

For instance, (−1) · 12 + 1 · 15 + 0 · 21 is a linear combination of 12, 15,


and 21; so is 3 · 12 + (−2) · 15 + (−5) · 21.

Theorem 10
The gcd of the positive integers a1 , a2 , . . . , an is the least positive in-
teger that is a linear combination of a1 , a2 , . . . , an .

Example 3
Express (12, 15, 21) as a linear combination of 12, 15, and 21.

Solution

First, you may notice that (12, 15, 21) = 3. Next, find integers α, β,
and γ, by trial and error, such that α · 12 + β · 15 + γ · 21 = 3; α = −1,
β = 1, and γ = 0 is such a combination: (−1) · 12 + 1 · 15 + 0 · 21 = 3.

Theorem 11
Let a1 , a2 , . . . , an be n(≥ 3) positive integers. Then (a1 , a2 , . . . , an ) =
((a1 , a2 , . . . an−1 ), an )

Proof
Let d = (a1 , a2 , . . . , an ), d0 = (a1 , a2 , . . . , an−1 ), and d00 = (d0 , an ).
We will show that d = d00 :

To show that d|d00

Since d = (a1 , a2 , . . . , an ) , d|ai for every i. So d|d0 and d|an . Then


d|(d0 , an ); that is, d|d00 .

To show that d00 |d :


The Greatest Common Divisor 161

Since d00 = (d0 , an ), d00 |d0 and d00 |an . But d00 |d0 implies d00 |ai for
1 ≤ i ≤ n − 1. Thus, d00 |ai for 1 ≤ i ≤ n, so d00 |d.

Thus, d|d00 and d00 |d, so d = d00 , by Theorem 3 in Chapter 1.

Example 4
Using recursion, evaluate (18, 30, 60, 75, 132)

Solution

(18, 30, 60, 75, 132) = ((18, 30, 60, 75), 132)

= (((18, 39, 60), 75), 132)

= ((((18, 30), 60), 75), 132) = (((6, 60), 75), 132)

= ((6, 75), 132) = (3, 132)

=3

Corollary 4
If d = (a1 , a2 , . . . , an ), then d|ai for every integer i, where 1 ≤ i ≤ n.

Corollary 5
If d|a 1 a2 . . . an and (d, ai ) = 1 for 1 ≤ i ≤ n − 1, then d|an .

Pairwise Relatively Prime Integers

The positive integers a1 , a2 , . . . , an are pairwise relatively prime


if every pair of integers is relatively prime; that is, (ai , aj ) = 1, whenever
i 6= j.

For example, the integers 8, 15, and 49 are pairwise relatively prime,
whereas the integers 6, 25, 77, and 91 are not pairwise relatively prime.

Corollary 6
162 The Greatest Common Divisor

If the positive integers a1 , a2 , . . . , an are pairwise relatively prime, then


(a1 , a2 , . . . , an ) = 1.

Corollary 7
There are infinitely many primes.

Proof
Suppose there is only a finite number of primes, p1 , p2 , . . . , pk . Consider
the Fibonacci numbers Fp1 , Fp2 , . . . , Fpk . Clearly, they are pairwise rel-
atively prime. Since there are only k primes, each of these Fibonacci
numbers has exactly one prime factor, that is, each is a prime. This is
a contradiction, since F19 = 4181 = 37 · 113. Thus, our assumption that
there are only finitely many primes is false. In other words, there are
infinitely many prime numbers.

Exercises

Express the gcd of each pair as a linear combination of the numbers.

1. (a)24, 28. (b)21, 26

2. Find the gcd of each pair, where a > b:

(a) a + b, a2 − b2

(b) a2 − b2 , a4 − b4 .

3. Express the gcd of given integers as a linear combination of the


numbers. :

(a)15, 18, 24

(b) 15, 18, 20, 28

(c) 18, 24, 36, 63

(d) (a2 b2 , ab3 , a2 b3 , a3 b4 , a4 b4 )


The Greatest Common Divisor 163

5. Prove or Disprove if (a, b) = 2 = (b, c), then (a, c) = 2

Prove each of the following:

6. The gcd of any two positive integers is unique.

7. Prove that if a and b are both odd integers, then 16|a4 + b4 − 2.

8. Prove that the sum of the squares of two odd integers cannot be a
perfect square.

9. Prove that the product of four consecutive integers is 1 less than a


perfect square.

10. Establish that the differences of two consecutive cubes is never di-
visible by 2.

11. For a nonzero integera, show that(a, 0) = |a| , (a, a) = |a|, and(a, 1) =
1.

12. If a and b are integers, not both of which are zero, verify that

(a, b) = (−a, b) = (a, −b) = (−a, −b).

13. Prove that, for a positive integer n and any integer a, (a, a+n)divides
n; hence, (a, a + 1) = 1.

14. Given integers a and b, prove that there exist integers x and y for
which c = ax + by if and only if (a, b)|c

15. Prove theorem 7

16. For any integera, show the following:

a) (2a + 1, 9a + 4) = 1.

b) (5a + 2, 7a + 3) = 1
164 The Greatest Common Divisor

17. If a is an odd integer, then show that(3a, 3a + 2) = 1.

18. If a and b are integers, not both of which are zero, prove that
(2a − 3b, 4a − 5b)divides b; hence, (2a + 3, 4a + 5) = 1.

19. Given an odd integer a, establish that

a2 + (a + 2)2 + (a + 4)2 + 1

is divisible by 12.
(3n)!
20. Prove that the expression (3!)n is an integer for alln ≥ 0.

21. Prove that the product of any three consecutive integers is divisible
by 6.

22. Prove that the product of any four consecutive integers is divisible
by 24.

23. Prove that the product of any five consecutive integers is divisible
by 120.

24. If a is an arbitrary integer, then prove that6|a(a2 + 11).

25. If a is an odd integer, then show that24|a(a2 − 1).

26. If a and b are odd integers, show that8|(a2 − b2 ).

27. If a is an integer not divisible by 2 or 3, show that24|(a2 + 23).

28. If a is an arbitrary integer, show that 360|a2 (a2 − 1)(a2 − 4).

29. Confirm the following properties of the greatest common divisor.

a) If (a, b) = 1, and (a, c) = 1, then (a, bc) = 1.

b) If (a, b) = 1 and c|a, then(b, c) = 1.


The Greatest Common Divisor 165

c) If (a, b) = 1, then (ac, b) = (c, b).

d) If (a, b) = 1and c|a + b, then

(a, c) = (b, c) = 1.

e) If (a, b) = 1, d|ac, and d| bc, and d|bc, thend|c.

f) If (a, b) = 1, then(a2 , b2 ) = 1.

30. a) Prove that if d|n, then 2d − 1|2n − 1.

b) Verify that 235 − 1 is divisible by 31 and 127.

31. Let tn denote the nth triangular number. For what values of n does
tn divide the sum t1 + t2 + · · · + tn ?

32. If a|bc, show that a|(a, b) (a, c).

Hints to Selected Exercises

25. The square of an odd integer is of the form 8k + 1.

29. (a) Because 1 = ax + by = au + cv for some x, y, u, v,

1 = (ax + by)(au + cv) = a(aux + cvx + byu) + bc(yu).

(d) Let d = (a, c). Then d|a, d|c implies that

d|(a + b) − a, or d|b.

(f) First show that (a, b2 ) = (a2 , b) = 1.

30. (a) Use the identity xk − 1 = (x − 1) (xk−1 + xk−2 + · · · + x + 1).


Chapter 11
Euclidean Algorithm

The greatest common divisor of two integers can, of course, be found by


listing all their positive divisors and choosing the largest one common
to each; but this is cumbersome for large numbers. In this chapter
we discuss a more efficient process known as Euclidean Algorithm for
finding greatest common divisor. Euclidean algorithm involves repeated
application of the Division Algorithm.

The Euclidean Algorithm may be described as follows.

Let a and b be two integers whose greatest common divisor is desired.


Because (|a|, |b|) = (a, b), there is no harm in assuming that a ≥ b ≥ 0.

The first step is to apply the Division Algorithm to a and b to get

a = q 1 b + r1 0 ≤ r1 < b

166
Euclidean Algorithm 167

If it happens that r1 = 0, then b|a and (a, b) = b. When r1 6= 0,


divide b by r1 to produce integers q2 and r2 satisfying

b = q 2 r1 + r2 0 ≤ r2 < r1

If r2 = 0, then we stop; otherwise, proceed as before to obtain

r 1 = q 3 r 2 + r3 0 ≤ r3 < r2

This division process continues until some zero remainder appears, say,
at the (n+1)th stage where rn−1 is divided by rn (a zero remainder occurs
sooner or later because the decreasing sequence b > r1 > r2 > · · · ≥ 0
cannot contain more that b integers).

The result is the following system of equations:



a = q 1 b + r1 0 < r1 < b 



b = q 2 r1 + r2 0 < r2 < r1 




r1 = q 3 r2 + r3 0 < r3 < r2


.. . . . (1)
. 




rn−2 = qn rn−1 + rn 0 < rn < rn−1 




rn−1 = qn+1 rn + 0.

Claim rn , the last nonzero remainder, is equal to(a, b). Proof of the
claim is based on the lemma below.

Lemma
Let a and b be two positive integers , and r the remainder, when a is
divided by b. Then (a, b) = (b, r).

Proof
If d = (a, b), then the relations d|a and d|b together imply that
168 Euclidean Algorithm

d|(a − qb), or d|r.

Thus, d is a common divisor of both b and r.

On the other hand, if d0 is an arbitrary common divisor of b and r,


then
d 0 |(qb + r),

and hence d 0 |a. This makes d0 a common divisor of a and b, so that


d0 ≤ d. It now follows from the definition of (b, r)that d = (b, r). Hence
we conclude that(a, b) = (b, r). This completes the proof.

Proof of the Claim

Using the result of the lemma, we simply work down the displayed
system (1) of equations, obtaining

(a, b) = (b, r1 ) = · · · = (rn−1 , rn ) = (rn , 0) = rn

as claimed.

Theorem in the previous chapter asserts that (a, b) can be expressed


in the form αa + βb, but the proof of the theorem gives no hint as to
how to determine the integers α and β. For this, we fall back on the
Euclidean Algorithm. Starting with the next-to-last equation arising
from the algorithm, we write

rn = rn−2 − qn rn−1

Now solve the preceding equation in the algorithm for rn−1 and sub-
stitute to obtain

rn = rn−2 − qn (rn−3 − qn−1 rn−2 )


Euclidean Algorithm 169

= (1 + qn qn−1 ) rn−2 + (−qn )rn−3 .

This represents rn as a linear combination of rn−2 and rn−3 . Continuing


backward through the system of equations, we successively eliminate
the remainders rn−1 , rn−2 , ..., r2 , r1 until a stage is reached where rn =
(a, b) is expressed as a linear combination of a and b.

Example 1
Using Euclidean Algorithm calculate(12378, 3054). Also represent the
greatest common divisor as a linear combination of 12378 and 3054.

Solution

The appropriate applications of the Division Algorithm produce the


equations
12378 = 4 · 3054 + 162

3054 = 18 · 162 + 138

162 = 1 · 138 + 24

138 = 5 · 24 + 18

24 = 1 · 18 + 6

18 = 3 · 6 + 0.

Our previous discussion tells us that the last nonzero remainder ap-
pearing in these equations, namely, the integer 6, is the greatest common
divisor of 12378 and 3054:

6 = (12378, 3054).

To represent 6 as a linear combination of the integers 12378 and 3054,


170 Euclidean Algorithm

we start with the next-to-last of the displayed equations and successively


eliminate the remainders 18, 24, 138 and 162:

6 = 24 − 18

= 24 − (138 − 5 · 24)

= 6 · 24 − 138

= 6(162 − 138) − 138

= 6 · 162 − 7 · 138

= 6 · 162 − 7(3054 − 18 · 162)

= 132 · 162 − 7 · 3054

= 132(12378 − 4 · 3054) − 7 · 3054

= 132 · 12378 + (−535)3054

Thus, we have

6 = (12378, 3054) = 12378x + 3054y

where x = 132 and y = −535.

Remark
Note that the above is not the only way to express the integer 6 as
a linear combination of 12378 and 3054; among other possibilities, we
could add and subtract 3054 · 12378 to get

6 = (132 + 3054) 12378 + (−535 − 12378) 3054

= 3186 · 12378 + (−12913) 3054.


Euclidean Algorithm 171

Remark
The number of steps required in the Euclidean Algorithm is at most five
times the number of digits in the smallest integer.

A Procedure to Reduce the Number of Steps

The number of steps in the Euclidean Algorithm can be reduced by


selecting remainders rk+1 such that

rk
|rk+1 | < ,
2

that is, by working with least absolute remainders in the divisions. If we


use this procedure, finding (12378, 3054) can be simplified as below:

12378 = 4 · 3054 + 162

3054 = 19 · 162 − 24

162 = 7 · 24 − 6

24 = (−4)(−6) + 0

As the last nonzero remainder is −6, the scheme produces “greatest com-
mon divisor” as −6. Hence the greatest common divisor is 6. (Note that
this scheme produces the negative of the value of the greatest common
divisor of two integers.)

Example 2
Using the Euclidean algorithm, express (4076, 1024) as a linear combi-
nation of 4076 and 1024.

Solution

All we need to do is use the equations in Euclidean algorithm in the


172 Euclidean Algorithm

reverse order, each time substituting for the remainder from the previous
equation:

(4076, 1024) = 4 = last nonzero remainder

= 1004 − 50 · 20

= 1004 − 50(1024 − 1 · 1004) (substitute for 20)

= 51 · 1004 − 50 · 1024

= 51(4076 − 3 · 1024) − 50 · 1024 (substitute for 1004)

= 51 · 4076 + (−203) · 1024

(We can confirm this by direct computation.)

A Jigsaw Puzzle

A jigsaw puzzle is a tiling puzzle that requires the assembly of often


oddly shaped interlocking pieces. Each piece usually has a small part
of a picture on it; when complete, a jigsaw puzzle produces a complete
picture. In some cases, more advanced types have appeared on the mar-
ket, such as spherical jigsaws and puzzles showing optical illusions. Let
us consider a jigsaw puzzle in which our interlocking pieces are squares
of different lengths in such a way after the interlocking work we get a
rectangle. If we go the other way, that is, for example, begin with a
rectangle say of sides 15 and 9. By the Euclidean algorithm, we have

15 = 1 · 9 + 6
Euclidean Algorithm 173

9=1·6+3

6=2·3

so that ( 15, 9) = 3. Now in the rectangle 15 × 9 the largest square we


can place inside it is a 9 × 9 square, and only one such square will fit.
Now we can use one 6 × 6 square, and two 3 × 3 squares to fit the rest of
the rectangle. Each divisor d in the algorithm represents the length of
the side of a d × d square, and the length of a side of the smallest square
gives the gcd.

Lamé’s Theorem
The number of divisions needed to compute (a, b) by the euclidean al-
gorithm is no more than five times the number of decimal digits in b,
where a ≥ b ≥ 2.

Exercises

Using the Euclidean algorithm, find the gcd of the given integers.

1. 1024,1000 2. 2024,1024 3. 2076,1076

4. 1976,1776 5. 3076,1776 6. 3076,2076

7. Let a and b be any two positive integers, and let r be the remainder
when a is divided by b. Let d = (a, b)and d0 = (b, r). Prove that d0 |d.

8. Let a and b be any two positive integers with a ≥ b. Using the sequence
of equations in the Euclidean algorithm, prove that (a, b) = (rn−1 , rn ),
where n ≥ 1.

9. Assuming that gcd(a, b) = 1, prove that gcd(a + b, a − b) = 1 or 2.

Answers

1. 8 3. 4 4. 8 6. 4
174 Euclidean Algorithm

7. By the division algorithm a = bq + r for some integer q. Since d0 |b


and d0 |r, d0 |a. Thus d0 |a and d0 |b. Thus d0 |(a, b). That is d0 |d.
Chapter 12
The Fundamental Theorem of
Arithmetic

Definition
An integer c is said to be a common multiple of two nonzero integers
a and b whenever a|c and b|c.

Examples

1. 0 is a common multiple of a and b.

2. The products ab and −(ab) are both common multiples of a and b.

By the Well-Ordering Principle of natural numbers, the set of all


positive common multiples of a and b must contain a smallest integer.

Theorem 1 (Euclid)
If p is a prime and p|ab, then p|a or p|b.

175
176 The Fundamental Theorem of Arithmetic

Proof
If p|a, there is nothing to prove. So let us assume that p - a. Then we
have to show that p|b. Because the only positive divisors of p are 1 and p
itself, this implies that (p, a) = 1. i.e., we have now p|ab and (p, a) = 1,
this using Euclid’s lemma, implies p|b . This completes the proof.

Theorem 1 easily extends to product of more than two terms. This


is the content of the next result.

Corollary 1
If p is a prime and p|a1 a2 · · · an , then p|ai for some i, where 1 ≤ i ≤ n.

Proof
We proceed by induction on n, the number of factors. When n = 1, the
stated conclusion obviously holds; whereas when n = 2, the result is the
content of Theorem 1.

Suppose, as the induction hypothesis, that n > 2 and that when-


ever p divides a product of less than n factors, it divides at least one
of the factors. Now let p|a1 a2 · · · an . From Theorem 1 either p|an or
p|a1 a2 · · · an−1 . If p|an , then we are through. As regards the case where
p|a1 a2 · · · an−1 , the induction hypothesis ensures that p|ai for some choice
of i, with 1 ≤ i ≤ n − 1. In any case, p divides one of the integers

a1 , a2 , . . . , an .

Corollary 2
If p, q1 , q2 , . . . , qn are all primes and p|q1 q2 . . . qn , then p = qi for
some i, where 1 ≤ i ≤ n.

Proof
By the help of Corollary 1 we know that p|qi for some i, with1 ≤ i ≤ n.
The Fundamental Theorem of Arithmetic 177

Being a prime, qi is not divisible by any positive integer other than 1 or


qi itself. Because p > 1, we are forced to conclude that p = qk .

Theorem 2 (Fundamental Theorem of Arithmetic)


Every positive integer n > 1 can be expressed as a product of primes;
this representation is unique, apart from the order in which the factors
occur.

Proof
Either n is a prime or it is composite. If n is a prime, there is nothing
more to prove. If n is composite, then there exists an integer d satisfying
d|n and 1 < d < n. Among all such integers d, choose p1 to be the
smallest (this is possible by the Well-Ordering Principle). Then p1 must
be a prime number. Otherwise it too would have a divisor q with 1 <
q < p1 ; but then q|p1 and p1 |n imply that q|n, which contradicts the
choice of p1 as the smallest positive divisor, not equal to 1, of n.

We therefore may write n = p1 n1 ,wherep1 is prime and 1 < n1 <


n. If n1 happens to be a prime, then we have our representation. In
the contrary case, the argument is repeated to produce a second prime
number p2 such that n1 = p2 n2 ; that is,

n = p1 p2 n2 where 1 < n2 < n1 .

If n2 is a prime, then it is not necessary to go further. Otherwise, write


n2 = p3 n3 , with p3 a prime:

n = p1 p2 p3 n3 where 1 < n3 < n2 .

The decreasing sequence

n > n1 > n2 > · · · > 1


178 The Fundamental Theorem of Arithmetic

cannot continue indefinitely, so that after a finite number of steps nk−1


is a prime, call it, pk . This leads to the prime factorization

n = p 1 p 2 · · · pk .

To prove the uniqueness of the prime factorization, let us suppose that


the integer n can be represented as a product of primes in two ways; say,

n = p1 p2 · · · pr = q1 q2 · · · qs wherer ≤ s

where the pi and qj are all primes, written in increasing magnitude so


that

p1 ≤ p2 ≤ · · · ≤ pr and q1 ≤ q2 ≤ · · · ≤ qs .

Because p1 |q1 q2 · · · qs , Corollary 2 of Theorem 1 tells us that p1 = qk for


some k ; but then p1 ≥ q1 . Similar reasoning gives q1 ≥ p1 . Combining
these, we have
p1 = q 1 .

We may cancel this common factor and obtain

p 2 p 3 · · · pr = q 2 q 3 · · · q s .

Now repeat the process to get p2 = q2 and, in turn,

p3 p4 · · · p r = q 3 q 4 · · · q s

Continue in this fashion. If the inequality r < s were to hold, we would


eventually arrive at
1 = qr+1 qr+2 · · · qs

which is not possible, because each qj > 1.


The Fundamental Theorem of Arithmetic 179

Hence, r = s and

p1 = q1 and p2 = q2 , . . . , pr = qr

making the two factorizations of n identical. This completes the proof.

Of course several of the primes that appear in the factorization of


a given positive integer may be repeated, as is the case with 360 =
2 · 2 · 2 · 3 · 3 · 5. By collecting like primes and replacing them by a single
factor we can rephrase, Theorem 2 as below.

Remark
By the above theorem every composite number n can be factored into
primes. Such a factorization is called a prime factorization of n.

For example, 5544 = 2 · 2 · 3 · 7 · 2 · 11 · 3. . . (1)

i.e. 5544 = 23 · 32 · 7 · 11 . . . (2)

the factorization in Eq.(2) is called Prime-power decomposition of


n. If the primes occurring in Eq.(2) is of increasing order then it is called
the canonical decomposition.

Canonical Decomposition

The canonical decomposition of a positive integer n is of the form


n = pa1 1 pa2 2 · · · pakk , where p1 , p2 , . . . , pk are distinct primes with p1 <
p2 < · · · < pr and each exponent ai is a positive integer.

There are two different techniques for finding the canonical decomposi-
tion. We illustrates this by the following examples.

Example 1
Find the canonical decomposition of 2520.

Solution
180 The Fundamental Theorem of Arithmetic

Beginning with the smallest prime 2, since 2|2520, 2520 = 2 · 1260. Now
2 is a factor of 1260, so 2520 = 2·2·630; 2|630 again, so 2520 = 2·2·2·315.
Now 2 - 315, but 3 does, so 2520 = 2 · 2 · 2 · 3 · 105; 3 is a factor of 105
also, so 2520 = 2 · 2 · 2 · 3 · 3 · 35. Continuing like this we get

2520 = 2 · 2 · 2 · 3 · 3 · 5 · 7 = 23 · 32 · 5 · 7

which is the desired canonical decomposition.

Example 2
Find the canonical decomposition of 2520, by Method 2.

Solution

Notice that 2520 = 40 · 63. Since none of the factors are primes, split
them again: 40 = 4 · 10 and 63 = 7 · 9, so 2520 = (4 · 10) · (7 · 9). Since 4,
10, and 9 are composites, split each of them: 2520 = (2 · 2)(2 · 5)(7)(3 · 3).
Now all the factors are primes, so the procedure stops. Rearranging
them yields the canonical decomposition: 2520 = 23 · 32 · 5 · 7.

Finding Trailing Zeros

It can be seen that 9!=362,880 has one trailing zero, while 11!=39,916,800
has two trailing zeros. We now apply the fundamental theorem of arith-
metic and the floor function to determine the number of trailing zeros
in the decimal value of n!, without computing it.

We note that each trailing zero corresponds to a factorization by 10.


So the number of trailing zeros is k if and only if k is the largest positive
integer such that 10k is factorization by 10.

Example 3
Find the number of trailing zeros in 112!.
The Fundamental Theorem of Arithmetic 181

Solution

By the fundamental theorem of arithmetic, we can factorize 112! by


prime numbers and we write 112! in the form

112! = 2a 5b c,

where a and b are positive integers and c denotes the product of primes
other than 2 and 5 (Note: Here c is not a prime, but a product of prime
factors of 112! other than 2 and 5). We note that 112! is the product
of positive integers from 1 to 112; among those integers, multiples of 2
up to 112 and multiplies of 5 up to 112 are included. It can be seen
that number of multiples of 2 are greater than number of multiples of
5. Hence while factorizing by prime number, 112 has more 2s than 5s.
Hence a > b.

Each trailing zero in 112! corresponds to a 10 in a factorization and


vice versa; each 10 is the product of a 2 and a 5. Hence the numbers
10s corresponds to the number of products of the form 2 · 5 in a prime
factorization of 112!. Since a > b it follows that number of products of
the form 2 · 5 in a prime factorization of 112!. is b. Hence the number of
trailing is zeros is b.

To find b, we proceed as follows:

No. of positive integers ≤ 112 and divisible by 5

= b112/5c = 22
Each of them contributes a 5 to the prime factorization of 112!.

No. of positive integers ≤ 112 and divisible by 25

= b112/25c = 4
Each of them contributes an additional 5 to the prime factorization of
182 The Fundamental Theorem of Arithmetic

112!.

No higher power of 5 contributes a 5 to the prime factorization of


112!, so the total number of 5s in the prime factorization equals 22 + 4
= 26. Thus, 112! has 26 trailing zeros.

Remark

By the above example, the highest power b of 5 such that 5b divides 112!
is given by
b = b112/5c + b112/25c = 22 + 4 = 26.
  
In the above summands we haven’t considered b112/125c = 112 53 ,
  
112 54 , and so on, as their values are 0, because 125, 54 are greater
than 112.

This method is applicable in general. For the highest power h of a


prime p such that ph divides n! is given by

h = bn/pc + n p2 + · · · + n pk−1
     

  
where k is the smallest positive such that pk > n so that n pk = 0,
  k+1 
n p = 0, and so on.

Example 4
Find the largest power of 3 that divides 207! .

Solution

We note that 5 is the smallest positive such that 35 = 243 > 207 so
     
that 207 35 = 0, 207 36 = 0, and so on. Hence the largest power h
of 3 that divides 207! is

h = b207/3c + 207 32 + 207 33 + 207 34


        
The Fundamental Theorem of Arithmetic 183

= 69 + 23 + 7 + 2

= 101

Example 5
Find the largest power of 2 that divides 109! .

Solution

We note that 7 is the smallest positive such that 27 = 128 > 109 so
     
that 109 27 = 0, 109 28 = 0, and so on. Hence the largest power h
of 2 that divides 109! is
j k j k j k j k j k
2 3 4 5 6
h = b109/2c + 109/2 + 109/2 + 109/2 + 109/2 + 109/2

= 54 + 27 + 13 + 6 + 3 + 1

= 104

Theorem 3
Let h denote the highest power of 2 that divides n! and b the number of
1s in the binary representation of n. Then n = h + b.

Example 6
We have see that the highest power of 2 that divides n! = 109! is h = 104.
Using the Division Algorithm, the binary representation of n = 109is
obtained as follows:
109 = 54 · 2 + 1

54 = 27 · 2 + 0

27 = 13 · 2 + 1

13 = 6 · 2 + 1
184 The Fundamental Theorem of Arithmetic

6=3·2+0

3=1·2+1

1=0·2+1

Hence the integer 109 can be written as

109 = 1 · 26 + 1 · 25 + 0 · 24 + 1 · 23 + 1 · 22 + 0 · 21 + 1 · 20

Writing the remainders from bottom to left, as numbers from left to


right we obtain
(109)2 = 1101101.

[Aliter: Also writing the remainders from bottom to left, as numbers


from left to right we obtain

(109)2 = 1101101.]

There are five 1s here. Also

n = 109 = 104 + 5 = h + b.

Hence the theorem is verified.

Example 7
Using the canonical decompositions of 720 and 3528, ?nd their gcd.

Solution

It can be seen that

720 = 24 · 32 · 5 and 3528 = 23 · 32 · 72 .

The only common prime factors are 2 and 3, so 5 or 7 cannot appear


The Fundamental Theorem of Arithmetic 185

in their gcd. Since 2 appears four times in the canonical decomposition


of 720, but only thrice in the canonical decomposition of 3528, 23 is a
factor in the gcd. Similarly, 32 is also a common factor, so (720, 3528) =
23 · 32 = 72.

Theorem 4
Let a and b be positive integers with the following canonical decomposi-
tions:

a = pa1 1 pa2 2 · · · pann and b = pb11 pb22 · · · pbnn

where ai ≥ 0, bi ≥ 0 (i = 1, 2, . . . , n)(We note that some primes will


not be a factor of either of a or b, but not both. Then what we do is
ensure that the exponents of such primes are zero. Thus, we can always
assume that both decompositions contain exactly the same prime bases
pi .) Then

min{a1 , b1 } min{a2 , b2 } n , bn }
(a, b) = p1 p2 · · · pmin{a
n .

For example,

720 = 24 · 32 · 51 · 70 and 3528 = 23 · 32 · 50 · 72 .

Hence

(720, 3528) = 2min{4, 3} · 3min{2, 2} · 5min{1, 0} · 7min{0, 2}

= 23 · 32 · 50 · 70 = 8 · 9 · 1 · 1 = 72

as obtained above.

Distribution of Primes Revisited

By the division algorithm, every integer is of the form


186 The Fundamental Theorem of Arithmetic

4n + r, where r = 0, 1, 2, or 3;

so every odd integer is of the form 4n + 1 or 4n + 3. For instance, 17


and 29 are of the form 4n + 1 :17 = 4 · 4 + 1 and 29 = 4 · 7 + 1, whereas
15 and 35 are of the form 4n + 3 :15 = 4 · 3 + 3 and 35 = 4 · 8 + 3.

Theorem 5
The product of any two integers of the form 4n + 1 is also of the same
form.

Proof
Let a and b be any two integers of the form 4n + 1, say, a = 4p + 1 and
b = 4q + 1 for some integers p and q. Then

ab = (4p + 1)(4q + 1) = 16pq + 4p + 4q + 1

= 4(4pq + p + q) + 1 = 4k + 1

wherek = 4pq + p + q is an integer. Thus, ab is also of the form 4n + 1.


This completes the proof.?

Remark
This result can be extended to any ?nite number of such integers.

Theorem 6
There are in?nitely many primes of the form 4n + 3.

Proof
The proof looks similar to Euclid’s proof, which established the infinitude
of primes. (by contradiction)

Suppose there are only finitely many primes of the form 4n + 3, say,
p0 , p1 , . . . , pk , where p0 = 3 and p0 < p1 < · · · < pk . Consider the
The Fundamental Theorem of Arithmetic 187

positive integer
N = 4 p1 p2 · · · pk + 3.

Clearly, N > pk and is also of the form 4n + 3.

Case 1: If N itself is a prime, then N would be larger than the largest


prime pk of the form 4n + 3, which is a contradiction.

Case 2: Suppose N is composite. Since N is odd, every factor of N is of


the form 4n + 1or 4n + 3. If every factor is of the form 4n + 1, then, by
the previous theorem, N would also be of the form 4n + 1. But, since N
is of the form 4n + 3, at least one of the prime factors, say, p, must be
of the form 4n + 3.

Case 2a) Let p = p0 = 3. Then 3|N. Now, so 3|N and 3|3, so using
the result “ a|band a|c implies a|αb + βc” it follows with a = 3, α = 1,
b = N,β = −1, c = 3 that 3|(N − 3). i.e., 3|(4 p1 p2 · · · pk + 3 −3) i.e.,
| {z }
N
3|4 p1 p2 · · · pk .i.e., 3|2 · 2 · p1 p2 · · · pk . Now using the result “Let p be
a prime and p|a1 a2 · · · an , where a1 , a2 , . . . , an are positive integers,
then p|ai for some i, where 1 ≤ i ≤ n” it follows that 3|2 or 3|pi , where
1 ≤ i ≤ k, but both are impossible.

Case 2b) Let p = pi , where 1 ≤ i ≤ k. Then p|N and p|4 p1 p2 · · · pk , so


p|(N − 4 p1 p2 · · · pk ), that is, p|(4 p1 p2 · · · pk + 3 −4 p1 p2 · · · pk ), i.e., p|3
| {z }
N
which is again a contradiction.

Both cases lead us to a contradiction, so our assumption must be false.


Thus, there is an infinite number of primes of the given form. This
completes the proof.

Theorem 7
There are infinitely many primes of the form 4n + 1.
188 The Fundamental Theorem of Arithmetic

Theorem 8 (Dirichlet’s Theorem)


If a and b are relatively prime, then the arithmetic sequence a, a + b,
a + 2b, a + 3b, . . . contains in?nitely many primes.

Special Cases:

1. By taking a = 3 and b = 4, we have there are infinitely many


primes of the form 4n + 3.

2. By taking a = 1and b = 4, we have there are infinitely many primes


of the form 4n + 1.

Exercises

Find the canonical decomposition of each composite number.

1. 1947 2.1976
3. 1863 4.227+1
Find the gcd of each pair, where p, q and r are distinct primes.
5. 23 · 3 · 5, 2 · 32 · 53 · 72
6. 24 · 32 · 75 , 34 · 5 · 112
7. p2 q 3 , pq 2 r
8. p3 qr3 , p3 q 4 r5
Prove each of the following

9. if p|an then p|a

10. The product of any n integers of the form 4k + 1is also of the same
form.

11. There are infinitely many primes of the form 2n + 3

12. Every positive integer n can be written as n = 2e m, where e ≥ 0


and m is an odd integer.
The Fundamental Theorem of Arithmetic 189

13. A positive integer n is called square-full or powerful, if p2 |nfor


every prime factor p of n. If n is square-full, show that it can be written
in the form n = a2 b3 ,with a and b positive integers

14. An integer is said to be square-free if it is not divisible by the


square of any integer greater than 1. (As an example, 6 is square free
while 36 is not.) Prove the following:

(a) An integer n > 1 is square-free if and only if n can be factored into


a product of distinct primes.

(b) Every integer n > 1 is the product of a square-free integer and a


perfect square.
Chapter 13
Least Common Multiple

The least common multiple (LCM) of two positive integers a and


b is the least positive integer divisible by both a and b; it is denoted by
[a, b].

Definition
The least common multiple of two nonzero integers a and b, is the
positive integer m satisfying the following:

(a) a|m and b|m.

(b) If a|m 0 and b|m 0 , with m0 > 0, then m ≤ m0 .

Example 1
The positive common multiples of the integers −12 and 30 are 60, 120,
180, . . . ; hence[−12, 30] = 60

Given nonzero integers a and b, [a, b]always exist and [a, b] ≤ |ab|.

190
Least Common Multiple 191

Example 2
Find least number which when divided by 9 gives the remainder 8, when
divided by 8 gives the remainder 7, when divided by 7 gives the remainder
6, . . . , when divided by 3 gives the remainder 2, when divided by 2 gives
the remainder 1.

Solution

We find the least common multiple of the numbers 9, 8, 7, 6, 5, 4,


3 and 2. It is 15120. Now this number is divisible by 9, 8, 7, 6, 5, 4, 3
and 2. Subtracting 1 from 15120 would give a number that leaves the
remainder 8, 7, 6, 5, 4, 2 and 1, respectively, when divided by 9, 8, 7, 6,
5, 4, 3 and 2. Hence the required number is 15120 − 1 = 15119.

Remark
Let a and b be two positive integers with the following canonical decom-
position:

a = p1 a1 p2 a2 ...pn an and b = p1 b1 p2 b2 ...pn bn , where ai , bi ≥ 0. Then

[a, b] = p1 max{a1 , b1 } p2 max{a2 , b2 } ...pn max{an , bn }

Example 3
Using the canonical decompositions of 1050 and 2574, find their lcm.

Solution

The given integers can be canonically decomposed as

1050 = 2 · 3 · 52 · 7 and 2574 = 2 · 32 · 11 · 13.


192 Least Common Multiple

Therefore, [1050, 2574]

= 2max{1, 1} · 3max{1, 2} · 5max{2, 0} · 7max{1, 0} · 11max{0, 1} · 13max{0,1)


= 21 · 32 · 52 · 71 · 111 · 131
= 450.

The following theorem helps us to calculate least common multiple of


two integers by calculating their greatest common divisor.

Theorem 1
For positive integers a and b

ab
[a, b] = .
(a, b)

Proof
Let a = p1 a1 p2 a2 ...pn an and b = p1 b1 p2 b2 ...pn bn be the canonical decom-
position of a and b, respectively. Then

(a, b) = p1 min{a1 , b1 } p2 min{a2 , b2 } ...pn min{an , bn }

And
[a, b] = p1 max{a1 , b1 } p2 max{a2 , b2 } ...pn max{an , bn }

Therefore,
(a, b) · [a, b] = p1 min{a1 , b1 } p2 min{a2 , b2 } ...

pn min{an , bn } · p1 max{a1 , b1 } p2 max{a2 , b2 } ...pn max{an , bn }

= p1 min{a1 , b1 }+max{a1 , b1 } ...pn min{an , bn }+max{an , bn

= p1 a1 +b1 p2 a2 +b2 ...pn an +bn

= (p1 a1 p2 a2 ...pn an )(p1 b1 p2 b2 ...pn bn )


Least Common Multiple 193

= ab

Thus,
ab
[a, b] =
(a, b)
Example 4
Find[3054, 12378].

Solution
3054 · 12378
[3054, 12378] =
(3054, 12378)
3054 · 12378
= = 6300402
6
The following corollary immediately follows from Theorem 2.

Corollary 1
For any choice of positive integers a andb, [a, b] = ab if and only if
(a, b) = 1.

Theorem 2
Let a1 , a2 , . . . , an be n(≥ 3) positive integers. Then [a1 , a2 , . . . , an ] =
[[a1 , a2 , . . . , an−1 ], an ].

Example 5
Evaluate [24, 28, 36, 40].

Solution

[24, 28, 36, 40] = [[24, 28, 36], 40] = [[[24, 28], 36], 40]

= [[168, 36], 40] = [504, 40]

= 2520

(You can verify this using the canonical decompositions of 24, 28, 36,
194 Least Common Multiple

and 40.)

Corollary 2
If the positive integers a1 , a2 , . . . , an are pairwise relatively prime, then
[a1 , a2 , . . . , an ] = a1 a2 . . . an−1 an .

Corollary 3
Let m1 , m2 , . . . , mk and a be positive integers such that mi |a for 1 ≤
i ≤ k. Then [m1 , m2 , . . . , mk ]|a.

Proof (by strong induction on k )


The statement is clearly true when k = 1 and k = 2. So assume it is
true for integers 1 through t. Now let mi |a for 1 ≤ i ≤ t + 1. then
[m1 , m2 , . . . , mt ]|a by the inductive hypothesis and mt+1 |a; so, again
by the hypothesis, [[m1 , m2 , . . . , mt ], mt+1 ]|a; that is,

[m1 , m2 , . . . , mt+1 ]|a

by Theorem. Thus, by induction, the result is true for every positive


integer k.

Exercises

In Exercises 1-2, find the lcm of each pair of integers.

1. (a) 110, 210 (b) 65, 66

2. (a) 143, 227, (b) 306, 657, (c)272, 1479..

In Exercises 3-4, find [a, b] if:

3. ab = 156 and a and b are relatively prime.

4. (a, b) = 3 and ab = 693

5. Find the positive integera if [a, a + 1]=132


Least Common Multiple 195

6. Given nonzero integers a and b, establish the following facts concern-


ing [a, b]

a) (a, b) = [a, b] if and only if a = ±b.

b) If k > 0 then [ka, kb] = k[a, b].

c) If m is any common multiple of a and b then[a, b]|m.

7. Using recursion, find the lcm of the given integers.

(a) 15,18,24,30 (b)12, 15, 18, 25, 30

8. Prove that (a, [b, c]) = [(a, b), (a, c)]

9. Let m be any multiple of a and b. Prove that [a, b]|m.

10. Find positive integers a and b such that gcd(a, b) = 20 and [a, b] =
840.

11. Prove or disprove: [a, b, c] = abc/ gcd(a, b, c)

12. Prove that the l cm of any of any two integers is unique.

13. Let m be a multiple of a and b, where a, b, and m are positive


integers. Then [a, b]|m.

14. Find the smallest positive integer ≥ 2 that is a square, a cube, and
a fifth power.
Chapter 14
Linear Diophantine Equations

The term Diophantine equation is applied to any equation in one or


more unknowns that is to be solved in the integers. The simplest type
of Diophantine equation that we shall consider is the linear diophantine
equation in two unknowns:

ax + by = c

where a, b, c are given integers and a, b, are not both zero. A solution of
this equation is a pair of integers x0 , y0 that, when substituted into the
equation, satisfy it; that is, we obtain ax0 + by0 = c.

A given linear diophantine equation can have a number of solutions,


as the following example shows.

Example 1 (Example of a linear diophantine equation that have a num-


ber of solutions)

196
Linear Diophantine Equations 197

Find some solutions of


3x + 6y = 18

Solution

Some set of solutions are x0 = 4, y0 = 1; x1 = −6, y1 = 6; and


x2 = 10, y2 = −2 as
3 · 4 + 6 · 1 = 18

3(−6) + 6 · 6 = 18

3 · 10 + 6(−2) = 18

There are linear Diophantine equations that have no solution, as the


following example shows.

Example 2 (Example of a linear diophantine equation that has no so-


lution)
Find the solution, if there is any, of

2x + 8y = 13

Solution

There is no integer solution to the equation

2x + 8y = 13

because the left-hand side is an even integer whatever the choice of x


and y, whereas the right hand side is not.

Example 3
Solve the following epigram problem.
198 Linear Diophantine Equations

1 1
Diophantus’s boyhood lasted 6 of his life; his beard grew after 12
1
more; after 7 more he married and his son was born 5 years later; the
son lived to half his father’s age and the father died 4 years after his son.
Then at what age Diophantus died?

Solution

If x was the age at which Diophantus died, the given data leads to
the equation
1 1 1 1
x+ x+ x+5+ x+4=x
6 12 7 2
with solution x = 84.

Theorem 1
The linear diophantine equation ax + by = c has a solution if and only
if d|c, where d = (a, b).

Proof
We note that if d = (a, b), then there are integers r and s for which
a = dr and b = ds.

If a solution of ax + by = c exists, so that aα + bβ = c for suitable α


and β, then

c = aα + bβ = drα + dsβ = d(rα + sβ)

which simply says that d|c.

Conversely, assume that d|c, say c = de. Since d = (a, b) there are
integers r and s such that

d = ra + sb.
Linear Diophantine Equations 199

When this relation is multiplied by e, we obtain

c = de = (ra + sb)e = a(re) + b(se).

Hence, the Diophantine equation ax + by = c has

x = re and y = se

as a particular solution. This completes the proof.

Theorem 2
The linear diophantine equation ax + by = c has a solution if and only if
d|c, where d = (a, b). If x0 , y0 is any particular solution of this equation,
then all other solutions are given by
 
b a
x = x0 + t, y = y0 − t
d d

where t is any arbitrary integer.

Proof
The first part is the content of Theorem 1. To establish the second
assertion of the theorem, let us suppose that a solution x0 ,y0 of the
given equation is known. If x0 , y 0 is any other solution, then

ax0 + by0 = c = ax0 + by 0

which is equivalent to

a(x0 − x0 ) = b(y0 − y 0 ). . . . (1)

Now we apply Corollary 1 to Theorem 3 in Chapter 2 and Theorem


4 in Chapter 5. As (a, b) = d, then ad , db = 1, so that ad and db are


relatively prime. Hence there exist relatively prime integers r and s such
200 Linear Diophantine Equations

that
a b
d = r and d = s.

Hence
a = dr, b = ds.

Substituting these values into Eq.(1) and cancelling the common factor
d, we find that
r(x0 − x0 ) = s(y0 − y 0 ).

The situation is now this: r|s(y0 − y 0 ), with(r, s) = 1. Using Euclid’s


lemma, it must be the case r|(y0 − y 0 ); or, in other words, y0 − y 0 = rt
for some integer t.

Substituting, we obtain

x0 − x0 = st

This leads us to the formulas


 
0 b
x = x0 + st = x0 + t
d
a
y 0 = y0 − rt = y0 − t
d
It is easy to see that these values satisfy the Diophantine equation, re-
gardless of the choice of the integer t; for
   
0 0 b h a i
ax + by = a x0 + t + b y0 − t
d d
 
ab ab
= (ax0 + by0 ) + − t
d d
=c+0·t
Linear Diophantine Equations 201

= c.

Thus there are an infinite number of solutions of the given equation, one
for each value of t.

Remark
If the linear diophantine equation ax + by = c has a solution, then it
has infinitely many solution. They are given by the general solution
x = x0 + db t and y = y0 − ad t, t being an arbitrary integer, by giving
 

different values t, we can find any number of particular solutions.

Example 4
Find the complete solution of the linear Diophantine equation

172x + 20y = 1000.

Also find solutions in positive integers, if they exist.

Solution

Applying the Euclidean’s Algorithm to the evaluation of (172, 20),


we find that
172 = 8 · 20 + 12

20 = 1 · 12 + 8

12 = 1 · 8 + 4

8 = 2 · 4.

Hence(172, 20) = 4. Because 4|1000,a solution to this equation exists.


To obtain the integer 4 as a linear combination of 172 and 20, we work
backward through the previous calculations, as follows:

4 = 12 − 8
202 Linear Diophantine Equations

= 12 − (20 − 12)

= 2.12 − 20

= 2(172 − 8.20) − 20

= 2 · 172 + (−17)20

Upon multiplying this relation by 250, we arrive at

100 = 250 · 4 = 250[2 · 172 + (−17)20]

= 500 · 172 + (−4250)20

so that x = 500 and y = −4250

provide one solution to the Diophantine equation in question. Since


(172, 20) = 4, all other solutions are expressed by

x = 500 + (20/4)t = 500 + 5t

y = −4250 − (172/4) t = −4250 − 43t

for some integer t.

Now we try to find the solutions in the positive integers, if any hap-
pen to exist. For this, t must be chosen to satisfy simultaneously the
inequalities

5t + 500 > 0 and −43t − 4250 > 0

or the inequalities

5t > −500 and −43t > 4250


Linear Diophantine Equations 203

or
36
−98 > t > −100
43

Because t must be an integer, we are forced to conclude that t = −99.


Thus the given Diophantine equation has a unique positive solution x =
5, y = 7 corresponding to the value t = −99.

When the coefficients are relatively prime integers, Theorem 2 pro-


vides the following result:

Corollary 1
If (a, b) = 1 and if x0 , y0 is a particular solution of the linear diophantine
equation ax + by = c, then all solutions are given by

x = x0 + bty = y0 − at

for integral values of t.

Example 5
The equation 5x + 22y = 18 has x0 = 8,y0 = −1 as one solution. Since
(5, 22) = 1, this with corollary gives a complete solution

x = 8 + 22t,y = −1 − 5t, for arbitrary t.

Example 6 [Mahavira’s Puzzle]


Twenty-three weary travellers entered the outer parts of a forest. They
found 63 equal heaps of plantains and seven single fruits, and divided
them equally. Find the number of fruits in each heap.

Solution

Let x denote the number of plantains in a heap and y the number


of plantains received by a traveller. Then we get the linear diophantine
204 Linear Diophantine Equations

equation
63x + 7 = 23y

Since both x and y must be positive, we are interested in finding only


the positive integer solutions of the linear diophantine equation. Solving
it for y,
63x + 7
y=
23
When x > 0, clearly y > 0. So try the values 1, 2, 3, and so on for x
until the value of y becomes an integer. It follows that x = 5, y = 14
is a solution. We can verify that x = 28, y = 77 is another solution. In
fact, the linear diophantine equation has infinitely many solutions.

Now let us find the general solution to Mahavira’s puzzle. The linear
diophantine equation is

63x − 23y = −7.

Since (63, 23) = 1, the linear diophantine equation has a solution. To


find a particular solution x0 , y0 , first we express the gcd 1 as a linear
combination of 63 and 23. For this, we apply the euclidean algorithm:

63 = 2 · 23 + 17

23 = 1 · 17 + 6

17 = 2 · 6 + 5

6=1·5+1

5=1·5+1

5=5·1+0
Linear Diophantine Equations 205

Now, we use the first four equations in reverse order:

1=6−1·5

= 6 − 1(17 − 2 · 6)

= 3 · 6 − 1 · 17

= 3(23 − 1 · 17) − 1 · 17

= 3 · 23 − 4 · 17

= 3 · 23 − 4(63 − 2 · 23)

= (−4) · 63 + 11 · 23

Multiplying both sides of this equation by −7, we get

−7 = (−7) · (−4) · 63 + (−7) · 11 · 23

= 63 · 28 − 23 · 77

which shows x0 = 28 and y0 = 77 is a particular solution of the linear


diophantine equation. Therefore, by Corollary 1, the general solution is
given by

x = x0 + bt = 28 − 23t and y = y0 − at = 77 − 63t,

where t is an arbitrary integer.

Example 7
A customer bought a dozen pieces of fruit, apples and oranges, for Rs 132.
If an apple costs 3 rupees more than an orange and more apples than
oranges were purchased, how many pieces of each kind were bought?

Solution
206 Linear Diophantine Equations

Let x be the number of apples and y be the number of oranges


purchased; in addition, let z represent the cost (in rupees) of an orange.
Then the conditions of the problem lead to

(z + 3)x + zy = 132

or equivalently we obtain

3x + (x + y)z = 132.

or

3x + 12z = 132, since x + y = 12.

This simplifies to
x + 4z = 44.

Now the problem is to find integers x and z satisfying the Diophantine


equation

x + 4z = 44. . . . (1)

Since gcd(1, 4) = 1 is a divisor of 44, by Theorem 2, there is solution to


Eq. (1). Upon multiplying the relation

1 = 1(−3) + 4 · 1

by 44 to get
44 = 1(−132) + 4 · 44

it follows that
x0 = −132, z0 = 44

serves as one solution. By Corollary, all other solutions of Eq. (1) are of
Linear Diophantine Equations 207

the form
x = −132 + 4t, z = 44 − t

where t is an integer.

Not all of the choices for t furnish solutions to the original problem.
Only values of t that ensure 12 ≥ x > 6 should be considered. This
requires obtaining those values of t such that

12 ≥ −132 + 4t > 6

Now, 12 ≥ −132 + 4t implies that t ≤ 36, whereas −132 + 4t > 6 gives


t > 34 12 . The only integral values of t to satisfy both inequalities are
t = 35 and t = 36. Thus there are two possible purchases: a dozen
apples costing Rs.11 a piece (the case where t = 36) , or 8 apples at
Rs.12 each and 4 oranges at Rs.9 each (the case where t = 35).

Example 8 (The problem of the ‘Hundred fowls’)


If a cock is worth 5 coins, a hen 3 coins, and three chicks together 1 coin,
how many cocks, hens, and chicks, totaling 100, can be bought for 100
coins?

Solution

Let x be the number of cocks, y the number of hens, z the number


of chicks. Then in terms of equations, the problem would be written

5x + 3y + 13 z = 100 and x + y + z = 100.

Now x + y + z = 100 gives z = 100 − x − y, and putting this in the first


208 Linear Diophantine Equations

equation, we obtain

5x + 3y + 13 (100 − x − y) = 100,

or 7x + 4y = 100. . . . (2)

Since gcd(7, 4) = 1 is a divisor of 100, by Theorem 2, there is a solution


to Eq. (2). Obviously,
x = 0, y = 25

is a solution. Hence by Corollary 1, Eq. (2) has the general solution

x = 4t, y = 25 − 7t,

so that
z = 75 + 3t,

where t is an arbitrary integer.

Some solutions are: (putting t = 1, 2 and 3 respectively)

x = 4y = 18z = 78

x = 8y = 11z = 81

x = 12y = 4z = 84

To obtain all solutions in the positive integers, t must be chosen to satisfy


simultaneously the inequalities

4t > 0, 25 − 7t > 0, and 75 + 3t > 0.

The last two of these are equivalent to the requirement

−25 < t < 3 74 .


Linear Diophantine Equations 209

Because t must have a positive value, we conclude that t = 1, 2, 3,


leading to precisely the values given above.

Example 9 (The Monkey and Coconuts Puzzle)


Five sailors and a monkey are trapped on a desert island. During the
day they gather coconuts for food. They decide to divide them up in
the morning, but first they retire for the night. While the others sleep,
one sailor gets up and divides them into five equal piles, with one left
over, which he throws out for the monkey. He hides his share, puts the
remaining coconuts together, and goes back to sleep. Later a second
sailor gets up, divides the pile into five equal shares with one coconut
left over, which he discards for the monkey. One by one the remaining
sailors repeat the process. In the morning, they divide the pile equally
among them with one coconut left over, which they throw out for the
monkey. Find the smallest possible number of coconuts in the original
pile.

Solution

Let n denote the number of coconuts in the original pile. Let u1 ,


u2 , u3 , u4 and u5 denote the number of coconuts each sailor took after
each division, and let z be the number of coconuts each received after
the final division.

The first sailor gets up and divides n coconuts into five equal piles, with
one left over (which he throws out for the monkey) means

n − 1 = 5u1

or n = 5u1 + 1.

As the first sailor takes and hides u1 coconuts, there remains only 4u1 coconuts.
210 Linear Diophantine Equations

The second sailor gets up and divides these 4u1 coconuts into five equal
piles, with one left over (which he throws out for the monkey) means

4u1 − 1 = 5u2

or 4u1 = 5u2 + 1.

Likewise, we obtain
4u2 = 5u3 + 1

4u3 = 5u4 + 1

4u4 = 5u5 + 1

4u5 = 5z + 1.

These equations yield the linear diophantine equation

15625z − 1024n = −11529.

Because (15625, 1024) = 1, the linear diophantine equation has a solu-


tion.

Using the euclidean algorithm, it can be seen that

1 = 313 · 15625 − 4776 · 1024,

so multiplying both sides by −11529, we obtain

15625 · [(−11529) · 313] − 1024 · [4776 · (−11529)] = −11529.

i.e., 15625 · (−3608577) − 1024 · (−55062504) = −11529.

So z0 = −3608577 and n0 = −55062504 is a particular solution, and the


Linear Diophantine Equations 211

general solution is z = −3608577 − 1024t, n = −55062504 − 15625t, t


being an arbitrary integer.

Because n > 0, −55062504 − 15625t > 0 so that t < − 55062504


15625 ; i.e.,
t < −3524. Because n is a minimum when t is a maximum, t = −3525.
Then n = −55062504−15625·(−3525) = 15621. Thus, the least number
of coconuts in the original pile is 15621.

Fibonacci Numbers and Linear Diophantine Equations

Consider the linear diophantine equation Fn+1 x + Fn y = c. We know


that (Fn+1 , Fn ) = 1, so the linear diophantine equation is solvable.

By Cassini’s formula,

Fn+1 Fn−1 − Fn2 = (−1)n .

Suppose n is even. Then Fn+1 Fn−1 − Fn2 = 1; so Fn+1 (cFn−1 ) +


Fn (−cFn ) = c. Thus, x0 = cFn−1 , y0 = −cFn is a particular solution of
the linear diophantine equation Fn+1 x + Fn y = c.

On the other hand, let n be odd. Then Fn+1 (−Fn−1 ) + Fn2 = 1;


so Fn+1 (−cFn−1 ) + Fn (cFn ) = c. Thus, x0 = −cFn−1 , y0 = cFn is a
particular solution of the linear diophantine equation Fn+1 x + Fn y = c.

For example, consider the linear diophantine equation

34x + 21y = 17.

Since F9 F7 − F82 = 34 · 13 − 212 = (−1)8 and c = 17, it follows


that x0 = cF7 = 17 · 13 = 221, y0 = −cF8 = −17 · 21 = −357 is a
particular solution. So the general solution is x = x0 + bt = 221 + 21t,
y = y0 − at = −357 − 34t.
212 Linear Diophantine Equations

Theorem 3
The linear diophantine equation

a1 x1 + a2 x2 + · · · + an xn = c

is solvable if and only if (a1 , a2 , · · · , an )|c. When it is solvable, it has


infinitely many solutions.

Example 10
Determine whether the linear diophantine equations

6x + 8y + 12z = 10 and 6x + 12y + 15z = 10

are solvable.

Solution

Since (6, 8, 12) = 2 and 2|10, the linear diophantine equation 6x +


8y + 12z = 10 is solvable.

(6, 12, 15) = 3, but 3 6 |10, so the 6x + 12y + 15z = 10 has no integral
solutions.

Example 11
Find the general solution of the linear diophantine equation 6x + 8y +
12z = 10.

Solution

By the preceding example, the linear diophantine equation has in-


finitely many solutions. Since 8y + 12z is a linear combination of 8 and
12, it must be a multiple of (8, 12) = 4; so we let

8y + 12z = 4u . . . (3)

This leads to a linear diophantine equation in two variables: 6x+4u =


Linear Diophantine Equations 213

10. Solving this, we get x = 5+2t and u = −5−3t, with t as an arbitrary


integer.

Now substitute for u in equation (3):

8y + 12z = 4 (−5 − 3t)

Notice that (8, 12) = 4 and 4 = 2.8 + (−1) · 12. Therefore,

4(−5 − 3t) = (−10 − 6t) · 8 + (5 − 3t) · 12.

So, by Theorem 2, the general solution of equation (3) is y = −10 −


6t + 3t0 ,z = 5 + 3t − 2t0 . Thus, the general solution of the given linear
diophantine equation is
x = 5 + 2t

y = −10 − 6t + 3t0

z = 5 + 3t = 2t0

where t and t0 are arbitrary integers.

Exercises

In Exercises 1-3, examine whether the given Diophantine equation can


be solved ?
1. 14x + 16y = 15.
2. 12x + 16y = 18.
3. 28x + 91y = 119.
In Exercises 4-6, determine all solutions in the integers of the given
Diophantine equation
4. 56x + 72y = 40.
5. 24x + 138y = 18.
214 Linear Diophantine Equations

6. 221x + 35y = 11.


In Exercises 7-10, determine all solutions in the positive integers of the
given Diophantine equation.
7. 15x + 21y = 39.
8. 28x + 91y = 119.
9. 123x + 360y = 99.
10. 1776x + 1976y = 4152.
11. If a and b are relatively prime positive integers, prove that the
Diophantine equation ax − by = chas finitely many solutions in the
positive integers.

12. A pile of mangoes was collected. The king took one-sixth, the queen
one-fifth of the remainder, the three princes one-fourth, one third, and
one half of the successive remainders, and the youngest child took the
three remaining mangoes. Find the number of mangoes in the pile.

13. A person bought some 12-cent stamps and some 15-cent stamps.
The postal clerk told her the total cost was $.5.50. Is that possible?

14. A piggy bank contains nickels and dimes for a total value of $3.15.
Find the possible number of nickels and dimes.

Solve the following linear diophantine equations.


15. x + 2y + 3z = 6
16. 2x − 3y + 4z = 5
17. 6x + 12y − 15z = 33
Pn
18. Prove that the linear diophantine equation i=1 ai xi = c is solvable
if and only if (a1 , a2 , ..., an )|c
Pn
19. If the linear diophantine equation i=1 ai xi = c is solvable, then it
has infinitely many solutions.

20. Find the number of men, women and children in a company of 20


Linear Diophantine Equations 215

persons if together they pay 20 coins, each man paying 3, each woman
2 and each child 21 .
Chapter 15
Congruences

In this chapter we define and study Gauss’s useful notion of congruence


for integers. According to Gauss, “If a number n measures the difference
between two numbers a and b, then a and b are said to be congruent
with respect to n; if not, incongruent.”

Definition
Let n be a fixed positive integer. Two integers a and b are said to be
congruent modulo n, symbolized by

a ≡ b(mod n)

if n divides the difference a − b; that is, provided thata − b = kn for some


integer k.

Example 1
13 ≡ 3(mod5), since 13 − 3 is divisible by 5.

216
Congruences 217

Similarly,
18 ≡ 3(mod5),

6 ≡ 6(mod4),

38 ≡ 6(mod4),

59 ≡ 10 (mod7),

40 ≡ 1 (mod13).

Definition
When n doesn’t divide a − b, we say that a is incongruent to b modulo
n, and in this case we write a/≡ b(mod n).

Example 2
The following are examples for incongruence.

17/≡ 3 (mod5), since 17 − 3 is not divisible by 5

Similarly,
4/≡ 2(mod4)

36/≡ 6(mod4)

50/≡ 10(mod7)

41/≡ 1(mod13)

Theorem 1
Let n > 1 be fixed and a, b, c, d be arbitrary integers. Then the following
properties hold:

1. a ≡ a(mod n).

2. If a ≡ b(mod n), then b ≡ a(mod n).


218 Congruences

3. If a ≡ b(mod n) and b ≡ c(mod n) , then a ≡ c(mod n).

4. If a ≡ b(mod n) and c ≡ d(mod n), then a + c ≡ b + d(mod n) and


ac ≡ bd(mod n).

5. If a ≡ b(mod n), then a + c ≡ b + c (mod n) and ac ≡ bc(mod n).

6. If a ≡ b(mod n), then ak ≡ bk (mod n) for any positive integer k.

Proof
For any integer a, we have a − a = 0 · n, so that a ≡ a(mod n).

Now if a ≡ b(mod n), then a − b = kn for some integer k. Hence,


b−a = −(kn) = (−k)n and because −k is an integer, this yields property
(b).

To prove property (c), suppose that

a ≡ b(mod n) and b ≡ c(mod n).

Then there exist integers h and k satisfying

a − b = hn and b − c = kn.

It follows that

a − c = (a − b) + (b − c) = hn + kn = (h + k)n

which is a ≡ c(mod n) in congruence notation.

To prove property (d), assume, a ≡ b(mod n) and c ≡ d(mod n),


then we are assured that a − b = k1 n and c − d = k2 n for some choice of
k1 and k2 . Adding these equations, we obtain

(a + c) − (b + d) = (a − b) + (c − d)
Congruences 219

= k1 n + k2 n = (k1 + k2 )n

or, as a congruence statement, a + c ≡ b + d(mod n). As regards the


second assertion of property (d), note that

ac = (b + k1 n)(d + k2 n) = bd + (bk2 + dk1 + k1 k2 n)n

Because bk2 + dk1 + k1 k2 n is an integer, this says that ac − bd is divisible


by n, and hence ac ≡ bd(mod n).

The proof of property (e) is covered by (d) and the fact that c ≡
c(mod n).

Finally we obtain property (f ) by making an induction argument.


The statement certainly holds for k = 1, and we will assume it is true for
some fixed k. From (d), we know that a ≡ b(mod n) and ak ≡ bk (mod n)
together imply that
aak ≡ bbk (mod n),

or equivalently ak+1 ≡ bk+1 (mod n).

This is the form the statement should take for k + 1,and so the induction
step is complete.

Characterization of Congruences

Theorem 2
For arbitrary integers a and b, a ≡ b(mod n), if and only if a and b leave
the same nonnegative remainder when divided by n.

Proof
First take a ≡ b(mod n), so that a = b + kn for some integer k. Upon
division by n, b leaves a certain remainder r ; that is, b = qn + r, where
220 Congruences

0 ≤ r < n. Therefore,

a = b + kn = (qn + r) + kn = (q + k)n + r

which indicates that a has the same remainder as b.

On the other hand, suppose we can write a = q1 n+r and b = q2 n+r,


with the same remainder r (0 ≤ r < n). Then

a − b = (q1 n + r) − (q2 n + r) = (q1 − q2 )n

and hence n|a − b. Now by the definition of congruences, we have

a ≡ b(mod n).

Corollary 1
The integer r is the remainder when a is divided by m if and only if
a ≡ r(mod m), where 0 ≤ r < m.

By this corollary, every integer a is congruent to its remainder rmodulo


m; r is called the least residue of a modulo m.

Corollary 2
Every integer is congruent modulo n to exactly one of the values 0, 1, 2, ..., n−
1; in particular, a ≡ 0(modn) if and only if n|a.

Proof
Given an integera, let q and r be its quotient and remainder upon divi-
sion by n, so that
a = qn + r0 ≤ r < n.

Then by definition of congruence, a ≡ r (mod n). Because there are n


choices for r, we have that every integer is congruent modulo n to exactly
Congruences 221

one of the values 0, 1, 2, ..., n − 1..

In particular, a ≡ 0(modn) if and only if n|a.

Example 3
Prove that no prime of the form 4n + 3 can be expressed as the sum of
two squares.

Solution

Let N be a prime of the form 4n + 3. Then N ≡ 3(mod 4).

Suppose N = A2 + B 2 for some integers A and B. Since N is odd, one of


the squares, say, A2 , must be odd and hence B 2 must be even. Then A
must be odd and B even. Let A = 2a + 1 and B = 2b for some integers
a and b. Then
N = (2a + 1)2 + (2b)2
= 4(a2 + b2 + a) + 1
≡ 1 (mod 4)

which is a contradiction, since N ≡ 3(mod 4).

Congruence classes

Using least residues, the set of integers Z can be partitioned into m


nonempty pairwise disjoint classes, called congruence classes modulo
m. To elucidate this, let [r] denote the set of integers that have r as their
least residue modulo m. For example, the various congruence classes
modulo 3 are
[0] = {..., −6, −3, 0, 3, 6, ...}
[1] = {..., −5, −2, 1, 4, 7, ...}
[2] = {..., −4, −1, 2, 5, 8, ...}

Clearly, these classes are nonempty, pairwise disjoint, and their union is
the set of integers. Accordingly, these classes form a partitioning of
222 Congruences

the set of integers. The least residues 0, 1, and 2 serve as representatives


of the classes [0], [1], and [2], respectively.

A Complete set of Residue modulo n

Definition
The set of n integers 0, 1, 2, ..., n − 1 is called the set of least nonneg-
ative residues modulo n.

Definition
A collection of n integers a1 , a2 , ..., an is said to form a complete set
of residues (or a complete system of residues) modulo n if every
integer is congruent modulo n to one and only one of the ak .

Remark
If a1 , a2 , ..., an is a complete set of residues, then a1 , a2 , ..., an are
congruent modulo n to0, 1, 2, ..., n − 1, taken in some order.

Example 4
Based on the Remark,

−100, −12, −3, 9, 81

constitute a complete set of residues modulo 5; for

−100 ≡ 0(mod5), −12 ≡ 3(mod5),

−3 ≡ 2(mod5), 9 ≡ 4(mod5),

81 ≡ 1(mod5).

Remark
Any set of n integers form a complete set of residues modulo n if and
only if no two of the integers are congruent modulo n.
Congruences 223

Example 5
Because the integers −56 and −11 can be expressed in the form

−56 = (−7)9 + 7 − 11 = (−2)9 + 7

with the same remainder 7, Theorem 1 tells us that −56 ≡ −11(mod 9).
Going in the other direction, the congruence −31 ≡ 11(mod 7) implies
that −31 and 11 have the same remainder when divided by 7; this is
clear from the relations

−31 = (−5)7 + 411 = 1 · 7 + 4

Example 6
Show that 41 divides 220 − 1.

Solution

Since 25 ≡ −9(mod 41), by part (f) of Theorem 1, we have

(25 )4 ≡ (−9)4 (mod 41).

That is, 220 ≡ 81 · 81(mod 41).

But 81 ≡ −1(mod 41),

and so 81 · 81 ≡ 1(mod 41).

Using parts (b) and (e) of Theorem 1, we finally arrive at

220 − 1 ≡ 81 · 81 − 1 ≡ 1 − 1 ≡ 0(mod 41).

Thus, 41|220 − 1,as desired.

Example 7
224 Congruences

Find the remainder obtained upon dividing the sum

1! + 2! + 3! + 4! + · · · + 99! + 100!

by 12.

Solution

We note that
4! ≡ 24 ≡ 0(mod 12).

Thus, for k ≥ 4,

k! ≡ 4! · 5 · 6 · · · k ≡ 0 · 5 · 6 · · · k ≡ 0(mod 12)

In this way, we find that

1! + 2! + 3! + 4! + · · · + 100! ≡ 1! + 2! + 3! + 0 + · · · + 0 ≡ 9(mod 12)

Accordingly, the sum in question leaves a remainder of 9 when divided


12.

Example 8
Show that 1919 cannot be expressed as the sum of the cube of an integer
and the fourth power of another integer.

Solution

We prove this by the method of contradiction. Notice that

1919 ≡ 619 (mod13).

But
62 ≡ −3(mod13)
Congruences 225

and 64 ≡ −4(mod13),

so 66 ≡ −1(mod13).

Therefore,

1919 ≡ 619 ≡ (66 )3 · 6 ≡ (−1)3 · 6 ≡ −6 ≡ 7(mod13).

Suppose 1919 can be expressed as x3 + y 4 for some integers x and y. It


can be seen that x3 ≡ 0, 1, 5, 8, or 12 modulo 13, and y 4 ≡ 0, 1, 3,
or 9 modulo 13. Thus, x3 + y 4 can be congruent to any least residue
modulo 13, except 7. This is a contradiction since 1919 ≡ 7(mod13).
Thus, 1919 cannot be expressed as the sum of the cube of an integer and
the fourth power of another integer.

Example 9
Show that no integer of the form 8n + 7 can be expressed as a sum of
three squares.

Solution

We prove this by the method of contradiction. Suppose there is an


integer N of the form 8n+7 that can be expressed as the sum x2 +y 2 +z 2
of three integers x, y, and z. Then

N ≡ 7(mod8)

so
x2 + y 2 + z 2 ≡ 7(mod8)

Hence x must be congruent modulo 8 to 0, 1, 2, 3, 4, 5, 6, or 7; but

5 ≡ −3(mod8), 6 ≡ −2(mod8), 7 ≡ −1(mod8);


226 Congruences

so, x2 must be congruent modulo 8 to 02 , 12 , 22 , 32 , 42 , (−3)2 , (−2)2 ,


(−1)2 , that is, to 0, 1, or 4. Likewise, both y 2 and z 2 must be congruent
to 0, 1, or 4 modulo 8. Therefore, x2 +y 2 +z 2 must be congruent modulo
8 to exactly one of the sums 0 + 0 + 0, 0 + 0 + 1, 0 + 0 + 4, 0 + 1 +
0, ... , 4 + 4 + 4, but none of them is congruent to 7 modulo 8, which
is a contradiction. Thus, no integer of the form 8n + 7 can be expressed
as the sum of three squares.

Theorem 3
If ca ≡ cb(mod n) and gcd(c, n) = 1,then a ≡ b(mod n).

Proof
Suppose ca ≡ cb(mod n), where , gcd(c, n) = 1. Then n|(ca − cb); that
is, n|c(a − b).

But gcd(c, n) = 1, so, n|(a − b); that is, a ≡ b(mod n).

Theorem 4
n

If ca ≡ cb(mod n), then a ≡ b mod d , where d = gcd(c, n).

Proof
By hypothesis, we can write

c(a − b) = ca − cb = kn

for some integer k. Knowing that gcd(c, n) = d, there exist relatively


prime integers r and s satisfying c = dr, n = ds. When these values are
substituted in the displayed equation and the common factor d cancelled,
the net result is
r(a − b) = ks.

Hence, s|r(a − b)and gcd(r, s) = 1. Euclid’s lemma yields s|a − b. Hence


a ≡ b(mod s). As s = nd , this gives a ≡ b mod nd .

Congruences 227

Remark
Theorem says that if ca ≡ cb(mod n), with d = gcd(c, n), then we can
divide both sides of the congruence by c to get
 n
a ≡ b mod .
d

Example 10
Consider the congruence33 ≡ 15(mod 9). It can be written as, 3 · 11 ≡
3 · 5(mod 9). Because gcd(3, 9) = 3,Theorem 4 leads to the conclusion
that 11 ≡ 5(mod 3).

Attention!
In Theorem 3, it is unnecessary to stipulate that c/≡ 0(modn). Indeed, if
c ≡ 0(modn), then gcd(c, n) = nand the conclusion of the theorem would
state that a ≡ b(mod 1), (i.e., 1 divides a − b,) which holds trivially for
all integers a and b .

Example 11
Illustrate that the product of two integers, neither of which is congruent
to 0, may turn out to be congruent to 0.

Solution
4/≡ 0(mod 12) and
3/≡ 0(mod 12)

but 4 · 3 ≡ 0(mod 12).

The following result follows immediately from Theorem 4.

Example 12
Consider the congruence−35 ≡ 45(mod8). It can be written as 5·(−7) ≡
5 · 9(mod 8). The integers 5 and 8 being relatively prime, we may cancel
the factor 5 to obtain a correct congruence−7 ≡ 9(mod 8).
228 Congruences

Results

1. If ab ≡ 0 (mod n) and gcd(a, n) = 1, then b ≡ 0(mod n).

2. If ab ≡ 0 (mod p), with p a prime, then either a ≡ 0(mod p) or


b ≡ 0(mod p).

Corollary 3
If ca ≡ cb(mod p) and p - c, where p is a prime number, then a ≡
b(mod p).

Proof
The conditions p - c, and p a prime imply that gcd(c, p) = 1. Hence the
result follows from theorem 3.

Towers of Powers of Modulo m

The technique of finding remainders using congruences can be extended


to numbers with exponents, which are towers of powers.

Example 13
1999
Find the last digit in the decimal value of 19971998 .

Solution
c c
We note that ab = a(b ) . Let N denote the given number. The last
digit in N equals the least residue of N modulo 10. Since

1997 ≡7 (mod10),

we observe the various powers of 7:

71 ≡ 7(mod10), 72 ≡ 9(mod10), 73 ≡ 3(mod10),

74 ≡ 1(mod10), 75 ≡ 7(mod10)
Congruences 229

and clearly a pattern emerges:




 1(mod10) if a ≡ 0(mod4)


 7(mod10) if a ≡ 1(mod4)
7a ≡


 9(mod10) if a ≡ 2(mod4)

3(mod10) if a ≡ 3(mod4)

Now let us look at 1998. Since 1998 ≡ 2(mod4), 1998n ≡ 2n (mod4),


so if n ≥ 2, then 1998n ≡ 0(mod4). Thus, since 1999 ≥ 2, 19981999 ≡
0(mod4) 4), so N ≡ 1(mod10). In other words, the last digit in the
decimal value of N is 1.

Example 14
Show that 11 · 14n + 1 is a composite number.

Solution

Let N = 11 · 14n + 1. We are going to show that p|N for some prime
p.

Case 1) Suppose n is even. Since 14 ≡ −1(mod3), 14n ≡ 1(mod3). Then


N = 2 · 1 + 1 ≡ 0(mod3), so 3|N .

Case 2) Suppose n be odd. Since 14 ≡ −1(mod5), 14n ≡ 1(mod5). Then

N ≡ 1 · (−1) + 1 ≡ 0(mod5),

so 5|N .

Thus, in both cases, N is composite.

Example 15
Find the remainder when (n2 + n + 41)2 is divided by 12.

Solution
230 Congruences

We first note that the product of four consecutive integers is divisible


by 12; that is, (n − 1)n(n + 1)(n + 2) ≡ 0(mod12). We have

(n2 + n + 41)2 ≡ (n2 + n + 5)2 (mod12)

≡ (n4 + 2n3 + 11n2 + 10n + 25)(mod12)

≡ (n4 + 2n3 − n2 − 2n) + 1(mod12)

≡ n(n3 + 2n2 − n − 2) + 1(mod12)

≡ n[n2 (n + 2) − (n + 2)] + 1(mod12)

≡ n(n+2)(n2 −1)+1(mod12) ≡ (n−1)n(n+1)(n+2)+1(mod12) ≡ 1(mod12)

Thus when (n2 + n + 41)2 is divided by 12, the remainder is 1.

Theorem 5
If a ≡ b(modm1 ),a ≡ b(modm2 ), ... , a ≡ b(modmk ), then a ≡
b(mod[m1 , m2 , . . . , mk ]).

Proof
By the given assumptions,

m1 |(a − b), m2 |(a − b), ... , mk |(a − b), so,

[m1 , m2 , . . . , mk ]|(a − b)

i.e., a ≡ b(mod[m1 , m2 , . . . , mk ]).

The following example illustrates this result.

Example 16
We can verify that 85 ≡ 5(mod2),85 ≡ 5(mod8), and 85 ≡ 5(mod10);
so by above theorem, 85 ≡ 5(mod[2, 8, 10]); that is, 85 ≡ 5(mod40).
Congruences 231

Corollary 4
If a ≡ b(modm1 ), a ≡ b(modm2 ), ... , a ≡ b(modmk ), where the moduli
are pairwise relatively prime, then a ≡ b(modm1 m2 · · · mk ).

Proof
If m1 , m2 , . . . , mk are pair wise relatively prime, then [m1 , m2 , . . . , mk ] =
m1 m2 · · · mk . Hence the result follows from the previous theorem.

Exercises

1. Prove each of the following assertions:

(a) If a ≡ b(mod n) and m|n, then a ≡ b(mod m).

(b) If a ≡ b(mod n) and c > 0, then ca ≡ cb(mod cn).

(c) If a ≡ b(mod n) and the integers a, b, n are all divisible by d > 0,


then a/d ≡ b/d(mod n/d).

2. Given an example to show that a2 ≡ b2 (mod n) need not imply that


a ≡ b(mod n).

3. If a ≡ b(mod n), prove that gcd(a, n) = gcd(b, n).

4. (a) Find the remainders when 250 and 4165 are divided by 7.

(b) What is the remainder when the following sum is divided by 4?

15 + 25 + 35 + · · · + 995 + 1005

5. Prove that the integer 53103 + 10353 is divisible by 39, and that
111333 + 333111 is divisible by 7.

6. For n ≥ 1, use congruence theory to establish each of the following


divisibility statements:

(a) 7|52n + 3 · 25n−2 ·


232 Congruences

(b) 13|3n+2 + 42n+1 ·

(c) 27|25n+1 + 5n+2 ·

(d) 43|6n+2 + 72n+1 ·

7. For n ≥ 1, show that

(−13)n+1 ≡ (−13)n + (−13)n−1 (mod 181)

8. Prove the assertions below:

(a) If a is an odd integer, then a2 ≡ 1(mod 8).

(b) For any integer a, a3 ≡ 0, 1, or 6(mod 7).

(c) For any integer a, a4 ≡ 0 or 1(mod 5).

(d) If the integer a is not divisible by 2 or 3, then a2 ≡ 1(mod 24).



9. If p is a prime satisfying n < p < 2n,show that 2n n ≡ 0(mod p)

10. If a1 , a2 , ..., an is a complete set of residues modulo n and gcd(a, n) =


1, prove that aa1 , aa2 , . . . , aan is also a complete set of residues modulo
n.

11. Verify that 0, 1, 2 , 22 , 23 , . . . , 29 form a complete set of residues


modulo 11, but that 0, 12 , 22 , 32 , . . . , 102 do not.

12. Prove the following statements:

1. If gcd(a, n) = 1 then the integers

c, c + a, c + 2a, c + 3a, · · · , c + (n − 1)a

form a complete set of residues modulo n for any c.


Congruences 233

(b) Using part (a), show that any n consecutive integers form a complete
set of residues modulo n.

(c) The product of any set of n consecutive integers is divisible by n.

13. Verify that if a ≡ b(mod n1 ) and a ≡ b(mod n2 ), then a ≡ b(mod n),


where the integer n = lcm (n1 , n2 ). Hence, whenever n1 and n2 are
relatively prime, a ≡ b(modn1 n2 ).

14. Give an example to show that ak ≡ bk (mod n) and k ≡ j(mod n)


need not imply that aj ≡ bj (mod n).

15. Using induction on n, establish that if a is an odd integer, then for


any n ≥ 1
n
a2 ≡ 1(mod 2n+2 ).

16. Use the theory of congruences to verify that

89|244 − 1 and 97|248 − 1.

17. Prove that whenever ab ≡ cd(mod n) and b ≡ d(mod n), with


gcd(b, n) = 1, then a ≡ c(mod n).

18. If a ≡ b (mod n1 ) and a ≡ c(mod n2 ), prove that b ≡ c(mod n),


where the integer n = gcd(n1 , n2 ).
Chapter 16
Linear Congruence

Definition
A linear congruence is an equation of the form ax ≡ b(mod n). A so-
lution of a linear congruence is an integer x0 for whicha x0 ≡ b (mod n).

Remark
a x0 ≡ b (mod n) if and only if n|a x0 − b i.e., if and only if a x0 − b = n y0
for some integer y0 . Hence, the problem of finding all integers that will
satisfy the linear congruence a x ≡ b(mod n) is identical with that of
obtaining all solutions of the linear Diophantine equation a x − ny = b.

It is convenient to threat two solutions of a x ≡ b(mod n) that are


congruent modulo n as being equal even though they are not equal in the
usual sense. For instance, x = −9 and x = 3 both satisfy the congruence
3x ≡ 9 (mod 12); because 3 ≡ −9 (mod 12). Hence x = −9 and x = 3 are
not counted as different solutions.

234
Linear Congruence 235

When we refer to the number of solutions of a x ≡ b(mod n), we mean


the number of incongruent integers satisfying this congruence.

Theorem 1
The linear congruence ax ≡ b(mod n) has a solution if and only if d|b,
where d = gcd(a, n). If d|b, then it has d mutually incongruent solutions
modulo n.

Proof
In the Remark above, we have observed that the given congruence is
equivalent to the linear Diophantine equation

ax − ny = b.

From Theorem 1 in the chapter “Diophantine Equation” it is known that


the latter equation can be solved if and only if d|b, where d = gcd(a, n).
Moreover, if it is solvable and x0 , y0 is one specific solution, then any
other solution has the form

n a
x = x0 + ty = y0 + t.
d d

for some choice of t.

Among the various integers satisfying the first of these formulas,


consider those that occur when t takes on the successive values t =
0, 1, 2, . . . , d − 1 :

n 2n (d − 1)n
x0 , x0 + , x0 + , . . . , x0 + .
d d d

We claim that these integers are incongruent modulo n, and all other
236 Linear Congruence

such integers x are congruent to some one of them. If it happened that

n n
x0 + t1 ≡ x0 + t2 (mod n)
d d

where 0 ≤ t1 < t2 ≤ d − 1, then we would have

n n
t1 ≡ t2 (mod n).
d d

Now gcd( nd , n) = n
d, and therefore by Remark below Theorem 4 in the
n
Chapter “Congruences”, the factor d could be cancelled to arrive at the
congruence
t1 ≡ t2 (mod d)

which is to say that d|t2 − t1 . But this is impossible in view of the


inequality 0 < t2 − t1 < d.
n

It remains to argue that any other solution x0 + d t is congruent
modulo n to one of the d integers listed above. The division Algorithm
permits us to write t as t = qd + r, where0 ≤ r ≤ d − 1.

Hence
n n
x0 + t = x0 + (qd + r)
d d
n
= x0 + nq + r
d
n
≡ x0 + r(mod n)
d
n

with x0 + d r being one of our d selected solutions. This completes
the proof.

The following result is a special case of the theorem when a and n


are assumed to be relatively prime.

Corollary 1
Linear Congruence 237

The linear congruence ax ≡ b(mod n) has a unique solution modulo n if


and only if gcd(a, n) = 1.

Example 1
Consider the linear congruence 18x ≡ 30(mod 42). Because gcd(18, 42) =
6 and 6 surely divides 30, Theorem guarantees the existence of exactly
six solutions, which are incongruent modulo 42. By inspection, one so-
lution is found to be x = 4. Our analysis tells us that the six solutions
are as follows:
 
42
x=4+ t ≡ 4 + 7t(mod 42), t = 0, 1, . . . , 5
6

i.e.,
x ≡ 4, 11, 18, 25, 32, 39(mod 42)

Example 2
Solve the linear congruence 9x ≡ 21(mod 30).

Solution

As gcd(9, 30) = 3 and 3|21, we know that there must be three in-
congruent solutions.

One way to find these solutions is to divide the given congruence


through by 3, thereby replacing it by the equivalent congruence 3x ≡
7(mod 10). The relative primeness of 3 and 10 implies that the latter
congruence admits a unique solution modulo 10. Although it is not the
most efficient method, we could test the integers 0, 1, 2, . . . 9 in turn
until the solution is obtained. A better way is this: Multiply both sides
of the congruence 3x ≡ 7(mod 10) by 7 to get

21x ≡ 49(mod 10)


238 Linear Congruence

which reduces to x ≡ 9(mod 10). (This simplification is no accident,


for the multiples 0 · 3, 1 · 3, 2 · 3, . . . , 9 · 3 form a complete set of
residues modulo 10; hence, one of them is necessarily congruent to 1
modulo 10). But the original congruence was given modulo 30, so that
its incongruent solutions are sought among the integers 0, 1, 2, . . . , 29.
Taking t = 0, 1, 2, in the formula

x = 9 + 10t

we obtain 9, 19, 29, and hence

x ≡ 9(mod 30)x ≡ 19(mod 30)x ≡ 29(mod 30)

are the required three solutions of 9x ≡ 21(mod 30).

Aliter A different approach to the problem is to use the method that


is suggested in the proof of Theorem 1. Because the congruence 9x ≡
21(mod 30) is equivalent to the linear Diophantine equation

9x − 30y = 21

we begin by expressing 3 = gcd(9, 30) as a linear combination of 9 and


30. It is found, either by inspection or by using the Euclidean Algorithm,
that
3 = 9(−3) + 30 · 1,

so that
21 = 7 · 3 = 9(−21) − 30(−7).

Thus,
x = −21, y = −7
Linear Congruence 239

satisfy the Diophantine equation and, in consequence, all solutions of


the congruence in question are to be found from the formula

x = −21 + (30/3)t = −21 + 10t.

The integers x = −21+10t, where t = 0, 1, 2, are incongruent modulo 30


(but all are congruent modulo 10); thus, we end up with the incongruent
solutions

x ≡ −21(mod 30), x ≡ −11(mod 30) and x ≡ −1(mod 30).

The corresponding positive numbers are

x ≡ 9(mod 30), x ≡ 19 (mod 30), and x ≡ 29 (mod 30).

Modular Inverses

Consider the special case b = 1 in corollary 1. The linear congruence


ax ≡ 1 (mod m) has a unique solution if and only if (a, m) = 1; in other
words, when (a, m) = 1, there is a unique least residue x such that
ax ≡ 1 (mod m). Then a is said to be invertible and x is called an
inverse of a modulo m, denoted by a−1 :

aa−1 ≡ 1 (mod m). If a−1 = a, then a is self-invertible.

Example 3
Since 3 · 7 ≡ 1(mod2), 3 is invertible and 7 is an inverse of 3 modulo
2; that is, 3−1 is 7 modulo 2; 9 is its own inverse modulo 2, because
9 · 9 ≡ 1(mod2).

The next result shows that inverses are useful in solving linear congru-
ences.

Theorem 2
The unique solution of the linear congruence ax ≡ b (mod m), where
240 Linear Congruence

(a, m) = 1, is the least residue of a−1 b (mod m).

Proof.
We have the congruence

ax ≡ b (mod m),

where (a, m) = 1. Since (a, m) = 1, a has an inverse a−1 modulo m.


Multiplying both sides of the congruence by a−1 , we get

a−1 (ax) ≡ a−1 b (mod m)

(a−1 a)x ≡ a−1 b (mod m)

1x ≡ a−1 b (mod m)

i.e.,
x ≡ a−1 b (mod m).

Hence the result.

Example 4
Using the above theorem, solve the hundreds fowls riddle in Example 8
of chapter 17.

Solution

From Example 8 of chapter 17,

x + y + z = 100

z
5x + 3y + = 100
3
Linear Congruence 241

Eliminating z between these equations, we get

7x + 4y = 100.

This gives
7x ≡ 100(mod4).

3x ≡ 0(mod4).

Hence
3(3x) ≡ 3 · 0(mod4).

Since
3−1 ≡ 3(mod4)

the above implies


x ≡ 0(mod4).

So x = 4t. Substituting for x in the equation 7x + 4y = 100, we obtain

7(4t) + 4y = 100

y = 25 − 7t.

Now we substitute for x and y in the equation x + y + z = 100, we get

4t + (25 − 7t) + z = 100

z = 3t + 75.

Thus, the general solution is x = 4t, y = 25 − 7t, z = 3t + 75.

Example 5
Find the last nonzero digit (from the left) in the decimal value of 234!.
242 Linear Congruence

Solution

First, notice that the product of the four integers between any two
consecutive multiples of 5 is congruent to −1 modulo 5; that is, if n ≡
0(mod5), then

(n + 1)(n + 2)(n + 3)(n + 4) ≡ 1 · 2 · 3 · 4 ≡ −1(mod5).

It can be seen that 234! has 56 trailing zeros. Hence, the desired digit d

is the ones digit in 234! 1056 . Since the canonical decomposition of 234!
contains more 2s than 5s, d must be even. Thus, d = 2, 4, 6, or 8.To

extract the correct value of d, we compute 234! 1056 (mod5) in seven
steps:
231 · 232 · 233 · 234 ≡ −1(mod5)
230! 230!
= ≡ (−1)46 ≡ 1(mod5)
546 · 46! 5 · 10 · 15 · · · 230
46! 46!
= ≡ (−1)9 ≡ −1(mod5)
59 · 9! 5 · 10 · 15 · · · 230
9!
≡ (−1)2 ≡ 1(mod5)
5
230! 46! 9!
· 9 · ≡ 1 · (−1) · 1 ≡ 4(mod5)
546 · 46! 5 · 9! 5
234! 230! (231 · 232 · 233 · 234)
= ≡ (−1) · 4 ≡ −4 ≡ 1(mod5)
556 556
Since 256 ≡ 428 ≡ (−1)28 ≡ 1(mod5) and (2, 5) = 1, this implies

234! 234!
= 56 56 ≡ 1(mod5)
1056 2 5

i.e., d ≡ 1(mod5), so d = 6. Thus, the 56 zeros in 234! follow the digit


6.
Linear Congruence 243

Exercises

1. Solve the following linear congruences:

(a) 25x ≡ 15(mod 29) (b) 5x ≡ 2(mod 26)

(c) 6x ≡ 15(mod 21) (d) 36x ≡ 8(mod 102)

(e) 34x ≡ 60(mod 98) (f) 140x ≡ 133(mod 301)

(g)20x ≡ 4(mod 30) (h) 20x ≡ 30(mod 4)

(i) 353x ≡ 254(mod 400) (j) 57x ≡ 87(mod 105);

2. Using congruences, solve the Diophantine equations below:

(a) 4x + 51y = 9.

(b) 12x + 25y = 331. (c) 5x − 53y = 17.

3. Find all solutions of the linear congruence 3x − 7y ≡ 11(mod 13).

In Exercises 4-6, how many solutions are there to each of the following
congruences: 4. 15x ≡ 25(mod 35);
5. 15x ≡ 24(mod 35);
6. 15x ≡ 0(mod 35).
7. Solve the each of the following sets of simultaneous congruences:

1. x ≡ 1 (mod 3),x ≡ 2 (mod 5),x ≡ 3 (mod 7).

2. x ≡ 5 (mod 11),x ≡ 14 (mod 29),x ≡ 15 (mod 31).

3. x ≡ 5 (mod 6),x ≡ 4 (mod 11),x ≡ 3 (mod 17).

4. 2x ≡ 1 (mod 5),3x ≡ 9 (mod 6),4x ≡ 1 (mod 7),5x ≡ 9 (mod 11).

8. Find the smallest positive integer (exceptx = 1) that satisfies the


244 Linear Congruence

following congruences simultaneously:

x ≡ 1(mod 3), x ≡ 1 (mod 5), x ≡ 1(mod 7).

9. Find all integers that satisfy simultaneously:

x ≡ 2 (mod 3), x ≡ 3(mod 5), x ≡ 5(mod 2).

10. Solve the set of congruences:

x ≡ 1(mod 4), x ≡ 0(mod3), x ≡ 5(mod 7).

11. Solve the linear congruence 17x ≡ 3(mod 2 · 3 · 5 · 7)by solving the
system
17x ≡ 3 (mod 2)17x ≡ 3 (mod 3)

17x ≡ 3 (mod 5)17x ≡ 3 (mod 7)

12. Find the smallest integer a > 2such that

2|a, 3|a + 1, 4|a + 2, 5 |a + 3, 6|a + 4.

13. (a) Obtain three consecutive integers, each having a square factor.

[Hint to 13 (a): Find an integer a such that 22 |a, 32 |a + 1, 52 |a + 2.]

(b) Obtain three consecutive integers, the first of which is divisible by a


square, the second by a cube, and the third by a fourth power.

14. When eggs in a basket are removed 2, 3, 4, 5, 6 at a time there


remain respectively, 1, 2, 3, 4, 5, eggs. When they are taken out 7 at
a time, none are left over. Find the smallest number of eggs that could
have been contained in the basket.
Linear Congruence 245

15. The basket-of-eggs problem is often phrased in the following: One


egg remains when the eggs are removed from the basket 2, 3, 4, 5, or 6
at a time; but no eggs remain if they are removed 7 at a time. Find the
smallest number of eggs that could have been in the basket.

16. A band of 17 pirates stole a sack of gold coins. When they tried to
divide the fortune into equal portions, 3 coins remained. In the ensuing
brawl over who should get the extra coins, one pirate was killed. The
wealth was distributed, but this time an equal division left 10 coins.
Again an argument developed in which another pirate was killed. But
now the total fortune was evenly distributed among the survivors. What
was the least number of coins that could have been stolen?

17. (a) Prove that the congruences

x ≡ a(mod n)and x ≡ b(mod m)

admit a simultaneous solution if and only if gcd (n, m)|a − b;if a


solution exists, confirm that it is unique modulo lcm (n, m).

(b) Use (a) to show that the following system does not possess a solution:

x ≡ 5 (mod 6) and x ≡ 7 (mod 15)

18. If x ≡ a (mod n), prove that

either x ≡ a (mod 2n) or x ≡ a + n(mod 2n)

19. A certain integer between 1 and 1200 leaves the remainders 1, 2, 6


when divided by 9, 11, 13, respectively. What is the integer?

20. (a) Find an integer having the remainders 1, 2, 5, 5 when divided


by 2, 3, 6, 12, respectively.

(b) Find an integer having the remainders 2, 3, 4, 5 when divided by 3,


4, 5, 6, respectively.
246 Linear Congruence

(c) Find an integer having the remainders 3, 11, 15 when divided by 10,
13, 17, respectively.

21. Let tn denote the nth triangular number. For which values of n

does tn divide
t21 + t22 + · · · + t2n .

22. Find the solutions of the system of congruences:

3x + 4y ≡ 5(mod 13)

2x + 5y ≡ 7(mod 13)

23. Obtain the two incongruent solutions modulo 210 of the system

2x ≡ 3(mod 5)

4x ≡ 2(mod 6)

3x ≡ 2(mod 7)

24. Obtain the eight incongruent solutions of the linear congruence

3x + 4y ≡ 5(mod 8).

25. Find the solutions of each of the following systems of congruences:

1. 5x + 3y ≡ 1(mod 7)

2. 3x + 2y ≡ 4(mod 7).

3. 7x + 3y ≡ 6(mod 11)

4. 4x + 2y ≡ 9(mod 11).
Linear Congruence 247

5. 11x + 5y ≡ 7(mod 20)

6. 6x + 3y ≡ 8(mod 20).
Chapter 17
Divisibility Tests

In this chapter we discuss that the theory of congruences can be used to


develop simple tests for checking whether a given integer n is divisible
by an integer m.

i.e, we can describe some divisibility tests using congruence notation.

Recall that if a is a number which in ordinary base 10 notation has


digits an an−1 · · · a2 a1 a0 , then this means that

a = an 10n + an−1 10n−1 + · · · + a2 102 + a1 10 + a0 .

We begin with the test for 10.

Divisibility Test for 10

Because 10 ≡ 0(mod 10), a ≡ a0 (mod 10). So a is divisible by 10 if and


only if a0 is divisible by 10; that is, if and only if a0 = 0. Thus, an

248
Divisibility Tests 249

integer is divisible by 10 if and only if its units digit is zero.

Divisibility Test for 2i

Because 10 ≡ 0(mod 2), 10i ≡ 0(mod 2i ) for all positive integers i.So, we
have
n ≡ n0 (mod 2)

≡ n1 n0 (mod 22 ) [Here n1 n0 denotes a two-digit number).

≡ n2 n1 n0 (mod 23 )

..
.

≡ ni−1 ni−2 · · · n1 n0 (mod 2i )

Thus, an integer n is divisible by 2i if and only if the number formed


by the last i digits in n is divisible by 2i . In particular, n is divisible
by 2 if and only if the ones digit n0 is divisible by 2; it is divisible by 4
if the two-digit number n1 n0 is divisible by 4; it is divisible by 8 if the
three-digit number n2 n1 n0 is divisible by 8, and so on.

Example 1
Let n = 256, 036. Since 2|6, 2|n; 4|36 so, 4|n; but 8 6 |036, so, 8 6 |n.

Divisibility Tests for 3 and 9

Theorem 1
Let
a = an 10n + an−1 10n−1 + · · · + a2 102 + a1 10 + a0 .

Then 9 divides a if and only if 9 divides the sum of the digits of a.

Proof
250 Divisibility Tests

We observe that

10r ≡ 1(mod9) for all r,

so
a = an 10n + an−1 10n−1 + · · · + a2 102 + a1 10 + a0

≡ an + an−1 + · · · + a2 + a1 + a0 (mod9).

Thus 9 divides a if and only if a ≡ 0(mod9), if and only if the sum of


the digits of a is congruent to 0 (mod9), if and only if 9 divides the sum
of the digits of a. This completes the proof.

The following result is familiar from school algebra.

Theorem 2
3 divides a if and only if 3 divides the sum of the digits of a.

Proof
Since 9 divides 10n − 1 for all n, so does 3. The proof is the same as for
9.

Theorem 3
Suppose

a = an 10n + an−1 10n−1 + · · · + a2 102 + a1 10 + a0 .

Then 2 divides a if and only if 2 divides a0 .

Proof
Since 2 divides 10, we have 10r ≡ 0(mod2) for all r ≥ 1. So a ≡ a0 (mod2).
Hence 2 divides a if and only if 2 divides a0 .

Theorem 4
5 divides a if and only if 5 dividesa0 .
Divisibility Tests 251

Proof
Since 5 divides 10, we have 10r ≡ 0(mod5) for all r ≥ 1. So a ≡ a0 (mod5).
Hence 5 divides a if and only if 5 divides a0 .

Theorem 5
11 divides a if and only if 11 divides the alternating sum of the digits of
a.

Proof
Since 10 ≡ −1 (mod11),it follows that 10r ≡ (−1)r (mod11) for all r.
Then
a = an 10n + an−1 10n−1 + · · · + a2 102 + a1 10 + a0

≡ an (−1)n + an−1 (−1)n−1 + · · · + a2 (−1)2 + a1 (−1) + a0 (mod11).

Thus 11 divides a if and only if 11 divides the alternating sum of the


digits of a.

Exercises

1. Find nice tests for divisibility of numbers in base 34 by each of 2,


3, 5, 7, 11, and 17.

Which of the following numbers are divisible by 2? By 4? By 8?

1. 427,364

2. 30,587,648

3. 800,358,816

Determine whether each number is divisible by 6.

5. 87,654
252 Divisibility Tests

6. 639576

Determine whether each number is divisible by 11.

7. 43,979

8. 502,458

9. Find all four-digit integers of the form 4ab8 that are divisible by 2, 3,
4, 6, 8, and 9.

10. Develop a divisible test for 37. [Hint: 103 ≡ 1(mod 37)]

11. Find the smallest number that leaves a remainder i when divided by
i + 1 where 1 ≤ i ≤ 9.
Chapter 18
Wilson’s Theorem

In this chapter we discuss Wilson’s theorem. We start with a lemma.

Lemma
A positive integer a is self-invertible modulo p if and only if a ≡ ±1(mod p).

Proof
Suppose a is self-invertible. Then a2 ≡ 1(mod p); that is, p|(a2 − 1); so
p|(a − 1)(a + 1). Then, p|(a − 1) or p|(a + 1); thus, either a ≡ 1(mod p)
or a ≡ −1(mod p).

Conversely, suppose a ≡ 1(mod p) or a ≡ −1(mod p). In either case,

a2 ≡ 1(mod p), so a is self-invertible modulo p.

The next result tells that if p is a prime number, then p divides (p−1)!+1.

Theorem 1 (Wilson’s Theorem)

253
254 Wilson’s Theorem

If p is a prime, then

(p − 1)! ≡ −1 (mod p).

Proof
When p = 2,
(2 − 1)! = 1! = 1 ≡ −1(mod 2)

and when p = 3
(3 − 1)! = 2! = 2 ≡ −1(mod 3).

Hence the result is true for p = 2 and p = 3.

Now take p > 3. Suppose that a is any one of the p − 1 positive


integers
1, 2, 3, . . . , p − 1

and consider the linear congruence ax ≡ 1 (mod p). Then gcd(a, p) = 1.


By the result “the linear congruence ax ≡ b(mod n) has a solution if and
only if d|b,where d = gcd(a, n). If d|b,then it has d mutually congruent
solutions modulo n,” this congruence admits a unique solution modulo
p; hence, there is a unique integer a0 , with 1 ≤ a0 ≤ p − 1, satisfying
aa0 ≡ 1 (mod p).

Because p is prime, we claim that a = a0 if and only if a = 1 or


a = p − 1. Indeed, the congruence a2 ≡ 1 (mod p) is equivalent to

a2 − 1 ≡ 0(mod p)

and is equivalent to

(a − 1) · (a + 1) ≡ 0 (mod p).
Wilson’s Theorem 255

Therefore,

either a − 1 ≡ 0 (mod p),in which casea = 1,

or a + 1 ≡ 0 (mod p), in which case a = p − 1.

This proves the claim.

If we omit the numbers 1 andp−1, the effect is to group the remaining


integers 2, 3, . . . , p − 2 into pairs a, a0 , where a 6= a0 , such that their
p−3
product aa0 ≡ 1 (mod p). When these 2 congruences are multiplied
together and the factors rearranged, we get

2 · 3 · · · · · (p − 2) ≡ 1 (mod p).

That is,
(p − 2)! ≡ 1(mod p).

Now multiply by p − 1 to obtain the congruence

(p − 1)! ≡ p − 1 ≡ −1 (mod p).

This completes the proof.

Example 1
Taking p = 13, explain the proof of Wilson’s theorem.

Solution
(p−3)
It is possible divide the integers 2, 3, . . . , 11 into 2 = 5 pairs,
each product of which is congruent to 1 modulo 13. To write these
congruences out explicitly:

2 · 7 ≡ 1 (mod 13)
256 Wilson’s Theorem

3 · 9 ≡ 1 (mod 13)

4 · 10 ≡ 1 (mod 13)

5 · 8 ≡ 1 (mod 13)

6 · 11 ≡ 1 (mod 13)

Multiplying these congruences gives the result

11! = (2 · 7)(3 · 9)(4 · 10)(5 · 8)(6 · 11) ≡ 1 (mod 13)

and so
12! ≡ 12 ≡ −1 (mod 13)

Thus,(p − 1)! ≡ −1 (mod p), with p = 13.

Example 2
Let p be a prime and n any positive integer. Prove that

(np)!
≡ (−1)n (mod p)
n!pn

Solution

Let a be any positive integer congruent to 1 modulo p. Then, by Wilson’s


theorem,

a(a + 1) · · · [a + (p − 2)] ≡ (p − 1)! ≡ −1(mod p)

In other words, the product of the p − 1integers between any two con-
secutive multiples of p is congruent to −1 modulo p. Then

(np)! (np)!
=
n!pn p · 2p · 3p · · · (np)
Wilson’s Theorem 257

n
Y
= [(r − 1)p + 1] · · · [(r − 1)p + (p − 1)]
r=1
n
Y
≡ (p − 1)! (mod p)
r=1
n
Y
≡ (−1) (mod p)
r=1

≡ (−1)n (mod p)

Example 3
If 2p + 1 is a prime number, prove that (p)2 + (−1)r is divisible by2p + 1.

Solution

By Wilson’s Theorem (2p)! is divisible by2p + 1. Put n = 2p + 1,so


that p + 1 = n − p;then

(2p)! = 1 · 2 · 3 · 4 · · · · · p(p + 1)(p + 2) · · · · · (n − 1)

= 1(n − 1) 2(n − 2) 3(n − 3) · · · p(n − p)

= a multiple of n + (−1)r (p!)2 .

Therefore 1 + (−1)p (p!)2 is divisible by n or2p + 1, and therefore (p!)2 +


(−1)r is divisible by2p + 1.

Many Theorems relating to the properties of numbers can be proved


by induction. We illustrate this in the following examples.

Example 4
258 Wilson’s Theorem

If p is a prime number xp − xis divisible by p.

Solution

Let xp − x be denoted by f (x); then

f (x + 1) − f (x) = (x + 1)p − (x + 1) − (xp − x)

p(p − 1) p−2
= pxp−1 + x + ... + px
1·2

= a multiple of p, if p is prime.

Hence

f (x + 1) = f (x) + a multiple of p.

Therefore, if f (x) is divisible by p, so also is f (x + 1); but

f (2) = 2p − 2 = (1 + 1)p − 2,

and this is a multiple of p when p is prime; therefore f (3)is divisible by


p, therefore f (4) is divisible by p, and so on; thus the proposition is true
universally.

Example 5
Prove that 52n+2 − 24n − 25 is divisible by 576.

Solution

Let f (n) = 52n+2 − 24n − 25.

Then f (n + 1) = 52n+4 − 24(n + 1) − 25

= 52 · 52n+2 − 24n − 49.


Wilson’s Theorem 259

Hence
f (n + 1) − 25f (n) = 25(24n + 25) − 24n − 49

= 576 (n + 1).

Therefore if f (n) is divisible by 576, so also is f (n + 1); but by trial we


see that the theorem is true when n = 1, therefore it is true when n = 2,
therefore it is true when n = 3, and so on; thus it is true for any natural
number n.

Aliter The above result may also be proved as follows:

52n+2 − 24n − 25 = 25n+1 − 24n − 25

= 25(1 + 24)n − 24n − 25

= 25 + 25 · n · 24 + multiple of (242 ) − 24n − 25

= 576n + multiple of(576)

= multiple of(576).

Theorem 2 (Converse of Wilson’s Theorem)

If (n − 1)! ≡ −1(modn), then n is a prime.

Proof
Assume that(n − 1)! ≡ −1(modn).

If n is not a prime, then n has a divisor d with1 < d < n. Because


d ≤ n − 1, d occurs as one of the factors in (n − 1)!. Hence

d|(n − 1)!. . . . (1)


260 Wilson’s Theorem

By our assumption n|(n − 1)! + 1. Hence

d|(n − 1)! + 1... (18.1)

Combining the observations (??) and ??, we obtain

d| [(n − 1)! + 1 − (n − 1)!] ,

so that d|1,

which is impossible as 1 < d. Hence n is prime.

Combining the above two theorems, we obtain

Theorem 3
An integer n > 1 is prime if and only if (n − 1)! ≡ −1(modn)

Exercises

1. Find the remainder when 15! is divided by 17.

2. Find the remainder when 2(26!) is divided by 29.

3. Determine whether 17 is a prime by deciding whether 16! ≡ −1 (mod 17).

4. Arrange the integers 2, 3, 4, . . . , 21 in pairs a and b that satisfy


ab ≡ 1 (mod 23).

5. Show that 18! ≡ −1 (mod 437).

6. Prove that an integer n > 1 is prime if and only (n − 2)! ≡ 1(mod n).

7. If n is a composite integer, show that

(n − 1)! ≡ 0 (mod n),except when n = 4.


Wilson’s Theorem 261

8. Given a prime number p,establish the congruence

(p − 1)! ≡ p − 1 (mod 1 + 2 + 3 + · · · + (p − 1)).

9. If p is a prime, prove that for any integer a,

p|ap + (p − 1)!a and p|(p − 1)!ap + a

10. Find two odd primes p ≤ 13for which the congruence (p − 1)! ≡
−1 (mod p2 )holds.

11. Using Wilson’s theorem, prove that for any odd prime p,

12 · 32 · 52 · · · (p − 2)2 ≡ (−1)(p+1)/2 (modp).

12. Show that if p = 4k + 3 is prime and a2 + b2 ≡ 0 (modp), then


a ≡ b ≡ 0(mod p).

13. Supply any missing details in the following proof of the irrationality
√ √
of 2: Suppose 2 = ab , with gcd(a, b) = 1. Then a2 = 2b2 , so that
a2 + b2 = 3b2 . But 3|(a2 + b2 ) implies that 3|a and 3|b, a contradiction.

14. Prove that the odd prime divisors of the integer n2 + 1 are of the
form4k + 1.

15. Verify that 4(29!) + 5! is divisible by 31

16. For a prime p and 0 ≤ k ≤ p − 1, show that k!(p − k − 1)! ≡


(−1)k+1 (modp).

17. If p and q are distinct primes, prove that for any integer a,

pq|apq − ap − aq + a.
262 Wilson’s Theorem

18. Prove that if p andp + 2 are pair of twin primes, then

4((p − 1)! + 1) + p ≡ 0 (modp(p + 2)).


Chapter 19
Fermat’s Little Theorem

Theorem 1 (Fermat’s Little Theorem)


Let p be a prime and suppose that p doesn’t divide a. Then ap−1 ≡
1(mod p).

Proof
The first p − 1 positive multiples of a are the integers

a, 2a, 3a, . . . , (p − 1)a.

None of these numbers is congruent modulo p to any other, nor is any


congruent to zero. Indeed, if it happened that

ra ≡ sa(mod p)1 ≤ r < s ≤ p − 1

then a could be cancelled to give r ≡ s(mod p), which is impossible.


Therefore, the previous set of integers must be congruent modulo p to

263
264 Fermat’s Little Theorem

1, 2, 3, . . . p − 1, taken in some order. Multiplying all these congruences


together, we find that

a · 2a · 3a · · · (p − 1)a ≡ 1 · 2 · 3 · · · (p − 1)(mod p).

Hence
ap−1 (p − 1)! ≡ (p − 1)!(mod p)

Once (p − 1)! is cancelled from both sides of the preceding congruence


(this is possible because since p doesn’t divide (p − 1)!), we have

ap−1 ≡ 1(mod p).

This completes the proof.

Example 1
Find the remainder obtained when 538 is divided by 11.

Solution
538 = 510·3+8 = (510 )3 (52 )4

≡ 13 · 34 (mod 11), since 11 is a prime, 11 6 |5, 510 ≡ 1(mod 11) and


25 ≡ 3 (mod 11)
≡ 81 ≡ 4 (mod 11)

Hence the remainder obtained when 538 is divided by 11 is 4.

Example 2
2p−1 −1
Find the primes p for which p is a square.

Solution
2p−1 −1
Suppose p = n2 for some positive integer n. Then 2p−1 − 1 = pn2 .
Clearly, both p and n must be odd. Let p = 2k + 1 for some positive
Fermat’s Little Theorem 265

integer k. Then 22k − 1 = pn2 ; that is, (2k − 1)(2k + 1) = pn2 . Since
2k − 1 and 2k + 1 are consecutive odd integers, they are relatively prime.
Consequently, either 2k − 1 or 2k + 1 must be a perfect square.

Suppose 2k − 1 is a perfect square r2 :

2k − 1 = r2

2k = r2 + 1

That is,
2p−1 = (r2 + 1)2

Since r ≥ 1 and is odd, r = 2i + 1 for some integer ≥ 0. Then 2k =


(2i + 1)2 = 2(2i2 + 2i + 1); this is possible if and only if i = 0. Then
r = 1, so 2p−1 = (12 + 1)2 = 4, and hence p = 3.

Suppose 2k + 1 is a perfect square s2 :

2k + 1 = s2

2k = s2 − 1

That is,
2p−1 = (s − 1)2 (s + 1)2

Since s ≥ 3 and is odd, s = 2i+1 for some i ≥ 1. Then 2k = (2i+1)2 −1 =


4i(i + 1); that is, 2k−2 = i(i + 1). This is possible if and only if i = 1.
Then s = 3 and hence 2p−1 = 22 · 42 = 26 ; so p = 7.

Thus, p must be 3 or 7 .

Fermat’s Theorem can be stated in a slightly more general way, as in


the following corollary, in which the requirement that p doesn’t divide a
266 Fermat’s Little Theorem

is dropped.

Corollary 1
If p is a prime, then ap ≡ a(mod p) for any integer a.

Proof
When p|a, the statement obviously holds; for, in this setting, ap ≡ 0 ≡
a(mod p).

If p 6 |a, then according to Fermat’s theorem, we have ap−1 ≡ 1(mod p).


When this congruence is multiplied by a, the conclusion ap ≡ a(mod p)
follows.

Remark
If it could be shown that the congruence

an ≡ a(mod n)

fails to hold for some choice of a, then n is necessarily composite. The


following example illustrates this fact.

Example 3
Take n = 117, a = 2.

Because 2117 may be written as

2117 = 27·16+5 = (27 )16 25

and 27 = 128 ≡ 11(mod 117),

we have

2117 ≡ 1116 · 25 ≡ (121)8 25 ≡ 48 · 25 ≡ 221 (mod 17).


Fermat’s Little Theorem 267

But 221 = (27 )3 , which leads to

221 ≡ 113 ≡ 121 · 11 ≡ 4 · 11 ≡ 44 (mod 117)

Combining these congruences, we finally obtain

2117 ≡ 44/≡ 2 (mod 117)

so that 117 must be composite; actually, 117 = 13 · 9.

Example 4
Show that n7 − n is divisible by 42.

Solution

Since 7 is a prime, by corollary to Fermat’s theorem, we have

n7 ≡ n(mod7).

That is, n7 − n ≡ 0(mod7).

That is, n7 − n is divisible by 7.

Also
n7 − n = n(n6 − 1) = n(n + 1)(n − 1) (n4 + n2 + 1).

Now (n − 1)n (n + 1) is divisible by 3, and n (n + 1) is divisible by 2.


Combing these with n7 − n is divisible by 7, we have n7 − n is divisible
by 6 × 7 =42.

Example 5
Compute the remainder of 8103 when divided by 13.
268 Fermat’s Little Theorem

Solution

We have

8103 = (812 )8 (87 ) ≡ (18 )( 87 ), Using Fermat’s theorem,

≡ 87 ≡ (−5)7 , as 8 = 13 − 5
3
≡ (−52 ) (−5) ≡ (−1)3 (−5), as 25 = 26 − 1

≡ 5 (mod 13).

Example 6
Show that 211213 − 1 is not divisible by 11.

Solution

By Fermat’s theorem,

210 ≡ 1 (mod 11),

so 211213 − 1 ≡ [(210 ) 1121


.23 ] − 1 ≡ [1 1121
.23 ] − 1 ≡ 23 − 1

≡ 8 − 1 ≡ 7 (mod 11).

Thus the remainder of 211213 − 1 when divided by 11 is 7, not 0.


Hence 211213 − 1 is not divisible by 11.

Theorem 2
Let p be a prime and a any integer such that p 6 |a. Then ap−2 is an
inverse of a modulo p.

Proof
By Fermat’s little theorem, ap−1 ≡ 1(mod p). That is, aap−2 ≡ 1(mod p),
so ap−2 is an inverse of a modulo p.

Theorem 3
Let p be a prime and a any integer such that p 6 |a. Then the solution
Fermat’s Little Theorem 269

of the linear congruence ax ≡ b(mod p) is given by x ≡ ap−2 b(mod p).

Proof
Since p 6 |a, the congruence ax ≡ b(mod p) has a unique solution. Since,
by theorem 2 ap−2 is an inverse of a modulo p, multiplying both sides
of the congruence by ap−2 , we have

ap−2 (ax) ≡ ap−2 b(mod p)


ap−1 x ≡ ap−2 b(mod p)

x ≡ ap−2 b(mod p),

by Fermat’s little theorem.

The following example employs this theorem.

Example 7
Solve the linear congruence (12x) ≡ 6(mod 7).

Solution

Let p = 7 and a = 12. Then, by theorem 2, 125 is an inverse of 12


modulo 7. Since 12 ≡ −2 (mod 7),

125 ≡ (−2)5 ≡ −22 · 23 ≡ −4 · 1 ≡ 3(mod 7). Thus, 3 is an inverse of 12


modulo 7. Multiply both sides of the congruence by 3:

3(12x) ≡ 3 · 6(mod 7)

x ≡ 4(mod 7).

Example 8
Show that for any integer n, the number n 33 − n is divisible by 15.

Solution
270 Fermat’s Little Theorem

It means 15 divides 233 − 2, 333 − 3, 433 − 4, etc.

Now 15 = 3.5, and we shall use Fermat’s theorem to show that n33 − n
is divisible by both 3 and 5 for every n. Note that n33 − n = n(n32 − n).

If 3 divides n, then surely 3 divides n(n32 − n). If 3 does not divide


n, then by Fermat’s theorem (withp = 3),

n2 ≡ 1(mod3),

so n32 − 1 ≡ (n2 )16 − 1 ≡ 116 − 1 ≡ 0(mod3)

and hence 3 divides n32 − 1.

If n ≡ 0(mod5), then (by corollary to Fermat’s theorem with p = 5),

n33 − n ≡ 0(mod5)

If n 6≡ 0 (mod5), then by Fermat’s theorem

n4 ≡ 1(mod5)

so n32 − 1 ≡ (n4 )8 − 1 ≡ 18 − 1 ≡ 0(mod5)

Thus n33 − n ≡ 0(mod5) for every n also.

This completes the proof.

Example 9
Show that 6 is the integral root of x7 + x + 2 ≡ 0(mod7).

Solution

By Fermat’s little theorem, we have 67 ≡ 6(mod7) implies

67 + 6 + 2 = 6 + 6 + 2 ≡ 0(mod7)
Fermat’s Little Theorem 271

implies 6 is a root of the given congruence.

Example 10
If p is a prime number, show that the difference of the p th powers of any
two numbers exceeds the difference of the numbers by a multiple of p.

Solution

Let x, y be the numbers; then, by Corollary,

xp − x ≡ 0(modp) and y p − y ≡ 0(modp).

Hence xp − y p − (x − y) ≡ 0(modp).;

That is, the required result is obtained.

Example 11
Prove that every square number is of the form 5n or 5n ± 1.

Solution

If N is not prime to 5, we have N 2 = 5n where n is some positive


integer. If N is prime to 5 then N 4 − 1 is a multiple of 5 by Fermat’s
theorem; thus either N 2 − 1 or N 2 + 1 is a multiple of 5; that is, N 2 =
5n ± 1.

Lemma
If p and q are distinct primes with ap ≡ a(mod q)and aq ≡ a(mod p),
then apq ≡ a(mod pq).

Proof
By the Corollary,
(aq )p ≡ aq (mod p),

whereas (aq ) ≡ a (mod p) holds by hypothesis. Combining these congru-


272 Fermat’s Little Theorem

ences, we obtain
apq ≡ a (mod p)

or, equivalently,
p|apq − a.

In an entirely similar manner,

q|apq − a.

Hence pq|apq − a.

This is equivalent to
apq ≡ a(mod pq).

Theorem 4
Let p1 , p2 , ..., pk be any distinct primes, a any positive integer, and l =
[p1 − 1, p2 − 1, ..., pk − 1]. Then al+1 ≡ a(modp1 p2 ...pk ).

Proof
By Fermat’s little theorem, api −1 ≡ 1(modpi ), where 1 ≤ i ≤ k. Since
pi − 1|l, this implies (api −1 )l/pi −1 ≡ 1(modpi ); that is, al ≡ 1(mod pi ).
Thus, al+1 ≡ a(mod pi ). Consequently, al+1 ≡ a(mod [p1 , p2 , ..., pk ]);
that is, al+1 ≡ a(modp1 p2 ...pk ).

Corollary 2
Let a be any integer and p any prime > 3. Then ap ≡ a(mod 6p).

Proof
Let p1 = 2, p2 = 3, p3 = p in theorem 4. Since 2 · 3 · p = 6p and
[p1 − 1, p2 − 1, p3 − 1] = [1, 2, p − 1] = p − 1, the result follows by the
theorem.

We now observe that the converse of Fermat’s theorem doesn’t hold.


Fermat’s Little Theorem 273

i.e., if an−1 ≡ 1 (mod n) for some integer a, then n need not be prime.
The following example illustrates this.

Example 12 Verify that 2340 ≡ 1(mod 341), but 341 is not a prime.

Solution

341 is not a prime, since 341 = 11 · 31

Now 210 = 1024 = 31 · 33 + 1.

Thus 211 = 2 · 210 ≡ 2 · 1 ≡ 2(mod31)

and 231 = 2 · (210 )3 ≡ 2 · 13 ≡ 2(mod11)

Using the above Lemma,

211·31 ≡ 2(mod11 · 31).

or 2341 ≡ 2 (mod 341)

Cancelling a factor of 2, we obtain

2340 ≡ 1(mod 341).

Exercises

1. Use Fermat’s theorem to verify that 17 divides 11104 + 1.

2. (a) If gcd(a, 35) = 1, show that a12 ≡ 1(mod 35).

(b) If gcd(a, 42) = 1, show that 168 = 3 · 7 · 8 divides a6 − 1.

(c) If gcd(a, 133) = gcd(b, 133) = 1, show that 133|a18 − b18 .

(d) Prove that n5 − n ≡ 0(modp).

(e) Using Fermat’s theorem, find the remainder of 347 when divided
274 Fermat’s Little Theorem

by 23.

3. From Fermat’s theorem deduce that, for any integer n ≥ 0, 13|1112n+6 +


1.

4. Derive each of the following congruences:

(a) a21 ≡ a (mod 15)for all a.

(b) a7 ≡ a (mod 42)for all a.

(c) a13 ≡ a(mod 3 · 7 · 13)for all a.

(d) a9 ≡ a(mod30)for all a.

5. If gcd(a, 30) = 1,show that 60 divides a4 + 59.

6. (a) Find the units digit of 3100 by the use of Fermat’s theorem.

(b) For any integer a, verify that a5 and a have the same units digit.

7. If 7 doesn’t divide a, prove that either a3 + 1or a3 − 1 is divisible by


7.

8. Prove that
18351910 + 19862061 ≡ 0(mod 7).

(Note: The above numbers have the following peculiarity: The three
most recent appearances of Halley’s Comet were in the years 1835, 1910,
and 1986; the next occurrence will be in 2061.)

9. (a) Let p be a prime and gcd(a, p) = 1. Use Fermat’s theorem to


verify that x ≡ ap−2 b (mod p) is a solution of the linear congruence
ax ≡ b (mod p).

(b) By applying part (a), solve the congruences 2x ≡ 1(mod 31),


6x ≡ 5(mod 11), and 3x ≡ 17 (mod 29).
Fermat’s Little Theorem 275

10. Assuming that a and b are integers not divisible by the prime p,
establish the following:

(a) If ap ≡ bp (mod p),thena ≡ b (mod p).

(b) If ap ≡ bp (mod p),then ap ≡ bp (mod p2 ).

11. Employ Fermat’s theorem to prove that, if p is an odd prime then

(a) 1p−1 + 2p−1 + 3p−1 + · · · + (p − 1)p−1 ≡ −1(mod p).

(b) 1p + 2p + 3p + · · · + (p − 1)p ≡ 0 (mod p).

! integer satisfying1 ≤ k ≤
12. Prove that if p is an odd prime and k is an
p−1
p − 1, then the binomial coefficient ≡ (−1)k (mod p).
k
13. Assume that p and q are distinct odd primes such thatp − 1|q − 1.If
gcd(a, pq) = 1,show that aq−1 ≡ 1 (mod pq).

14. If p and q are distinct primes, prove that

pq−1 + q p−1 ≡ 1 (mod pq).


Chapter 20
Euler’s Theorem

Euler phi-function

For n ≥ 1, let φ(n) denote the number of positive integers not exceeding
n that are relatively prime to n.

Example 1
φ(30) = 8; for, among the positive integers that do not exceed 30, there
are eight that are relatively prime to 30; specifically,

1, 7, 11, 13, 17, 19, 23, 29.

Example 2
φ(1) = 1, φ(2) = 1, φ(3) = 2,

φ(4) = 2, φ(5) = 4, and so on.

Notice that φ(1) = 1, because gcd(1, 1) = 1. In the event n > 1, then


gcd(n, n) = n 6= 1, so that φ(n) can be characterized by the following

276
Euler’s Theorem 277

definition.

Definition
φ(n) is the number of integers less than n and relatively prime to it. The
function φ is called Euler phi-function.

Result
φ(n) = n − 1 if and only if n is prime.

Proof
If n is a prime number, then every integer less than n is relatively prime
to it. Hence φ(n) = n − 1.

Conversely, if n > 1 is composite, then n has a divisor d such that 1 <


d < n. It follows that there are at least two integers among 1, 2, 3, . . . , n
that are not relatively prime to n, namely, d and n itself. As a result,
φ(n) ≤ n − 2. That is, φ(n) 6= n − 1. Hence, considering contrapositive,
we have φ(n) = n − 1 implies n is prime.

This completes the proof.

Lemma
Given integers a, b, c, gcd(a, bc) = 1 if and only if gcd(a, b) = 1 and
gcd(a, c) = 1.

Proof
First suppose that gcd(a, bc) = 1, and put d = gcd(a, b). Then d|a
and d|b, and hence d|a and d|bc. This implies that gcd(a, bc) ≥ d, which
forces d = 1. Similar reasoning leads to the statement gcd(a, c) = 1.

For the other direction, take gcd(a, b) = 1 = gcd(a, c) and assume


that gcd(a, bc) = d1 > 1. Then d1 must have a prime divisor p. Because
d1 |bc, it follows that p|bc; consequence, p|b or p|c. If p|b then (by virtue of
278 Euler’s Theorem

the fact that p|a) we have gcd(a, b) ≥ p, contradiction. In the same way,
the condition p|c leads to the equally false conclusion that gcd(a, c) ≥ p.
Thus, d1 = 1 and the lemma is proven.

φ(1) = 1 and φ(2) = 1 are not even integers, however, the next theorem
ensures that for n > 2, φ(n) is an even integer.

Theorem 1
For n > 2, φ(n) is an even integer.

Proof
First, assume that n is a power of 2, let us say that n = 2k , with k ≥ 2.
 
1
φ(n) = φ(2k ) = 2k 1 − = 2k−1
2

an even integer. If n does not happen to be a power of 2, then it is


divisible by an odd prime p; we therefore may write n as n = pk m,
where k ≥ 1 and gcd(pk , m) = 1. Using the multiplicative nature of the
phi-function, we obtain

φ(n) = φ(pk )φ(m) = pk−1 (p − 1)φ(m)

which again is even because 2|p − 1.

Lemma
Let m be a positive integer and a any integer with gcd(a,m)=1. Let
r1 , r2 , ..., rφ(m) be the positive integers ≤ m and relatively prime to m.
Then the least residues of the integers ar1 , ar2 , ..., arφ(m) modulo m are
a permutation of the integers r1 , r2 , ..., rφ(m) .

Proof
The proof consists of two parts. First we will show that gcd(ari , m) = 1
for every i. Then we will show that no two numbers ari and arj can be
Euler’s Theorem 279

congruent modulo m if i 6= j, where 1 ≤ i < j ≤ φ(m).

To show that each ari is relatively prime to m:

Suppose gcd(ari , m) > 1. Let p be a prime factor gcd(ari , m). Then


p|ari and p|m. Since p|ari , p|a or p|ri . If p|ri , then p|ri and p|m, so
gcd(ri , m) 6= 1, a contradiction. So p|a. This coupled with p|m implies
p| gcd(a, m), again a contradiction. Thus, gcd(ari , m) = 1; that is, the
integers ar1 , ar2 , ..., arφ(m) are relatively prime to m.

To show that no two of the integers ari can be congruent modulo m; that
is,ari /≡ arj , where 1 ≤ i < j ≤ φ(m):

Suppose ari ≡ arj (mod m). Since gcd(a, m) = 1, ri ≡ rj (mod m). But
ri and rj are least residues modulo m, so ri = rj . Thus, if i 6= j, then
ari /≡ arj (mod m).

Thus, the least residues of ar1 , ar2 , ..., arφ(m) modulo m are distinct and
are φ(m) in number. So they are a permutation of the least residues
r1 , r2 , ..., rφ(m) modulo m.

Theorem 2 (Euler’s Theorem)

If n ≥ 1 and gcd(a, n) = 1,then aφ(n) ≡ 1(mod n).

Proof
There is no harm in taking n > 1. Let a1 , a2 , . . . , aφ(n) be the positive
integers less than n that are relatively prime ton. Because gcd(a, n) = 1,
it follows from the lemma that aa1 , a a2 , . . . , aaφ(n) are congruent, not
necessarily in order of appearance, to a1 , a2 , . . . , aφ(n) . Then

aa1 ≡ a01 (mod n)

aa2 ≡ a02 (mod n)


280 Euler’s Theorem

....
..

aaφ(n) ≡ a0φ(n) (mod n)

where a01 , a02 , . . . , a0φ(n) are the integers a1 , a2 , . . . , aφ(n) in some order.
On taking the product of these φ(n) congruences, we get

(aa1 )(aa2 ) · · · (aaφ(n) ) ≡ a01 a02 . . . a0φ(n) (modn)

≡ a1 a2 . . . aφ(n) (modn)

and so
n = 17, 32, 34, 40, 48 and 60

Because gcd(ai , n) = 1 for each i, Lemma 1 implies that

gcd(a1 a2 . . . aφ(n) , n) = 1.

Therefore, we may divide both sides of the foregoing congruence by the


common factor a1 a2 . . . aφ(n) , and obtain

aφ(n) ≡ 1(modn).

Corollary 1 (Fermat’s Little Theorem)


If p is a prime and p 6 |a,then ap−1 ≡ 1(modp).

Proof
If p is a prime, then φ(p) = p − 1. Hence Theorem 1 with n = p gives

ap−1 ≡ 1(modp).

Example 3
Euler’s Theorem 281

Find the last two digits in the decimal representation of 3256 .

Solution

It is equivalent to obtaining the smallest nonnegative integer to which


256
3 is congruent modulo 100. Because gcd(3, 100) = 1and
  
1 1
φ(100) = φ(22 · 52 ) = 100 1 − 1− = 40.
2 5

Using Euler’s Generalization Theorem 1,

3φ(100) ≡ 1(mod100)

and hence we obtain


340 ≡ 1(mod 100)

By the Division Algorithm, taking a = 256, b = 40,

256 = 6 · 40 + 16.

Hence
3256 ≡ 36·40+16 ≡ (340 )6 316 ≡ 316 (mod 100)

and our problem reduces to one of evaluating 316 , modulo 100. The
method of successive squaring yields the congruences

32 ≡ 9 (mod100), 38 ≡ 61(mod100)

34 ≡ 81 (mod100) and 316 ≡ 21 (mod100)

Hence the last two digits of the given number is 21.

The following proof of Euler’s Theorem requires the use of Fermat’s


282 Euler’s Theorem

Theorem.

Example 4
Find all solutions of the congruence 12x ≡ 27(mod18).

Solution

The gcd of 12 and 18 is 6, and 6 is not a divisor of 27. Thus by the


preceding corollary, there are no solutions.

Example 5
Find all solutions of the congruence 15x ≡ 27(mod18).

Solution

The gcd of 15 and 18 is 3, and 3 does divide 27. We divide everything


by 3 and consider the congruence 5x ≡ 9(mod6), which amounts to
solving the equation 5x ≡ 3 in Z6 . Now, being relatively prime to 6,
the units in Z6 are 1 and 5, and 5 is clearly its own inverse in this
group of units. Thus the solution in Z6 is s = (5−1 )(3) = (5)(3) = 3.
Consequently, the solutions of 15x ≡ 27(mod18) are the integers in the
residue classes 3 + 18Z = {· · · , −33, −15, 3, 21, 39, · · · } ,

9 + 18Z = {· · · , −27, −9, 9, 27, 45, · · · } ,

15 + 18Z = {· · · , −21, −3, 15, 33, 51, · · · } .

Theorerm 3
Let m be a positive integer and a any integer with gcd(a,m)=1. Then
aφ(m)−1 is an inverse of a modulo m.

Theorerm 4
Let m be a positive integer and a any integer with gcd(a,m)=1. Then
Euler’s Theorem 283

the solution of the linear congruence ax ≡ b(mod m) is given by x ≡


aφ(m)−1 b(mod m).

Theorem 5 (Koshy)
Let m1 , m2 , ..., mk be any positive integers and a any integer such that
gcd(a, mi ) = 1 for 1 ≤ i ≤ k. Then

a[φ(m1 ),φ(m2 ),...,φ(mk )] ≡ 1(mod [m1 , m2 , ..., mk ])

Corollary 2
Let m1 , m2 , ..., mk be pairwise relatively prime integers and a any integer
such that gcd(a, mi ) = 1 for 1 ≤ i ≤ k. Then

a[φ(m1 ),φ(m2 ),...,φ(mk )] ≡ 1(mod m1 m2 · · · mk ).

Exercises

1. Calculate φ(1001), φ(5040), and φ(36, 000).

2. Verify that the equality φ(n) = φ(n + 1) = φ(n + 2) holds when


n = 5186.

3. Establish each of the assertions below:

(a) If n is an odd integer, then φ(2n) = φ(n).

(b) If n is an even integer, then φ(2n) = 2φ(n).

(c) φ(3n) = 3φ(n) if and only if 3|n.

(d) φ(3n) = 2φ(n) if and only if 3 6 |n.


n
(e) φ(n) = 2 if and only if n = 2k for some k ≥ 1.

4. Prove that the equation φ(n) = φ(n + 2) is satisfied by n = 2(2p − 1)


whenever p and 2p − 1 are both odd primes.
284 Euler’s Theorem

5. Show that there are infinitely many integers n for which φ(n) is a
perfect square.

6. Verify the following:


1√
(a) For any positive integer n, 2 n ≤ φ(n) ≤ n.

(b) If the integer n > 1 has r distinct prime factors, then φ(n) ≥ n/2r .

(c) If n > 1 is a composite number, then φ(n) ≤ n − n.

7. Prove that if the integer n has r distinct odd prime factors, then
2r |φ(n).

8. Prove the following:

(a) If n and n + 2 are a pair of twin primes, then φ(n + 2) = φ(n) + 2;


this also holds for n = 12, 14, and 20.

(b) If p and 2p + 1 are both odd primes, then n = 4p satisfies φ(n +


2) = φ(n) + 2. Verify the same for n = 12, 14, and 20.

9. If every prime that divides n also divides m, establish that φ(nm) =


nφ(m); in particular, φ(n2 ) = nφ(n) for every positive integer n.

(a) If φ(n)|n − 1, prove that n is a square-free integer.

(b) Show that if n = 2k or 2k 3j , with k and j positive integers, then


φ(n)|n.

10. Assuming that d|n, prove that φ(d)|φ(n)

11. Prove the following:


n
(a) There are infinitely many integers n for which φ(n) = 3.

n
(b) There are no integers n for which φ(n) = 4.

12. Given a positive integer k, show the following:


Euler’s Theorem 285

(a) There are at most a finite number of integers n for which φ(n) = k.

(b) If the equation φ(n) = k has a unique solution, say n = n0 , then


4|n0 .

13. Find all solutions of φ(n) = 16 and φ(n) = 24.

14. (a) Prove that the equation φ(n) = 2p, where p is a prime number
and 2p + 1 is composite is not solvable.

(b) Prove that there is no solution to the equation φ(n) = 14, and that
14 is the smallest (positive) even integer with this property.

15. If p is a prime and k ≥ 2, show that φ(φ(pk )) = pk−2 φ((p − 1)2 ).

16. Verify 1 + 9 + 92 + · · · + 923 ≡ 0(mod 35)

17. Prove or disprove φ((a, b)) = (φ(a), φ(b)).

18. If a and b are relatively prime, then prove that aφ(b) + bφ(a) ≡
1(mod ab)

19. Let a and m be positive integers such that

gcd(a, m) = 1 = gcd(a − 1, m).

Then prove that 1 + a + a2 + · · · + aφ(m)−1 ≡ 0(modm).

20. Compute φ(pn ) for the given values of p and n.

(a) p = 2 , n = 3 (b) p = 3, n = 3

_______________________________________________________________
SYLLABUS
SEMESTER – I
MTS1B01 : BASIC LOGIC AND NUMBER THEORY
4 Hours/Week 4 Credits 100 Marks[Int: 20 + Ext : 80]

Aims, Objectives and Outcomes

Logic, the study of principles of techniques and reasoning, is fundamental to every branch of
learning. Besides, being the basis of all mathematical reasoning, it is required in the field of computer
science for developing programming languages and also to check the correctness of the programmes.
Electronic engineers apply logic in the design of computer chips. The first module discusses the
fundamentals of logic, its symbols and rules. This enables one to think systematically, to express ideas
in precise and concise mathematical terms and also to make valid arguments. How to use logic to arrive
at the correct conclusion in the midst of confusing and contradictory statements is also illustrated.
The classical number theory is introduced and some of the very fundamental results are discussed
in other modules. It is hoped that the method of writing a formal proof, using proof methods discussed
in the first module, is best taught in a concrete setting, rather than as an abstract exercise in logic.
Number theory, unlike other topics such as geometry and analysis, doesn’t suffer from too much
abstraction and the consequent difficulty in conceptual understanding. Hence, it is an ideal topic for
a beginner to illustrate how mathematicians do their normal business. By the end of the course, the
students will be able to enjoy and master several techniques of problem solving such as recursion,
induction etc., the importance of pattern recognition in mathematics, the art of conjecturing and a
few applications of number theory. Enthusiastic students will have acquired knowledge to read and
enjoy on their own a few applications of number theory in the field of art, geometry and coding theory.
Successful completion of the course enables students to

• Prove results involving divisibility, greatest common divisor, least common multiple and a few
applications.

• Understand the theory and method of solutions of LDE.

• Solve linear congruent equations.

• Learn three classical theorems viz. Wilson’s theorem, Fermat’s little theorem and Euler’s theo-
rem and a few important consequences.
Syllabus

Text (1) Discrete Mathematics with Applications : Thomas Koshy, Elsever Academic
Press(2004) ISBN:0-12-421180-1
Text (2) Elementary Number Theory with Applications (2/e) : Thomas Koshy, Elsever Aca-
demic Press(2007) ISBN:978-0-12-372487-8

Module – I Text (1) (15 hrs)

1.1: Propositions- definition, Boolean (logic) variables, Truth Value, Conjunction, Boolean expression,
Disjunction (inclusive and exclusive), Negation, Implication, Converse, Inverse and Contra positive,
Biconditional statement, Order of Precedence, Tautology Contradiction and Contingency [‘Switching
Networks’ omitted]
1.2 : Logical equivalences- laws of logic [‘Equivalent Switching Networks’ ‘Fuzzy logic’ & ‘Fuzzy
decisions’omitted]
1.3 : Quantifiers- universal & existential, predicate logic
1.4 : Arguments- valid and invalid arguments, inference rules
1.5: Proof Methods – vacuous proof, trivial proof, direct proof, indirect proof-contrapositive & con-
tradiction, proof by cases, Existence proof- constructive & non constructive, counter example

Module – II Text (2) (12 hrs)

1.3 : Mathematical induction- well ordering principle, simple applications, weak version of principle of
mathematical induction, illustrations, strong version of induction (second principle of MI), illustration
1.4 : Recursion- recursive definition of a function, illustrations.
2.1: The division algorithm – statement and proof, div & mod operator, card dealing, The two
queens puzzle (simple applications), pigeonhole principle and division algorithm, divisibility relation,
illustration, divisibility properties, union intersection and complement-inclusion exclusion principle &
applications, even and odd integers.
2.5: Prime and Composite Numbers- definitions, infinitude of primes, [‘algorithm 2.4‘ omitted] The
sieve of Eratosthenes, a number theoretic function, prime number theorem (statement only), distri-
bution of primes (upto and including Example 2.25). [rest of the section omitted]
Module – III Text (2) (17 hrs)

3.1 : Greatest Common Divisor- gcd, symbolic definition, relatively prime integers, Duncan’s identity,
Polya’s theorem, infinitude of primes, properties of gcd, linear combination, gcd as linear combination,
an alternate definition of gcd, gcd of n positive integers, a linear combination of n positive integers,
pairwise relatively prime integers, alternate proof for infinitude of prime.
3.2: The Euclidean Algorithm- The Euclidean algorithm [algorithm 3.1 omitted], A jigsaw puzzle,
Lame’s theorem (statement only; proof omitted)
3.3: The Fundamental Theorem of Arithmetic- Euclid’s lemma on division of product by a prime,
fundamental theorem of arithmetic, Canonical Decomposition, number of trailing zeros, highest power
of a prime dividing!, [only statement of Theorem 3.14 required; proof omitted] Distribution of Primes
Revisited, Dirichlet’s Theorem (statement only)
3.4 : Least Common Multiple- definition, canonical decomposition to find lcm, relationship between
gcd and lcm, relatively prime numbers and their lcm
3.5: Linear Diophantine Equations – LDE in two variables, conditions to have a solution, Aryabhatta’s
method, number of solutions, general solution, Mahavira’s puzzle, hundred fowls puzzle, Monkey and
Coconuts Puzzle, [‘Euler’s method for solving LDE’s omitted] Fibonacci numbers and LDE, LDE in
more number of variables and their solutions- Theorem 3.20

Module – IV Text (2) (20 hrs)

4.1: Congruences - congruence modulo m, properties of congruence, characterization of congruence,


least residue, [‘Friday-the-Thirteenth’ omitted], congruence classes, A Complete Set of Residues Mod-
ulo m, properties of congruence, use of congruence to find the remainder on division, [‘Modular
Exponentiation’ method omitted], Towers of Powers Modulo m, further properties of congruence and
their application to find remainder [‘Monkey and Coconut Puzzle revisited’(example 4.17) omitted]
congruences of two numbers with different moduli
4.2: Linear Congruence- solvability, uniqueness of solution, incongruent solutions, Modular Inverses,
applications
5.1: Divisibility Tests-Divisibility Test for 10, Divisibility Test for 5, Divisibility Test for 2i , Divisibility
Tests for 3 and 9, Divisibility Test for 11 [ rest of the section from Theorem 5.1 onwards omitted]
7.1: Wilson’s Theorem- self invertible modulo prime, Wilson’s theorem and its converse [‘Factorial,
Multifactorial and Primorial Primes’ omitted]
7.2: Fermat’s Little Theorem(FLT)- FLT and its applications, [Lagrange’s alternate proof of Wilson’s
theorem omitted], inverse of a modulo p using FLT, application-solution of linear congruences [ ‘Factors
of 2n +1‘ omitted], extension of FLT in various directions [‘The Pollard p−1 factoring method’ omitted]
7.4 : Euler’s Theorem- motivation, Euler’s Phi Function φ, Euler’s Theorem, applications, generalisa-
tion of Euler’s theorem (koshy)
References:

1. Susanna S Epp: Discrete Mathematics with Applications(4/e) Brooks/ Cole Cengage Learn-
ing(2011) ISBN: 978-0-495-39132-6

2. Kenneth H. Rosen: Discrete Mathematics and Its Applications(7/e) McGraw-Hill, NY (2007)


ISBN: 978-0-07-338309-5

3. David M. Burton : Elementary Number Theory(7/e) McGraw-Hill (2011) ISBN: 978-0- 07-
338314-9

4. Gareth A. Jones and J. Mary Jones: Elementary Number Theory, Springer Undergraduate
Mathematics Series(1998) ISBN: 978-3-540-76197-6

5. Underwood Dudley : Elementary Number Theory(2/e), Dover Publications (2008) ISBN : 978-
0-486-46931-7

6. James K Strayer : Elementary Number Theory, Waveland Press, inc. (1994), ISBN : 978-1-
57766-224-2

7. Kenneth H. Rosen: Elementary Number Theory(6/e), Pearson Education (2018), ISBN: 978-0-
13-43100-531-1

You might also like