Download as pdf or txt
Download as pdf or txt
You are on page 1of 91

P U P

Instructional Materials in
MATH 20133
Elementary Number Theory

compiled by

DMS Faculty

College of Science
Polytechnic University of the Philippines

2020
For the sole noncommercial use of the
Faculty of the Department of Mathematics and Statistics
Polytechnic University of the Philippines
2020

Contributors:

Abdul, Alsafat M.
Atienza, Jacky Boy E.
Bernardino, Rhea R.
Criseno, Regine Z.
Ferranco, Franny F.
Longhas, Paul Ryan A.
Saguindan, Ian J.
Sta. Maria, John Patrick B.
Urrutia, Jackie D.

2
Republic of the Philippines
POLYTECHNIC UNIVERSITY OF THE PHILIPPINES
COLLEGE OF SCIENCE

Course Title : ELEMENTARY NUMBER THEORY

Course Code : MATH 20133

Course Credit : 3 units

Pre-Requisite : FUNDAMENTAL CONCEPTS OF MATHEMATICS

Course Description : This course covers the properties of integers; divisibility; primes and unique factorization; solutions of congruences and residue systems; linear
Diophantine equations, primitive roots; quadratic reciprocity law

Institutional Learning Outcomes Program Outcomes Course Outcomes


a. Creative and Critical Thinking Demonstrate broad and coherent knowledge and • Prove the First Principle of Finite Induction
understanding in the core areas of physical and natural using the Well-Ordering Principle and
sciences. Archimedean Property.
Apply critical and problem solving skills using the scientific • Prove statements about integers using
method. Mathematical Induction.
Gain mastery in the core areas of mathematics: algebra, • State and prove the Division Algorithm.
analysis and geometry. • Prove theorems related to the divisibility of
Demonstrate skills in pattern recognition, generalization, integers.
abstraction, critical analysis, synthesis, problem solving • Prove and apply the Euclidean Algorithm in
and vigorous argument. obtaining the GCD
Appreciate the usage and role of proof and reasoning and • Establish the relationship between the gcd and
demonstrate knowledge in reading and writing lcm of an integer
mathematical proofs. • Obtain solutions to Linear Diophantine
b. Effective Communication Articulate the latest developments in their specific field of Equations using Euclidean Algorithm
practice.
• Prove and apply the Fundamental Theorem of
Effectively communicate orally and in writing using both
English and Filipino languages. Arithmetic.
Communicate information, ideas, problems and solutions, • Obtain solutions to the Linear Diophantine
both orally and in writing, to other scientists, decision Equations ax+by=c using Euclidean algorithm.
makers and the public.
Appreciate the usage and role of proof and reasoning and • Prove and apply the properties of congruences
demonstrate knowledge in reading and writing (e.g. remainder problems).
mathematical proofs. • State and prove divisibility tests.
Communicate mathematical ideas orally and in writing
using clear and precise language. • Determine solutions, if it exists, to linear and
c. Strong Service Orientation Articulate the latest developments in their specific field of system of linear congruences.
practice. • Prove and apply Wilson’s Theorem and
Work effectively and independently in multi-disciplinary Fermat’s Little Theorem.
and multi-cultural teams. • State and prove the properties of multiplicative
d. Community Engagement Work effectively and independently in multi-disciplinary functions.
and multi-cultural teams. • Prove and apply Euler’s Theorem
Relate science and mathematics to the other disciplines
• Prove and apply the properties of primitive
Critically evaluate input from others.
e. Adeptness in the Responsible Use of Carry out basic mathematical and statistical computations roots.
Technology and use appropriate technologies in the analysis of the • Determine the existence of primitive roots to
data. prime and composite integers.
Commit to the integrity of data. • Determine solutions, if it exists, of certain
f. Passion to Life-Long Learning Articulate the latest developments in their specific field of congruences using the theory of indices.
practice. • Prove Euler’s Criterion and apply in solving
Gain mastery in the core areas of mathematics: algebra, quadratic congruences.
analysis and geometry. • Identify Legendre symbol and prove its
Demonstrate skills in pattern recognition, generalization, properties.
abstraction, critical analysis, synthesis, problem solving • Prove and apply Gauss’ Lemma.
and vigorous argument.
• Prove and apply the Quadratic Reciprocity Law
Develop an enhanced perception of the vitality and
• Encrypt or Decrypt codes using Caesar cipher,
importance of mathematics in the modern world including
Hill’s cipher, and RSA public-key algorithm.
inter-relationships within math and its connection to other
disciplines.
Appreciate the usage and role of proof and reasoning and
demonstrate knowledge in reading and writing
mathematical proofs.
g. High Level of Leadership and Organizational Demonstrate professional, social and ethical
Skills responsibility, especially in practicing intellectual property
rights and sustainable development.
h. Sense of Personal and Professional Ethics Demonstrate professional, social and ethical
responsibility, especially in practicing intellectual property
rights and sustainable development.
Commit to the integrity of data.
i. Sense of Nationalism and Global Develop an enhanced perception of the vitality and
Responsiveness importance of mathematics in the modern world including
inter-relationships within math and its connection to other
disciplines.
Appreciate the usage and role of proof and reasoning and
demonstrate knowledge in reading and writing
mathematical proofs.

COURSE PLAN
Week Topic Learning Outcomes Methodology Resources Assessment
• Prove the First Principle of Finite
Induction using the Well-Ordering
Preliminaries
Principle and Archimedean
• The Number System
Property.
• Review of Principle of • K. H. Rosen. Elementary
• Prove statements about integers
Mathematical Induction and Number Theory and Its
using Mathematical Induction.
Pigeonhole Principle Interactive lecture Applications
• State and prove the Division
Algorithm. • G. Jones and M. Jones.
Divisibility in the Integers Peer teaching Elementary Number
• Prove theorems related to the
Week 1-4 • Division algorithm Theory Quiz 1
divisibility of integers.
• Greatest Common Divisor Work-along exercises • Niven and Zuckermann.
• Prove and apply the Euclidean
• Euclidean algorithm An Introduction to the
Algorithm in obtaining the GCD Problem-based projects
• Relatively prime integers Theory of Numbers
• Establish the relationship • G. H. Hardy and E. M.
and the Least Common
between the gcd and lcm of an Wright. An Introduction to
Multiple
integer the Theory of Numbers
• Linear Diophantine
• Obtain solutions to Linear • C. Vanden Eynden.
Equations ax+by=c
Diophantine Equations using Elementary Number
Euclidean Algorithm Theory
Primes • K. Ireland and M. Rosen.
• Prove and apply the Fundamental
• Fundamental Theorem of Theorem of Arithmetic. A Classical Introduction to
Arithmetic • Obtain solutions to the Linear Modern Number Theory
• Prime distributions and Interactive lecture • Burton. Elementary
Diophantine Equations ax+by=c
the Sieve of Eratosthenes using Euclidean algorithm. Number Theory
Peer teaching • Barnett. Elements of
• Primality Testing and • Prove and apply the properties of
Week 5-8 Number Theory Quiz 2
Factorization congruences (e.g. remainder
Work-along exercises • Ore and Oystein. Number
problems).
• State and prove divisibility tests. Theory and Its History
Theory of Congruences Problem-based projects
• Basic Properties of • Determine solutions, if it exists, to
Congruences linear and system of linear
• Special Divisibility Tests congruences.
• Linear congruence and • Prove and apply Wilson’s
the Chinese Remainder Theorem and Fermat’s Little
Theorem Theorem.
• Fermat’s Little Theorem
and Wilson’s Theorem
Number-Theoretic
Functions
• The Functions 𝜏 and 𝜎 • State and prove the properties of
multiplicative functions.
• Möbius Inversion Formula
• Prove and apply Euler’s Theorem Interactive lecture
• Euler phi-function
• Prove and apply the properties of
• Euler’s Theorem
primitive roots. Peer teaching
Quiz 3
Week 9-12 • Determine the existence of
Primitive Roots and Indices
primitive roots to prime and Work-along exercises
• The order of an integer
composite integers.
modulo n Problem-based projects
• Determine solutions, if it exists, of
• Primitive roots of primes
certain congruences using the
• Composite numbers
theory of indices.
having primitive roots
• The theory of indices
Quadratic Reciprocity and
Other Topics
• Quadratic residues
• Legendre symbol • Prove Euler’s Criterion and apply
• Reciprocity laws in solving quadratic congruences.
Interactive lecture
• Arithmetic functions • Identify Legendre symbol and
• Pythagorean triples prove its properties.
Peer teaching
• Which primes are sums • Prove and apply Gauss’ Lemma.
Week 13-14 Final Examination
of two powers? • Prove and apply the Quadratic Work-along exercises
• No fourth power is the Reciprocity Law
sum of two fourth powers • Encrypt or Decrypt codes using Problem-based projects
Caesar cipher, Hill’s cipher, and
Applications RSA public-key algorithm.
• Cryptosystems
• RSA public-key
cryptography
COURSE GRADING SYSTEM

Class Standing 70%

• Long Exams
• Attendance
• Recitation
• Problem sets/Assignments/Seatwork/Special Report

Midterm / Final Examinations 30%


100%

Midterm Grade + Final Term Grade = FINAL GRADE


2

Prepared by: Noted by:

_________________________ _________________________
Prof. Jacky Boy E. Atienza Prof. Edcon B. Baccay
Faculty, Department of Mathematics and Statistics Chairperson, Department of Mathematics and Statistics

Approved by:

_________________________
Dr. Lincoln A. Bautista
Dean, College of Science

_________________________
Dr. Manuel M. Muhi
Vice President for Academic Affairs
Contents

1 Preliminaries 10
1.1 The Pigeonhole Principle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
1.2 The Principle of Mathematical Induction . . . . . . . . . . . . . . . . . . . . . . . . . 13

2 Divisibility Theory 19
2.1 The Division Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
2.2 The Greatest Common Divisor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
2.3 Euclidean Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
2.4 Linear Diophantine Equation ax + by =c . . . . . . . . . . . . . . . . . . . . . . . . 30

3 Prime Numbers And Their Distribution 34


3.1 Fundamental Theorem of Arithmetic . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
3.2 Sieve of Eratosthenes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36

4 Theory of Congruences 39
4.1 Basic Properties of Congruences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
4.2 Applications of Congruence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
4.2.1 Leap-Year Formula . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
4.2.2 Computing the Day of the Week . . . . . . . . . . . . . . . . . . . . . . . . . 43
4.2.3 Cryptology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
4.3 Divisibility Criteria . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46

5 Number-Theoretic Functions 50
5.1 Multiplicative Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
5.2 Euler Phi Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53

6 Primitive Roots and Indices 57


6.1 The order of an integer modulo n . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
6.2 Primitive Roots for Primes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
6.3 Composite Numbers Having Primitive Roots . . . . . . . . . . . . . . . . . . . . . . . 61
6.4 Theory of Indices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64

8
7 Quadratic Reciprocity Law 67
7.1 Euler’s Criterion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
7.2 Legendre Symbol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
7.3 Quadratic Reciprocity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73

9
Chapter 1

Preliminaries

OVERVIEW
This chapter will tackle the Well-Ordering Principle, the Archimedean Property, the Pigeonhole
Principle and the Principle of Mathematical Induction.

Learning Objectives
At the end of this chapter, the students are expected to:

1. Present the Well-Ordering Principle and Archimedean Property in the context of integers;

2. State and apply the Pigeonhole Principle in some counting problems; and

3. State and apply the Principle of Mathematical Induction in proving some related theorems
.

1.1 The Pigeonhole Principle


The theory of numbers is concerned, at least in its elementary aspects, with the properties of the in-
tegers, particularly the positive integers 1, 2, 3, ... (also known as the natural numbers). The origin
of this study is way back in the early Greeks, for whom the word number meant positive integer, and
nothing else. We shall make no attempt to construct the integers axiomatically. Assuming that the
reader of this material is familiar with elementary properties of integers.

Basic Notations:
R := set of real numbers
Z := set of integers = {:::; −3; −2; −1; 0; 1; 2; 3; :::}
Z+ = N := set of positive integers = {1; 2; 3; :::}
Z− := set of negative integers = {−1; −2; −3; :::}

10
N0 := set of all whole numbers = {0; 1; 2; 3; :::}

Definition 1
p
The real number r is rational if there are integers p and q, with q 6= 0, such that r = . If r
q
is not rational, it is said to be irrational.

As a matter of notation, we will use Q to denote the set of all rational numbers while Q0 will denote
the set of all irrational numbers.

Example 1.
22 0 2 1000
1. The numbers ; 0= ; ; are all rational numbers. In fact, every integer n is a rational
7 1 15 313
n
number since n = .
1
√ √
2. The numbers 2; 3; ı; and e (Euler number ) are examples of irrational numbers.

Axiom 1: Well-Ordering Principle


Every nonempty set S of nonnegative integers contains a least element; that is, there is some
integer a ∈ S such that a ≤ b; for all b ∈ S.

Theorem 1: Archimedean Property


If a; b ∈ N; then there exists an n ∈ N such that na ≥ b:

Proof. Assume that for some a and b; na < b for every positive integer n. Then the set
S = {b − na | n ∈ N} ⊆ N. By Well-Ordering Principle, S has a least element, say b − ma: But
b − (m + 1)a also lies in S, since S contains all integers of this form. Furthermore, we have

b = (m + 1)a = (b − ma) − a < b − ma;

which contradicts the choice of b − ma as the smallest integer in S.

Example 2. Consider the integers 5 and 12.

1. If a = 5 and b = 12, then n can be taken as any positive integer greater 3 so that na ≥ b.

2. If a = 12 and b = 5, then take n = 1 to exhibit na ≥ b.

11
Theorem 2: The Pigeonhole Principle
If k + 1 or more objects are placed into k boxes, then at least one box contains two or more of
the objects.

Proof. If none of the k boxes contains more than one object, then the total number of objects would
be at most k. This contradiction shows that one of the boxes contains at least two or more of the
objects.

Example 3.

1. Here there are k + 1 = 10 pigeons in k = 9 holes. Since 10 > 9, the pigeonhole principle implies
that at least one hole has more than one pigeon.

2. Among any group of 10 people, at least two were born on the same day of the week.

Theorem 2 has the following general form.


Theorem 3: Generalized Pigeonhole Principle
l m
m
If m objects are placed into n boxes, then some box contains at least n
objects.

Example 4.
l m
30
1. In a class of 30 students, at least 7
= 5 students were born on the same day of the week.
l m
30
2. In a class of 30 students, at least 12
= 3 students have birthdays on the same month.

12
1.2 The Principle of Mathematical Induction
Consider the sequence of sums of the first n odd positive integers.

1 = 1;
1 + 3 = 4;
1 + 3 + 5 = 9;
1 + 3 + 5 + 7 = 16;
1 + 3 + 5 + 7 + 9 = 25;
1 + 3 + 5 + 7 + 9 + 11 = 36:

From these values, we can conjecture that 1 + 3 + 5 + 7 + : : : + 2n − 1 = n2 , for every positive integer
n: But how can we prove that this formula actually holds for all positive integer n?

The Principle of Mathematical Induction (PMI) is a valuable tool for proving results about the integers
- such as the formula we have conjectured for the sum of the first n odd positive integers.

Theorem 4: The Principle of Mathematical Induction (PMI)

Let S be a set of positive integers with the following properties:

(a) The integer 1 is in S.

(b) Whenever the integer k is in S, the next integer k + 1 must also be in S.

Therefore, S = N.

Proof. Let T be the set of all positive integers not in S, and assume that T 6= ?. By WOP, T has a
least element, we denote it by a. Since 1 is in S, certainly a > 1, and so 0 < a − 1 < a. The choice
of a as the smallest positive integer in T implies that a − 1 is not a member of T, or equivalently, that
a − 1 is in S. By hypothesis, S must also contain (a − 1) + 1 = a, which contradicts the fact that a is
in T. We conclude that the set T = ?, and consequently S = N.

Example 5. Use the Principle of Mathematical Induction to prove the following.

1. 1 + 3 + 5 + : : : + (2n − 1) = n2 , for all n ≥ 1:

Proof.
Basis step: Prove that the identity is true for n = 1. (Note: On the left hand side, n = 1 means
the number of terms. While on the right hand side, n = 1 is the particular integer value 1).

13
The left-hand side of the equation consists of one term which is equal to 1. The right-hand side
becomes (1)2 = 1: Hence, the formula is true for n = 1.
If suppose we check for n = 2, then we have

1 + 3 = (2)2 ⇐⇒ 4 = 4:

And so the formula is true for n = 2.


If n = 3; then
1 + 3 + 5 = (3)2 ⇐⇒ 9 = 9:

Hence, the formula is true for n = 3.


Inductive Step: Assume that the formula is true for n = k ≥ 1 :

1 + 3 + 5 + : : : + (2k − 1) = k 2 ;

We need to show that the formula is true for n = k + 1; that is,

1 + 3 + 5 + : : : + (2k − 1) + [2(k + 1) − 1] = (k + 1)2 :

Now, using the formula for n = k and adding [2(k + 1) − 1] to both sides of the equation, we get

1 + 3 + 5 + : : : + (2k − 1) = k 2
1 + 3 + 5 + : : : + (2k − 1) + [2(k + 1) − 1] = k 2 + [2(k + 1) − 1]
= k 2 + 2k + 1
= (k + 1)2

We have proven the two conditions required by the Principle of Mathematical Induction.
Therefore, the formula is true for all positive integers n.

n(n + 1)(n + 2)
2. 12 + 22 + 32 + : : : + n2 = , for all n ≥ 1:
6

Proof.
Basis step: Prove that the identity is true for n = 1.
If n = 1, then

1(1 + 1)(2 · 1 + 1)
12 = ⇐⇒ 1 = 1
6
Hence, the formula is true for n = 1.

14
Inductive Step: Assume that the formula is true for n = k ≥ 1 :

k(k + 1)(k + 2)
12 + 22 + 32 + : : : + k 2 = :
6

We need to show that the formula is true for n = k + 1; that is,

(k + 1)[(k + 1) + 1][2(k + 1) + 1]
12 + 22 + 32 + : : : + k 2 + (k + 1)2 =
6
(k + 1)(k + 2)(k + 3)
=
6

Now, using the formula for n = k and adding (k + 1)2 to both sides of the equation, we get

k(k + 1)(k + 2)
12 + 22 + 32 + : : : + k 2 =
6
k(k + 1)(k + 2)
12 + 22 + 32 + : : : + k 2 + (k + 1)2 = + (k + 1)2
6
k(k + 1)(2k + 1) + 6(k + 1)2
=
6
(k + 1)[k(2k + 1) + 6(k + 1)]
=
6
2
(k + 1)(2k + 7k + 6)
=
6
(k + 1)(k + 2)(k + 3)
=
6
We have proven the two conditions required by the Principle of Mathematical Induction.
Therefore, the formula is true for all positive integers n.

3. 7n − 1 is divisible by 6, for all n ≥ 1.

Proof.
Basis step: Prove that the statement is true for n = 1.
71 − 1 = 6 = 6 · 1 ⇐⇒ 71 − 1 is divisible by 6:

Inductive Step: Assume that the statement is true for n = k ≥ 1, that is, 7k − 1 is divisible by
6, for all k ≥ 1: We need to show that the statement is true for all n = k + 1, that is, 7k+1 − 1
is divisible by 6.
Observe that
7k+1 − 1 = 7 · 7k − 1
= (6 · 7k + 7k ) − 1
= 6 · 7k + (7k − 1)

15
Since 6 · 7k is divisible by 6, and by the hypothesis, 7k − 1 is divisible by 6, we conclude that their
sum is divisible by 6. Consequently, 7k+1 − 1 is divisible by 6. We have proven the two conditions
required by the Principle of Mathematical Induction. Therefore, 7n − 1 is divisible by 6, for all
n ≥ 1.

4. n3 − n + 3 is divisible by 3, for all n ≥ 0:

Proof.
Basis step: Note that the claim of the statement is that it is true for n ≥ 0. This means that
the basis step is to prove that the statement is true for n = 0.
03 − 0 + 3 = 3 = 3 · 1 ⇐⇒ 03 − 0 + 3 is divisible by 3:

Inductive Step: Assume that the statement is true for n = k ≥ 0, that is, k 3 − k + 3 is divisible
by 3, for all k ≥ 0: We need to show that the statement is true for all n = k + 1, that is,
(k + 1)3 − (k + 1) + 3 is divisible by 3.

Note that since k 3 − k + 3 is divisible by 3, we can write k 3 − k + 3 = 3a, for some integer a:
Thus,
(k + 1)3 − (k + 1) + 3 = k 3 + 3k 2 + 2k + 3
= (k 3 − k + 3) + 3k 2 + 3k
= 3a + 3k 2 + 3k
= 3(a + k 2 + k)

Since a + k 2 + k is an integer, it implies that (k + 1)3 − (k + 1) + 3 = 3(a + k 2 + k) is divisible


by 3. We have proven the two conditions required by the Principle of Mathematical Induction.
Therefore, n3 − n + 3 is divisible by 3, for all n ≥ 0:

16
Theorem 5: The Second Principle of Mathematical Induction
Let S be a set of positive integers with the following properties:

(a) The integer 1 is in S.

(b) If k is a positive integer such that 1; 2; : : : ; k is in S, then k + 1 must also be in S.

Therefore, S = N.

The Second Principle of Mathematical Induction is sometimes called strong induction to distinguish
it from the Principle of Mathematical Induction, which is also called weak induction.

Proof. Let T be a set of integers containing 1 and such that for every positive integer k, if it contains
1; 2; : : : ; k, it also contains k + 1. Let S be the set of all positive integers k such that all the positive
integers less than or equal to k are in T . Then 1 is in S, and by the hypotheses, we see that if k is
in S, then k + 1 is in S. Hence, by the Principle of Mathematical Induction, S must be the set of all
positive integers, so clearly T is also the set of all positive integers, because S ⊆ T .

Example 6. Using strong induction, prove that any integer n ≥ 2 has a prime factor.

Proof.
Basis step: Note that the claim of the statement is that it is true for n ≥ 2. This means that the
basis step is to prove that the statement is true for n = 2. Since 2 is divisible by the prime number 2,
the statement is true for n = 2:
Inductive step: We assume that the statement is true for n = 2; 3; : : : ; k, that is, n = 2; 3; : : : ; k has
a prime factor. We need to show that the statement is true for n = k + 1, that is, n = k + 1 has a
prime factor.
Now, the integer n = k + 1 is either prime or not. If n = k + 1 is prime, then we are done. If n = k + 1
is not prime, then it has some factor m satisfying 2 ≤ m < k + 1. Thus by the inductive hypothesis,
m = 2; 3; : : : ; k < k + 1 must have a prime factor, and so n = k + 1 must have that same prime factor.
Therefore by strong induction, any integer n ≥ 2 has a prime factor.

Historical Note
The first known use of mathematical induction appears in the work of the sixteenth-century math-
ematician Francesco Maurolico (1494-1575). In his book Arithmeticorum Libri Duo, Maurolico
presented various properties of the integers, together with proofs. He devised the method of
mathematical induction so that he could complete some of the proofs. The first use of mathe-
matical induction in his book was in the proof that the sum of the first n odd positive integers
equals n2 .

17
Exercise 1
Prove the following using mathematical induction.

1. 5n − 1 is divisible by 4, ∀n ∈ N0 .

2. 8n − 3n is divisible by 5, ∀n ∈ N0 .

3. x 2n − y 2n has a factor x + y , ∀n ∈ N.

4. n2 < n!, for any integer n ≥ 4

5. (a + 1)n ≥ 1 + na, where a > −1; ∀n ∈ N


1 n+1
6. 3 + 32 + 33 + : : : + 3n = (3 − 3), ∀n ∈ N.
2
n(2n − 1)(2n + 1)
7. 12 + 32 + 52 + : : : + (2n − 1)2 = , ∀n ∈ N.
3
(2n − 1)3n+1 + 3
8. 1 · 3 + 2 · 32 + 3 · 33 + ::: + n · 3n = , ∀n ∈ N.
4
n2 (n + 1)2
9. 13 + 23 + 33 + : : : + n3 = , ∀n ∈ N.
4
1 1 1 1 n
10. + + + ::: + = ; ∀n ∈ N
1·2 2·3 3·4 n · (n + 1) n+1

18
Chapter 2

Divisibility Theory

OVERVIEW
This chapter will contain discussions on the Division Algorithm of the integers, the greatest
common divisor, the least common multiple, the Euclidean algorithm and solutions to linear
Diophantine equations.

Learning Objectives
At the end of this chapter, the students are expected to:

1. State and apply the division algorithm in establishing the Euclidean algorithm;

2. Determine the greatest common divisor and least common multiple of two integers; and

3. Solve linear Diophantine equations .

2.1 The Division Algorithm

Definition 2
An integer b is said to be divisible by an integer a 6= 0, in symbols a|b (read as “a divides b”), if
there exists some integer c such that b = ac. We write a 6 | b (read as “a does not divide b”) to
indicate that b is not divisible by a:

Example 7.

1. −32 is divisible by 4 since −32 = 4(−8):

2. 20 is not divisible by 3, in symbols 3 6 | 20, since there is no integer c such that 20 = 3c is true.

19
Remarks 1.

1. If a|b with a 6= 0, then we say that “a is a div isor of b", “a is a f actor of b", or “b is a
multiple of a".

2. If a|b, then −a|b. It is sufficient to obtain the positive divisors and then adjoin to them the
corresponding negative integers.

Theorem 6
For a; b; c ∈ Z; the following hold:

1. a | 0; 1 | a; a | a:

2. a | 1 if and only if a = ±1:

3. If a | b and c | d, then ac | bd:

4. If a | b and b | c, then a | c:

5. a | b and b | a if and only if a = ±b:

6. If a | b and b 6= 0, then |a| ≤ |b|.

7. If a | b and a | c, then a | (bx + cy ) for any x; y ∈ Z.

Proof. We will only show the proof for parts (6) and (7).

(6) If a | b; then there exists an integer c such that b = ac. Also, b 6= 0 implies that c 6= 0: Upon taking
absolute values, we get |b| = |ac| = |a||c|: Since c 6= 0; it follows that |c| ≥ 1, hence |b| = |a||c| ≥ |a|:

(7) The relations a | b and a | c ensure that b = ar and c = as for suitable integers r and s: But then

bx + cy = ar x + asy = a(r x + sy )

for any x; y ∈ Z. Since (r x + sy ) ∈ Z; it follows that a | (bx + cy ):

20
Theorem 7: Division Algorithm
Given the integers a and b, with b > 0, there exists unique integers q and r satisfying

a = qb + r; 0 ≤ r < b:

The unique integers q and r are called, respectively, the quotient and remainder in the division
of a by b.

Example 8.

1. If a = 82 and b = 7, then 82 = (11)(7) + 5:

2. If a = −79 and b = 9, then −72 = (−9)(9) + 2:

3. If a = 1 and b = 20, then 1 = (0)(20) + 1:

4. If a = 0 and b = 15, then 0 = (0)(15) + 0:

Proof.

1. Existence Proof.
Consider the set S = {a − xb | x ∈ Z; a − xb ≥ 0}. Clearly, S ⊆ N. We need to show that
S 6= ?. For this, it suffices to exhibit a value of x making a − xb ≥ 0. Since b ≥ 1, we have
|a| · b ≥ |a| and so
a − (−|a|) · b = a + |a| · b ≥ a + |a| ≥ 0:

Hence, for the choice x = −|a|; then (a − xb) ∈ S. Thus, S 6= ?. By WOP, S has a least
element; say r . By the definition of S; ∃q ∈ Z such that r = a − qb, 0 ≤ r .
We argue that r < b. If this were not the case, then r ≥ b and

a − (q + 1)b = (a − qb) − b = r − b ≥ 0:

This implies that a − (q + 1)b belong to S. But a − (q + 1)b = r − b < r , which contradicts
the choice of r as the least element of S. Hence, r < b.

2. Uniqueness Proof.
Suppose that a has two representations of the desired form; say

a = qb + r = q 0 b + r 0 ;

21
where 0 ≤ r < b; 0 ≤ r 0 < b. Then r 0 − r = b(q − q 0 ) and, owing to the fact that the absolute
value of a product is equal to the product of the absolute values,

|r 0 − r | = b|q − q 0 |:

Upon adding the two inequalities −b < −r ≤ 0 and 0 ≤ r 0 < b, we obtain −b < r 0 − r < b, or
equivalently, |r 0 − r | < b. Thus, b|q − q 0 | < b, which yields

0 ≤ |q − q 0 | < 1:

Since |q − q 0 | is a nonnegative integer, the only possibility is that |q − q 0 | = 0; whence q = q 0 ;


this in its turn gives r = r 0 .

Example 9. If b = 2; then either r = 0 or r = 1. When r = 0, a = 2q and is called even; when r = 1;


a = 2q + 1 and is called odd. Now, either a2 = (2q)2 = 4k or a2 = (2q + 1)2 = 4(q 2 + q) + 1 = 4k + 1:
Thus, the square of an integer leaves the remainder 0 or 1 upon division by 4.

Corollary 1
If a and b are integers, with b 6= 0, then there exist unique integers q and r such that

a = bq + r; 0 ≤ r < |b|:

Proof. It suffices to consider the case in which b is negative. Then |b| > 0, and the Division Algorithm
produces unique integers q 0 and r for which

a = q 0 |b| + r; 0 ≤ r < |b|:

Noting that |b| = −b, we may take q = −q 0 , to obtain a = qb + r , with 0 ≤ r < |b|:

Example 10. We illustrate the case where b = −7 < 0 and a = 1; −2; 61; and − 59. We have

1 = 0(−7) + 1
−2 = 1(−7) + 5
61 = (−8)(−7) + 5
−59 = 9(−7) + 4

22
Example 11. Show that the square of an odd integer has the form 8q + 1.

Proof. The earlier declaration of the form of an odd and even integer can’t be used. Since the required
square will not form a factor 8. We will utilize a different way to exhibit odd and even integers.

Let n ∈ Z and take 4 as a divisor for any n. Then, by division algorithm, there exist unique integers q
and r such that n = 4q + r , where 0 ≤ r < 4. Thus, n is even if it is of the form 4k or 4k + 2, and, it
is odd if it is of the form 4k + 1 or 4k + 3.

If n = 4k + 1, then
(4k + 1)2 = 16k 2 + 8k + 1 = 8(2k 2 + k) + 1.
Take q = 2k 2 + 1. Hence, n2 = 8q + 1.

If n = 4k + 3, then
(4k + 3)2 = 16k 2 + 24k + 9 = (16k 2 + 24k + 8) + 1 = 8(2k 2 + 3k + 1) + 1.
Take q = 2k 2 + 3k + 1. Hence, n2 = 8q + 1.

2.2 The Greatest Common Divisor

Definition 3: Greatest Common Divisor


Let a; b ∈ Z; with at least one of them different from zero. The greatest common divisor of a
and b, denoted by gcd(a; b) = d; is the positive integer d satisfying

1. d | a and d | b;

2. if c | a and c | b, then c ≤ d:

Example 12.

1. gcd(−12; 30) = 6

2. gcd(−5; 5) = 5

3. gcd(14; 25) = 1

4. gcd(−8; −36) = 4

23
The next theorem indicates that gcd(a; b) can be represented as a linear combination of a and b. By
a linear combination of a and b, we mean an expression of the form ax +by , where x and y are integers.

Theorem 8
Let a; b ∈ Z, not both zero. Then there exist integers x and y such that

d = gcd(a; b) = ax + by :

Example 13.

1. gcd(−12; 30) = 6 = (−12)2 + 30 · 1

2. gcd(−8; −36) = 4 = (−8)4 + (−36)(−1)

Proof. Consider the set S of all positive linear combinations of a and b:

S = {au + bv | au + bv > 0; u; v ∈ Z}:

Note that S 6= ?: (For example, if a 6= 0, then |a| = au + b · 0 ∈ S, where u = ±1.) By Well-Ordering


Principle, S must contain a least element, say d. By definition of S, there exists integers x and y such
that d = ax + by :
Claim: d = gcd(a; b):
Proof of claim: By Division Algorithm, there exists unique integers q and r such that a = qd +r; 0 ≤
r < d: Then r can be written in the form

r = a − qd
= a − q(ax + by )
= a(1 − qx) + b(−qy )

Where r > 0, this representation would imply that r ∈ S. Which contradicts the assumptions that d
is the least integer in S since r < d: This forces r = 0, and so a = qd, or equivalently d | a. Similarly,
d | b. Hence, d is a common divisor of both a and b.
Now, if c is an arbitrary common divisor of a and b, then by Theorem 6.7, c | (ax + by ), or equivalently,
c | d: By Theorem 6.6, c = |c| ≤ |d| = d. Therefore, d = gcd(a; b):

24
Corollary 2
If a; b ∈ Z, not both zero, then the set

T = {ax + by | x; y ∈ Z}

is precisely the set of all multiples of d = gcd(a; b):

Definition 4
Two integers a and b, not both zero, are said to be relatively prime whenever gcd(a; b) = 1:

Example 14.

1. Since gcd(27; 35) = 1, then 27 and 35 are relatively prime.

2. gcd(2; 5) = 1. In fact, any two prime numbers are relatively prime.

3. gcd(1; 16) = gcd (−1; 16) = 1. In general, any nonzero integer is relatively prime with ±1.

Theorem 9
Let a and b be integers, not both zero. Then a and b are relatively prime if and only if there
exist integers x and y such that 1 = ax + by :

Proof. (=⇒) If gcd(a; b) = 1, then by Theorem 7, there exists integers x and y such that 1 = ax + by :
(⇐=) Suppose that 1 = ax + by for some integers x and y , and d = gcd(a; b). Since d | a and d | b;
then by Theorem 6.7, d | (ax + by ) or d | 1: Since d is a positive integer and by Theorem 6.2, this
forces d = 1.

Corollary 3
!
a b
If gcd(a; b) = d, then gcd ; = 1:
d d

−12 30
„ «
Example 15. If gcd(−12; 30) = 6, then gcd ; = gcd(−2; 5) = 1.
6 6

25
Corollary 4

If a | c and b | c, with gcd(a; b) = 1, then ab | c:

Example 16. Given that 2 | 20; 5 | 20, and gcd(2; 5) = 1. Then 2 · 5 | 20 ⇐⇒ 10 | 20:

Proof. If a | c and b | c, then there exists integers r and s such that c = ar = bs: Now, gcd(a; b) = 1
implies that 1 = ax + by for some integers x and y . Thus,

c =c ·1
= c(ax + by )
= acx + bcy
= a(bs)x + b(ar )y
= ab(sx + r y )

or, as a divisibility statement, ab | c:

Theorem 10: Euclid’s Lemma


If a | bc, with gcd(a; b) = 1, then a | c:

Proof. By Theorem 7, there exists integers x and y such that gcd(a; b) = 1 = ax + by : Then

c =c ·1
= c(ax + by )
= acx + bcy

Since a | ac and a | bc, it follows that a | (acx + bcy ), or equivalently, a | c:

2.3 Euclidean Algorithm


The gcd of two integers can be found by listing all their positive divisors and picking out the largest one
common to each; but this is not quite advisable for large numbers. A more efficient process, involving
the repeated application of the Division Algorithm, is given in the 7th book of the Elements and is
now referred to as the Euclidean Algorithm. The algorithm is as follows:

Let a and b be integers whose gcd is desired. Since gcd(|a|; |b|) = gcd(a; b), without loss of generality,
we can assume that a ≥ b > 0: By Division Algorithm, we have

a = q1 b + r1 ; 0 ≤ r1 < b:

26
If r1 = 0, then b | a and gcd(a; b) = b: Otherwise, if r1 6= 0; divide b by r1 to obtain q2 and r2 satisfying

b = q2 r1 + r2 ; 0 ≤ r2 < r1 :

If r2 = 0; then we stop and gcd(a; b) = r1 . Otherwise, proceed as before to obtain q3 and r3 satisfying

r1 = q3 r2 + r3 ; 0 ≤ r3 < r2 :

This division process continues until some zero remainder appears, say at the (n + 1)th step, where
rn−1 is divided by rn (a zero remainder occurs sooner or later since the decreasing sequence b > r1 >
r2 > : : : ≥ 0 cannot contain more than b integers). The result is the following system of equations:

a = q1 b + r1 ; 0 < r1 < b
b = q2 r1 + r2 ; 0 < r2 < r1
r1 = q3 r2 + r3 ; 0 < r3 < r2
.. ..
. .
rn−2 = qn rn−1 + rn ; 0 < rn < rn−1
rn−1 = qn+1 rn + 0

We argue that rn ; the last nonzero remainder which appears in this manner, is equal to gcd(a; b). Our
proof is based on the lemma below.

Lemma 1
If a = qb + r; then gcd(a; b) = gcd(b; r ):

Proof. If gcd(a; b) = d, then d | a and d | b imply that d | (a − qb); or d | r: Thus d is a common


divisor of both b and d. If c | b and c | r; then c | (qb + r ); and hence c | a: This makes c a common
divisor of a and b, so that c ≤ d. Therefore, gcd(b; r ) = d:

Lemma 1 implies that gcd(a; b) = gcd(b; r1 ) = gcd(r1 ; r2 ) = : : : = gcd(rn−1 ; rn ) = gcd(rn ; 0) = rn as


claimed.

27
Example 17. Determine the gcd(12378; 3054) and find x; y ∈ Z such that d = 12378x + 3054y :

12378 = 4 · 3054 + 162


3054 = 18 · 162 + 138
162 = 1 · 138 + 24
138 = 5 · 24 + 18
24 = 1 · 18 + 6
18 = 3 · 6 + 0

) gcd(12378; 3054) = 6:

6 = 24 − 18
= 24 − (138 − 5 · 24)
= 6 · 24 − 138
= 6(162 − 138) − 138
= 6 · 162 − 7(3054 − 18 · 162)
= 132 · 162 − 7 · 3054
= 132(12378 − 4 · 3054) − 7 · 3054
= 132 · 12378 + (−535)3054:

) x = 132 and y = −535:

Theorem 11
If k > 0, then gcd(ka; kb) = kgcd(a; b):

Proof. By Euclidean Algorithm for ak and bk, we have

ak = q1 (bk) + r1 k; 0 < r1 k < bk


bk = q2 (r1 k) + r2 k; 0 < r2 k < r1 k
r1 = q3 (r2 k) + r3 k; 0 < r3 k < r2 k
.. ..
. .
rn−2 k = qn (rn−1 k) + rn k; 0 < rn k < rn−1 k
rn−1 k = qn+1 rn k + 0:
Therefore, gcd(ka; kb) = rn k = kgcd(a; b)

28
Definition 5: Least Common Multiple

The least common multiple of two nonzero integers a and b, denoted by lcm(a; b); is the positive
integer m satisfying

1. a | m and b | m

2. if a | c and b | c, with c > 0, then m ≤ c:

Example 18.

1. lcm(3; 15) = 15 3. lcm(−12; 30) = 60

2. lcm(5; 17) = 85 4. lcm(−8; −36) = 72

The next theorem provides the relationship between the gcd and lcm of any two positive integers.

Theorem 12
For positive integers a and b, we have gcd(a; b) · lcm(a; b) = ab:

ab
Proof. Let gcd(a; b) = d. Then there exists integers s and t such that a = dt and b = ds. If m = ;
d
then m = as = bt which implies that a | m and b | m:
Now, let c | a and c | b, that is, c = au = bv : Since gcd(a; b) = d, by Theorem 7, there exists integers
x and y such that d = ax + by : Then

c cd c(ax + by ) c c
= = = x + y = v x + uy ∈ Z:
m ab ab b a

This implies that m | c, and by Theorem 6.6, m ≤ c: Thus, lcm(a; b) = m; that is,

ab ab
lcm(a; b) = = :
d gcd(a; b)

Example 19. Consider gcd(12378; 3054) = 6: Then

12378 · 3054
lcm(12378; 3054) = = 6300402:
6

29
Corollary 5

For positive integers a and b, we have lcm(a; b) = ab if and only if gcd(a; b) = 1.

Example 20. Since gcd(25; 36) = 1, then lcm(25; 36) = 25 · 36 = 900:

2.4 Linear Diophantine Equation ax + by = c

Definition 6
An equation of the form ax + by = c, where a; b; c ∈ Z, is called a Linear Diophantine Equation
if its solutions are confined in Z.

Theorem 13
The Linear Diophantine Equation ax + by = c has a solution if and only if d | c; where
gcd(a; b) = d. If (x0 ; y0 ) is any particular solution of this equation, then all other solutions are
given by
b a
x = x0 + t and y = y0 − t; for varying integers t:
d d

Proof. Suppose that a solution (x0 ; y0 ) of the given equation is known. If (x 0 ; y 0 ) is any other solution,
then ax0 + by0 = c = ax 0 + by 0 ⇐⇒ a(x 0 − x0 ) = b(y0 − y 0 ):
a b
By Corollary 3, there exist relatively prime integers r and s such that r = and s = , or equivalently,
d d
a = dr and b = ds. Substituting these values we have

dr (x 0 − x0 ) = ds(y0 − y 0 ) ⇐⇒ r (x 0 − x0 ) = s(y0 − y 0 )

Then r | s(y0 − y 0 ); with gcd(r; s) = 1. By Euclid’s Lemma, it must be the case that

r | (y0 − y 0 ) ⇐⇒ y0 − y 0 = r t; for some integer t:

Then we have !
0 b
x = x0 + st = x0 + t
d
a
„ «
0
y = y0 − r t = y0 − t:
d
The reader can verify that these values satisfy the Diophantine Equation regardless of the choice of the

30
integer t. Hence, " ! #
b a
» „ « –
0 0
ax + by = a x0 + t + b y0 − t
d d
!
ab ab
= (ax0 + by0 ) + − t
d d
=c +0·t
=c
Thus, there are an infinite number of solutions of the given equation, one for each value of t.

Example 21. Find all integer solutions of 172x + 20y = 1000: Also, determine all positive solutions
of this equation, if it exists.

Solution: By Euclidean Algorithm, we can find gcd(172, 20) as follows.

172 = 8 · 20 + 12
20 = 1 · 128
12 = 1 · 8 + 4
8=2·4+0
) gcd(172; 20) = 4:

Since 4 | 1000; a solution to this equation exists. By Theorem 7, we can write gcd(172; 20) = 4 as a
linear combination of 172 and 20. Thus,

4 = 12 − 8
4 = 12 − (20 − 12)
4 = 2 · 12 − 20
4 = 2(172 − 8 · 20) − 20
4 = 172(2) + 20(−17)

Now, note that


1000 = 250 · 4
1000 = 250[·172(2) + 20(−17)]
1000 = 172(500) + 20(−4250)

31
Hence, a particular solution will be x0 = 500 and y0 = −4250. All other solutions will be of the form

20
„ «
x = 500 + t ⇐⇒ x = 500 + 5t;
4
172
„ «
y = −4250 − ⇐⇒ y = −4250 − 43t; for some integert:
4

Now, to determine the positive solutions to the equation, suppose that x = 500 + 5t > 0 and
36
y = −43t − 4250 > 0. The reader can verify that −100 < t < −98 43 (Why?). This forces t = −99.
Therefore, the only positive solution is when x = 5 and y = 7.

Corollary 6

If gcd(a; b) = 1 and (x0 ; y0 ) is a particular solution of the Linear Diophantine Equation ax +by =
c; then all solutions are given by x = x0 + bt and y = y0 − at, for some integer t:

Example 22. Consider 5x + 22y = 18 which has a particular solution x0 = 8 and y0 = −1 and
gcd(5; 22) = 1. Therefore, by Corollary 6, x = 8 + 22t and y = −1 − 5t, for some integer t.

Example 23. A customer bought a dozen pieces of fruit: apples and oranges for P132. If an apple
costs P3 more than an orange, and more apples than oranges were purchased, how many pieces of each
kind were bought?

Solution: Let x := number of apples purchased, y := number of orange purchased, and z := cost of
an orange. Then

(z + 3)x + zy = 132
3x + (x + y )z = 32; but x + y = 12
3x + 12z = 132
(∗) x + 4z = 44 ←− Linear Diophantine Equation in x and z

Since gcd(1; 4) = 1 | 44, a solution to this equation exists. By Theorem 7, we can write gcd(1; 4) = 1
as a linear combination of 1 and 4. Thus,

1 = 1(−3) + 4 · 1
⇐⇒ 44 = 1(−132) + 4(44)

It follow that x0 = −132 and z0 = 44: By Corollary 6, all other solutions are of (∗) are x = −132 + 4t

32
and z = 44 − t; for some integer t. But 6 < x ≤ 12 so that 6 < −132 + 4t ≤ 12. Now,

1
−132 + 4t ≤ 12 =⇒ t ≤ 36 and 6 < −132 + 4t =⇒ t > 34
2
Thus, t = 35 and t = 36. If t = 35, we have 8 apples at P12 each and 4 oranges at P9 each.
If t = 36, we have 12 apples at P11 each.

Historical Note
The Linear Diophantine Equation ax + by = c was named after the Greek mathematician
Diophantus. He wrote Arithmetica, which is the earliest known book on Algebra; it contains the
first systematic use of mathematical notation to represent unknowns in equations and powers
of these unknowns. Almost nothing is known about Diophantus, other than that he lived in
Alexandria around 250 A.D. The only source of details about his life comes from an epigram
found in a collection called the Greek Anthology: “Diophantus passed one sixth of his life in
childhood, one twelfth in youth, and one seventh as a bachelor. Five years after his marriage was
born a son who died four years before his father, at half his father’s age.” From this the reader
can infer that Diophantus lived to the age of 84.

Exercise 2

I. Determine the greatest common divisor and least common multiple of the following pairs of
integers.

1. p 3 and p 5 , where p is prime 4. 1771 and 4807


2. bp 3 and a2 p 2 , where a; b and p are primes 5. 8584 and 8742
3. 108 and 315

II. Do as indicated.

1. Show that the square of any integer is of the form 5k; 5k + 1 or 5k + 4.


2. Show that the square of any integer is of the form either 3k or 3k + 1 but not 3k + 2.
3. Find all integral solutions of 126x - 117y = 87
4. Separate 1891 into two parts such that one part is a multiple of 21 and the other is a multiple
of 31.
5. A coin purse contains PhP 5 and PhP 10 - coins amounting to P 75. How many of each
kind will produce the given amount?

33
Chapter 3

Prime Numbers And Their Distribution

OVERVIEW
The chapter will tackle basic theorem leading to and consequences of the Fundamental Theorem,
and will present the Sieve of Eratosthenes to determine prime numbers.

Learning Objectives
At the end of this chapter, the students are expected to:

1. State and prove basic theorems of Prime Numbers;

2. State and exhibit the role of the Fundamental Theorem of Arithmetic; and

3. Perform the sieving process for prime numbers .

3.1 Fundamental Theorem of Arithmetic

Definition 7
An integer p > 1 is called a prime number, or simply prime, if its only positive divisors are 1
and p. An integer greater than 1 that is not a prime is called composite.

Example 24.

1. The integers 2; 3; 5; 7; 11; 13; : : : are primes.

2. The integers 4; 6; 8; 9; 10; 12; : : : are composite.

34
Theorem 14
If p is a prime and p | ab; then either p | a or p | b:

Proof. If p | a, then we are done. Assume that p - a given that p | ab. Since the only positive divisors
of p are 1 and p itself, this implies that gcd(p; a) = 1. (Note: gcd(p; a) = p or gcd(p; a) = 1 whenever
p | a or p - a:) By Euclid’s Lemma, we get p | b.

Corollary 7

If p is a prime and p | a1 a2 · · · an , then p | ak for some k; 1 ≤ k ≤ n:

Corollary 7 is equivalent to Example 4. Hence the proof is similar.

Corollary 8

If p; q1 ; q2 ; : : : ; qn are all primes and p | q1 q2 · · · qn ; then p = qk for some k; 1 ≤ k ≤ n:

Theorem 15: 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.

Corollary 9

Any positive integer n > 1 can be written uniquely in a canonical form n = p1k1 p2k2 · · · piki ,
where each ki ∈ N and each pi is a prime with p1 < p2 < · · · < pi :

Example 25. Write n = 4725 and n = 17460 in their respective canonical form.

1. 4725 = 33 · 52 · 7

2. 17460 = 23 · 32 · 5 · 72

Theorem 16

The number p is irrational, where p is prime. (Pythagoras)

√ √ a
Proof. Suppose p is a rational number, say p= , where gcd(a; b) = 1. Squaring both sides of
b
√ a a2
p = , we get p = 2 ⇐⇒ a2 = pb 2 , so that b | a2 : If b > 1; then by Fundamental Theorem of
b b
Arithmetic, there exists a prime q such that q | b. It follows that q | a2 , and by Theorem 13, q | a:

35
Hence, gcd(a; b) ≥ q > 1. Which is a contradiction to the assumption that gcd(a; b) = 1, unless
b = 1. But if b = 1, then a2 = p, which is impossible.

Theorem 17
There are infinitely many primes. (Euclid)

Proof. Let p1 = 2; p2 = 3; p3 = 5; p4 = 7; : : : be the primes in ascending order, and suppose that there
is a last prime, say pn . Now consider the positive integer m = p1 p2 p3 · · · pn + 1. Since m > 1, by the
Fundamental Theorem of Arithmetic, m is divisible by some prime pk . But p1 ; p2 ; p3 ; : : : ; pn are the
only prime numbers, so that pk must be equal to one of p1 ; p2 ; p3 ; : : : ; pn . Then pk | p1 p2 p3 · · · pn
and pk | m. Thus, pk | (m − p1 p2 p3 · · · pn ), or equivalently, pk | 1 ⇐⇒ pk = ±1. Which is a
contradiction since pk is prime and pk > 1:

3.2 Sieve of Eratosthenes


Tests distinguishing between primes and composite integers are called primality tests. The most basic
primality test is trial division, which tells us that the integer n is prime if and only if it is not divisible

by any prime not exceeding n. This procedure is called the Sieve of Eratosthenes, since it was
invented by the ancient Greek mathematician Eratosthenes.

Theorem 18

If n is a composite integer, then n has a prime factor not exceeding n:

Proof. Since n is composite, we can write n = ab, where a and b are integers with 1 < a ≤ b < n.
√ √ √
Then it must be a ≤ n. Since if otherwise b ≥ a > n and ab > n · n = n. Now, by Corollary
7, a must have a prime divisor, which by Theorem 6.4 is also a prime divisor of n, and which is clearly

less than or equal to n.

Example 26.

1. Find all prime numbers less than 100.



Solution: Note that 100 = 10, and the primes less than 10 are 2, 3, 5, and 7. This means
that we just need to cross-out 1 and all composite numbers which are divisible by 2, 3, 5, and 7.
Those numbers which are not crossed-out, are all the primes less than 100.

36
2. Determine if 509 is prime or composite.

Solution: 22 < 509 < 23. Thus we need only to try out the primes 2, 3, 5, 7, 11, 13, 17, and
19 as possible divisors. Dividing 509 by each of these primes will conclude that 509 is prime.

3. Determine the canonical form of 2093.



Solution: 45 < 2093 < 46. It is enough to examine the multiples
2p; 3p; 5p; 7p; 11p; 13p; 17p; 19p; 23p; 29p; 31p; 37p; 41p; 43p: First, 2093 = 7 · 299. Note that

17 < 299 < 18, so the primes 2; 3; 5; 7; 11; 13; 17 < 18. Then 2093 = 7 · 13 · 23:

Definition 8
The function ı(x), where x is a positive real number, denotes the number of primes not exceeding
x.

Example 27. From the illustration of Sieve of Eratosthenes in Example 23.1, we see that ı(10) = 4
and ı(100) = 25:

Theorem 19: The Prime Number Theorem


x
The ratio of ı(x) to approaches 1 as x increases without bound. In symbols,
log x

ı(x)
lim = 1:
x→∞ x= log x

f (x)
Note that in Calculus, if x→∞
lim = 1; we say that f (x) is asymptotic to g (x). Hence, Theorem 18
g (x)
x
implies that ı(x) is asymptotic to .
log x

37
Historical Note
Eratosthenes (c. 276-194 B.C.) was born in Cyrene, which was a Greek colony west of Egypt.
It is known that he spent some time studying at Plato’s school in Athens. King Ptolemy II invited
Eratosthenes to Alexandria to tutor his son. Later, Eratosthenes became the chief librarian of the
famous library at Alexandria, which was a central repository of ancient works of literature, art,
and science. He was an extremely versatile scholar, having written on mathematics, geography,
astronomy, history, philosophy, and literature. Besides his work in mathematics, Eratosthenes
was most noted for his chronology of ancient history and for his geographical measurements,
including his famous measurement of the size of the earth.

Exercise 3
Do as indicated.

1. Find the prime factorization of 12 350.

2. Find the prime factorization of 17 325.

3. Apply the Sieve Process to determine all prime numbers between 200 and 400.

4. Prove that 3 is irrational.

5. Find all primes that divide 50!.

38
Chapter 4

Theory of Congruences

OVERVIEW
The chapter will entail the basic properties of the modular congruence relation and some of its
application. Also, basic theorems on the classical divisibility tests will be discussed.

Learning Objectives
At the end of this chapter, the students are expected to:

1. State and apply the basic theorems of the modular congruence relation;

2. Discuss some applications of congruences; and

3. Establish the basic divisibility tests .

4.1 Basic Properties of Congruences

Definition 9
Two integers a and b are said to be congruent modulo n, where n ∈ Z+ ; if n | a − b. In this
case, we write a ≡ b (mod n) (read as “a is congruent to b modulo n"). The number n is called
the modulus. The statement “a ≡ b (mod n)" is called a congruence.

Example 28. The following congruences hold.

1. 29 ≡ 8 (mod 3) 4. 49 ≡ −23 (mod 8)

2. 15 ≡ 3 (mod 6) 5. 28 ≡ −37 (mod 5)

3. 48 ≡ 28 (mod 5) 6. −55 ≡ −55 (mod 13)

39
Theorem 20

1. a ≡ b (mod n) if and only if a and b leave the same remainder when divided by n.

2. The integer r is the remainder when a is divided by n if and only if a ≡ r (mod n), where
r ∈ {0; 1; 2; 3; : : : ; (n − 1)}.

Remark:

1. The set {0; 1; 2; 3; : : : ; (n − 1)} is called the least residues modulo n.

2. Using least residues, the set of integers Z can be partitioned into n nonempty pairwise disjoint
classes, called congruence classes modulo n.

Example 29.

1. 117 leaves 7 as remainder when divided by 10. Therefore, 117 ≡ 7 ( mod 10)

2. 20 and 30 are both divisible by 5. Thus, 20 ≡ 30 ( mod 5) .

3. 25 and 37 leave 1 as remainder when divided by 12. Hence, 25 ≡ 37 ( mod 12) .

Theorem 21
Let a; b; c ∈ Z.

1. a ≡ a (mod n) (Reflexive)

2. If a ≡ b (mod n), then b ≡ a (mod n). (Symmetric)

3. If a ≡ b (mod n) and b ≡ c (mod n), then a ≡ c (mod n). (Transitive)

Remark: The relation “ ≡ ” is an equivalence relation.

Note that every equivalence relation defined on a set gives rise to a partition on the set. For this case,
the partition is determined by the remainder r in the statement ”a ≡ r ( mod n) ”. The following are

40
the equivalence classes formed by the ≡-relation. These are called the residue classes.

[0]n = { nk | k ∈ Z }
[1]n = { nk + 1 | k ∈ Z }
[2]n = { nk + 2 | k ∈ Z }
..
.
[n − 1]n = { nk + (n − 1) | k ∈ Z } :

Example 30. Under congruence modulo 4, the residual classes on Z are as follows:

[0]4 = { 4k | k ∈ Z } = {0; 4; −4; : : :}


[1]4 = { 4k + 1 | k ∈ Z } = {1; 5; −3; : : :}
[2]4 = { 4k + 2 | k ∈ Z } = {2; 6; −2; : : :}
[3]4 = { 4k + 3 | k ∈ Z } = {3; 7; −1; : : :} :

Theorem 22
Let a ≡ b (mod n) and c ≡ d (mod n). Then

1. a + c ≡ b + d (mod n)

2. ac ≡ bd (mod n)

3. ak ≡ b k (mod n), for any positive integer k.

Example 31.

1. If 13 ≡ 5 ( mod 8) and 4 ≡ −12 ( mod 8) , then 17 ≡ −7 ( mod 8) .

2. If 11 ≡ 2 ( mod 9) and 8 ≡ −1 ( mod 9) , then 88 ≡ −2 ( mod 9) .

3. If 7 ≡ 3 ( mod 4) , then 49 ≡ 9 ( mod 4) or 49 ≡ 1 ( mod 4) .

The following theorem is a generalization of the previous theorem.

41
Theorem 23
If ai ≡ bi ( mod n) for i = 1; 2; 3; : : : ; m, then
n
X n
X n
Y n
Y
1. ai ≡ bi ( mod n) 2. ai ≡ bi ( mod n)
i=1 i=1 i=1 i=1

Example 32. Find the least residue modulo 7 of 37 · 45 + 6 · 158 .

Solution:
Initially, we have the following:
37 ≡ 2 ( mod 7)
45 ≡ 3 ( mod 7)
6 ≡ 6 ( mod 7)
15 ≡ 1 ( mod 7) :
Thus,
37 · 45 + 6 · 158 ≡ 2 · 3 + 6 · 18 ( mod 7)
37 · 45 + 6 · 158 ≡ 6 + 6 ( mod 7)
37 · 45 + 6 · 158 ≡ 12 ( mod 7)
37 · 45 + 6 · 158 ≡ 5 ( mod 7) :

Example 33. Find the remainder when 6768 is divided by 63.

Solution:

Note that 67 ≡ 4 ( mod 63) .


Hence, 672 ≡ 42 ( mod 63) implies 672 ≡ 16 ( mod 63) .
Also, 673 ≡ 43 ( mod 63) implies 673 ≡ 64 ( mod 63) . The last conclusion can be written as
673 ≡ 1 ( mod 63) .

With 6768 = ((673 )22 )67, thus,

((673 )22 )67 ≡ (122 · 4) ( mod 63)


((673 )22 )67 ≡ (1 · 4) ( mod 63)
((673 )22 )67 ≡ 4 ( mod 63) :

The remainder is 4.

42
Example 34. Find the unit’s digit 8253 .

Solution:
To determine the unit’s digit, one may perform congruence modulo 10.
Now,
8 ≡ 8 ( mod 10)
82 ≡ 64 ( mod 10) implies82 ≡ 4 ( mod 10)
83 ≡ 512 ( mod 10) implies83 ≡ 2 ( mod 10)
84 ≡ 4096 ( mod 10) implies84 ≡ 6 ( mod 10)
85 ≡ 32768 ( mod 10) implies85 ≡ 8 ( mod 10) :
Hence, the remainders occurs in the manner congruence modulo 4 work on Z. Thus, 253 ≡ 1 ( mod 4) .
Therefore, 8 is the unit’s digit.

4.2 Applications of Congruence

4.2.1 Leap-Year Formula


Let Y be the year. If Y ≡ 0 (mod 4), then Y is a leap year unless Y ≡ 0 (mod 100). In that case, Y
is not a leap year unless Y ≡ 0 (mod 400). Then Y is a leap year.

Example 35.

1. 2008 was a leap year because 2008 ≡ 0 (mod 4)

2. 2013 was not a leap year because 2013 6≡ 0 (mod 4)

3. 1900 was not a leap year because 1900 ≡ 0 (mod 100) but 1900 6≡ 0 (mod 400)

4. 2000 was a leap year because 2000 ≡ 0 (mod 100) and 2000 ≡ 0 (mod 400)

5. 2100 was not a leap year because 2100 ≡ 0 (mod 100) but 2100 6≡ 0 (mod 400)

4.2.2 Computing the Day of the Week


If a ∈ R, then there exists a unique integer m such that m ≤ a < m + 1. We call m as the floor of x
and is denoted by m = bac.

43
The formula that gives the day of the week for any date on the Gregorian calendar, known as Zeller’s
congruence, is given by
$ % $ % $ % !
13m − 1 y c
x≡ + + + d + y − 2c (mod 7)
5 4 4

where:

• x is the day of the week (x = 0 means the day is Sunday, x = 1 means the day is Monday, ...,
x = 6 means the day is Saturday);

• d is the day of the month;

• m is the month (m = 1 for March, m = 2 for April, m = 3 for May, ..., m = 10 for December,
m = 11 for January, and m = 12 for February);

• y is the last two digits of the year if the month is March through December; last two digits of
the year minus 1 if the month is January or February;

• c is the first two digits of the year

Example 36. Verify that November 4, 1987 was a Wednesday.

Solution: We have the following declarations:

d = 4; m = 9; y = 87 and c = 19.

Thus,
13m − 1 y c
„—  —  —  «
x ≡ + + + d + y − 2c ( mod 7)
$
5 4
% —  — 
4 !
13(9) − 1 87 19
x ≡ + + + (4) + (87) − 2(19) ( mod 7)
5 4 4
116 87 19
„—  —  —  «
x ≡ + + + 4 + 87 − 38 ( mod 7)
5 4 4
x ≡ ( 23 + 21 + 4 + 4 + 87 − 38 ) ( mod 7)
x ≡ ( 101 ) ( mod 7)
x ≡ ( 3 ) ( mod 7) :
Since x ≡ ( 3 ) ( mod 7) , then November 4, 1987 was a Wednesday.

44
4.2.3 Cryptology
Cryptology is the study of making and breaking secret codes. A plaintext is a message before it is
coded. A ciphertext is the message after it has been written in codes. The process of changing from
plaintext to ciphertext is called encryption. To decrypt a message means to take the ciphertext and
write it in plaintext. A cyclical coding scheme is a process of encrypting a plaintext to a ciphertext
by shifting each letter in the alphabet to some number of positions to obtain a substitute alphabet.
The following correspondence is the conventional assignment of the letters of the English alphabet with
the least residual classes of Z over congruence modulo 26.

A 7→ 1 G 7→ 7 M 7→ 13 S 7→ 19 Y 7→ 25
B 7→ 2 H 7→ 8 N 7→ 14 T 7→ 20 Z 7→ 0
C 7→ 3 I 7→ 9 O 7→ 15 U 7→ 21
D 7→ 4 J 7→ 10 P 7→ 16 V 7→ 22
E 7→ 5 K 7→ 11 Q 7→ 17 W 7→ 23
F 7→ 6 L 7→ 12 R 7→ 18 X 7→ 24

Example 37. Use the cyclical alphabetic encrypting code that shifts each letter 11 positions to

1. encode: CATHERINE THE GREAT

2. decode: TGLY ESP EPCCTMWP

Solution:
Let p and c be the respective corresponding values of a letter in the plaintext and the ciphertext.

1. To encode, shift the letters 11 positions ’forward.’ Thus, we can use c ≡ (p + 11) ( mod 26) .
For the plaintext CATHERINE THE GREAT, start with the letter C by using p = 3. Hence,
c = 14 implying that letter N will take its place.
For the last letter T, use p = 20. Hence, c ≡ 31 ( mod 26) implies c ≡ 5 ( mod 26) . Thus, E
will take its place.
Verify that the ciphertext is NLESPCTYP ESP RCPLE.

2. To decode, use p ≡ (c − 11) ( mod 26) to represent the ’backward’ shift. Be able to decode
TGLY ESP EPCCTMWP as IVAN THE TERRIBLE.
In addition, subtraction can be replaced by addition to represent a ’backward’ shift. Consider a
positive integer so that when added to 11, it becomes 0 under congruence modulo 26. A little
trial and error shows that it will be 15. Thus, one can use p ≡ (c + 15) ( mod 26) to decode.

45
Example 38. Use the congruence c ≡ (5p + 2) (mod 26) to encode the plaintext LASER PRINTER
and to decode the ciphertext QGN NGQAN.

Solution:

To encode LASER PRINTER, start with L. We have p = 12 to yield

c ≡ (5(12) + 2) ( mod 26)


c ≡ 62 ( mod 26)
c ≡ 10 ( mod 26) t:

Thus, it will be letter J. Continuing this, the ciphertext should become JGSAN DNUTXAN.

To decode, we will use a little of algebra for the linear equation c = 5p + 2. We have to counter
addition by 2 and multiplication by 5. Note that under addition modulo 26, the sum of 2 and 24 is 0.
Likewise, under multiplication modulo 26, the product of 5 and 21 is 1. Hence, we have

5p + 2 ≡ c ( mod 26)
(5p + 2) + 24 ≡ (c + 24) ( mod 26)
5p + (2 + 24) ≡ (c + 24) ( mod 26)
5p + 0 ≡ (c + 24) ( mod 26)
5p ≡ (c + 24) ( mod 26)
21 · 5p ≡ 21 · (c + 24) ( mod 26)
p ≡ 21 · (c + 24) ( mod 26) :

Use p ≡ 21(c + 24) ( mod 26) To decode QGN NGQAN as CAR RACER.

4.3 Divisibility Criteria


A positive integer N can be represented as follows
n
ai 10i ,
X
N = an 10n + an−1 10n−1 + an−2 10n−2 + : : : + a2 102 + a1 10 + a0 =
i=1

where ai ∈ {0; 1; 2; 3; 4; 5; 6; 7; 8; 9} and an 6= 0. We call this as the decimal representation of N.


Hence, we can view any positive integer as polynomial in terms of 10. From here, we establish some
basic divisibility tests.

46
Theorem 24
n
ci x i be a polynomial function of x with integral coefficients ci ; ∀i.
X
Let f (x) =
i=0
If a ≡ b ( mod m) , then f (a) ≡ f (b) ( mod m) .

Proof follows directly from Theorem 22.

Corollary 10

If a ≡ b ( mod n) and a is a solution of f (x) ≡ 0 ( mod m) , then b is also a solution of


f (x) ≡ 0 ( mod m) .

Theorem 25
m
ai 10i . Then
X
Let N =
i=0

1. 2|N ⇐⇒ a0 = 0; 2; 4; 6 or 8 4. 9|N ⇐⇒ 9|(a0 + a1 + a2 + : : : + an )

2. 5|N ⇐⇒ a0 = 0 or 5 5. 11|N ⇐⇒ 11| (a0 − a1 + a2 − a3 + : : :).


3. 3|N ⇐⇒ 3|(a0 + a1 + a2 + : : : + an )

m
ai 10i .
X
Proof. Let N =
i=0

1. We have

N ≡ (an 10n + an−1 10n−1 + an−2 10n−2 + : : : + a2 102 + a1 10 + a0 ) ( mod 2) .

Note that 10 ≡ 0 ( mod 2) . Thus,


“ ”
N ≡ an (0)n + an−1 (0)n−1 + an−2 (0)n−2 + : : : + a2 (0)2 + a1 (0) + a0 ( mod 2)
N ≡ a0 ( mod 2) :

Thus, 2|a0 . The only possible choices are a0 = 0, 2, 4, 6 or 8.

2. Proof is similar with (1).

3. We have

N ≡ (an 10n + an−1 10n−1 + an−2 10n−2 + : : : + a2 102 + a1 10 + a0 ) ( mod 3) .

47
Note that 10 ≡ 1 ( mod 3) . Thus,
“ ”
N ≡ an 10n + an−1 10n−1 + an−2 10n−2 + : : : + a2 102 + a1 10 + a0 ( mod 3)
N ≡ (an (1) + an−1 (1) + an−2 (1) + : : : + a2 (1) + a1 (1) + a0 ) ( mod 3)
N ≡ (a0 + a1 + a2 + : : : + an ) ( mod 3) :

Thus, 3|(a0 + a1 + a2 + : : : + an ).

4. Proof is similar with (3).

5. We have

N ≡ (an 10n + an−1 10n−1 + an−2 10n−2 + : : : + a2 102 + a1 10 + a0 ) ( mod 11) .

Note that 10 ≡ −1 ( mod 11) . Thus,


“ ”
N ≡ an (−1)n + : : : + a3 (−1)3 + a2 (−1)2 + a1 (−1) + a0 ( mod 11)
N ≡ (an (−1)n + : : : − a3 + a2 − a1 + a0 ) ( mod 11)
N ≡ (a0 − a1 + a2 − a3 : : : ( mod 3) :

Thus, 11| (a0 − a1 + a2 − a3 + : : :).

Exercise 4

1. Use the congruence c ≡ (3p + 5) (mod 26) to encode DANCE ALL NIGHT and decode ACXUT
CXRT.

2. Use the congruence c ≡ (7p + 11) (mod 26) to encode MATHEMATICS and decode
NURUVNUVFN.

3. Determine the day of the week on

a. July 4, 1776 U.S. (Declaration of Independence)


b. January 17, 1706 (Benjamin Franklin’s date of birth)
c. February 22, 1732 (George Washington’s date of birth)
d. March 7, 1876 (first telephone patent issued to Alexander Graham Bell)
e. October 24, 1945 (United Nations established)
f. July 16, 1945 (first atomic bomb detonation)

48
4. Find the remainder when 1! + 2! + 3! + 4! + : : : + 99! + 100! is divided by 12.

5. Find the remainder when

a. 1653 is divided by 7.
b. 4220 is divided by 65.

6. Find the units digit of

a. 3103
b. 778
c. 2512
d. 8456
e. 91019

7. Disregarding A.M. or P.M., if it is 5 o’clock now, what time was it

a. 57 hours from now?


b. 57 hours ago?

8. Find the day of the week in each case:

a. 234 days from Monday.


b. 365 days from Friday.
c. 1,776 days from Wednesday.
d. 2,076 days from Saturday.
e. 3 000 days from Sunday
m
ai 10i . Prove that if 4|N, then 4|(2a1 + a0 ).
X
9. Let N =
i=0

m
ai 10i . Prove that if 8|N, then 8|(4a2 + 2a1 + a0 ).
X
10. Let N =
i=0

49
Chapter 5

Number-Theoretic Functions

OVERVIEW
This chapter will contain discussions on some number theoretic functions: ff; fi and Euler-ffi
functions.

Learning Objectives
At the end of this chapter, the students are expected to:

1. Differentiate the ff and fi functions;

2. Illustrate some properties of multiplicative functions; and

3. State and prove some theorems on the Euler-ffi functions .

5.1 Multiplicative Functions

Definition 10
Given a positive integer n, let fi (n) denote the number of positive divisors of n and ff(n) denote
the sum of these divisors.

Example 39.

1. fi (12) = 6 and ff(12) = 1 + 2 + 3 + 4 + 6 + 12 = 28

2. fi (15) = 4 and ff(15) = 1 + 3 + 5 + 15 = 24

3. If n is prime, then fi (n) = 2 and ff(n) = n + 1.

4. If m and n are primes, then fi (mn) = 4 and ff(mn) = mn + m + n + 1.

50
Notation:
X
1. f (d) := “Sum of the values f (d) as d runs over all the positive divisors of n."
d|n
X
Example: f (d) = f (1) + f (2) + f (4) + f (5) + f (20)
d|20
X X
2. fi (n) = 1 and ff(n) = d
d|n d|n

Theorem 26
If n = p1k1 p2k2 · · · prkr is the prime factorization of n > 1, then the positive divisors of n are precisely
those integers d of the form
d = p1a1 p2a2 · · · prar ;

where 0 ≤ ai ≤ ki (i = 1; 2; : : : ; r ):

Example 40. Let n = 12 = 22 · 3. By Theorem 26, the following divisors of 12 are presented as

1 = 20 · 30
2 = 21 · 30
3 = 20 · 31
4 = 22 · 30
6 = 21 · 31
12 = 22 · 31 :

Theorem 27
If n = p1k1 p2k2 · · · prkr is the prime factorization of n > 1, then

1. fi (n) = (k1 + 1)(k2 + 2) · · · (kr + 1)

p1k1 +1 − 1 p2k2 +1 − 1 p kr +1 − 1
! ! !
2. ff(n) = ··· r
p1 − 1 p1 − 1 pr − 1

51
Example 41. Let n = 12 = 22 · 3. By Theorem 27, we have

fi (12) = ((2) + 1) · ((1) + 1)


fi (12) = 3 · 2
fi (12) = 6;

and
22+1 − 1 31+1 − 1
! !
ff(12) = ·
2−1 3−1
7 8
„ « „ «
ff(12) = ·
1 2
ff(12) = 28:

Definition 11
A number-theoretic function f is said to be multiplicative if and only if

f (mn) = f (m)f (n)

whenever gcd(m; n) = 1:

Theorem 28
The functions fi and ff are both multiplicative functions.

Example 42. Express 12 = 4 · 3. Note that g cd(4; 3) = 1, 4 = 22 and 3 = 31 . Thus,

fi (4) · fi (3) = (2 + 1) · (1 + 1)
fi (4) · fi (3) = 3 · 2
fi (4) · fi (3) = 6
fi (4) · fi (3) = fi (12);

and
22+1 − 1 31+1 − 1
! !
ff(4) · ff(3) = ·
2−1 3−1
7 8
„ « „ «
ff(4) · ff(3) = ·
1 2
ff(4) · ff(3) = 28
ff(4) · ff(3) = ff(12):

52
Lemma 2
If gcd(m; n) = 1; then the set of positive divisors of mn consists of all products d1 d2 ; where
d1 |n; d2 |m; and gcd(d1 ; d2 ) = 1; furthermore, these products are all distinct.

Theorem 29
If f is a multiplicative function and F is defined by
X
F (n) = f (d);
d|n

then F is also multiplicative.

Example 43. One may verify that


X
F (3 · 4) = f (d) = F (3) · F (4),
d|12

implying that F is multiplicative.

5.2 Euler Phi Function

Definition 12
For n ≥ 1; let ffi(n) denote the number of positive integers not exceeding n that are relatively
prime to n:

Example 44.

1. ffi(1) = 1; ffi(2) = 1; ffi(3) = 2; ffi(4) = 2; ffi(5) = 4; ffi(6) = 2; ffi(7) = 6

2. For 30, the integers 1, 7, 11, 13, 17, 19, 23, 29 are all relatively prime with 30. Thus, ffi(30) = 8.

3. If n is prime, then ffi(n) = n − 1.

53
Theorem 30
If p is prime and k > 0, then
!
k k k−1 k 1
ffi(p ) = p − p =p 1−
p

Example 45. We have ffi(27) = ffi(33 ) = 33 − 32 = 18. Thus, there are 18 integers that are less than
27 and relatively prime with it, namely: 1, 2, 4, 5, 7, 8, 10, 11, 13, 14, 16, 17, 19, 20, 22, 23, 25 and
26.

Lemma 3
Given integers a; b; and c: gcd(a; bc) = 1 if and only if gcd(a; b) = 1 and gcd(a; c) = 1:

Theorem 31
The function ffi is a multiplicative function.

Theorem 32
If n = p1k1 p2k2 · · · prkr is the prime factorization of n > 1, then

ffi(n) = (p1k1 − p1k1 −1 )(p2k2 − p2k2 −1 ) · · · (prkr − prkr −1 )


! ! !
1 1 1
=n 1− 1− ··· 1 −
p1 p2 pr

Example 46. Calculate ffi(360):

Solution:
Since 360 = 23 · 32 · 5, then

1 1 1
„ «„ «„ «
ffi(360) = 360 1 − 1− 1−
2 3 5
1 2 4
„ «„ «„ «
ffi(360) = 360
2 3 5
ffi(360) = 96:

54
Theorem 33
For n > 2; ffi(n) is an even integer.

This is due to the fact that (piki − piki −1 ) is always even, for any i.

Lemma 4
Let n > 1 and gcd(a; n) = 1. If a1 ; a2 ; : : : ; affi(n) are the positive integers less than n and relatively
prime to n, then
aa1 ; aa2 ; : : : ; aaffi(n)

are congruent modulo n to a1 ; a2 ; : : : ; affi(n) in some order.

Theorem 34: Euler’s Theorem


If n is a positive integer and gcd(a; n) = 1, then affi(n) ≡ 1 (mod n)

Corollary 11: Fermat’s Theorem

If p is a prime and p - a, then ap−1 ≡ 1 (mod n)

Example 47. Consider 4 and 15 as relatively prime integers.


With
1 1
„ «„ «
ffi(15) = 15 1 − 1−
3 5
2 4
„ «„ «
ffi(15) = 15
3 5
ffi(15) = 8:
Now, we have 4 ≡ 4 ( mod 15) and 16 ≡ 1 ( mod 15) . Thus,
“ ”4
48 ≡ 42 ( mod 15)
48 ≡ (1)4 ( mod 15)
48 ≡ (1) ( mod 15) :

55
Theorem 35: Gauss’ Theorem
For each positive integer n ≥ 1,
X
n= ffi(d);
d|n

the sum being extended over all positive divisors of n:

Example 48. Let n = 12. Then,


X
ffi(d) = ffi(1) + ffi(2) + ffi(3) + ffi(4) + ffi(6) + ffi(12)
d|12
1 1 1 1 1 1 1
X » „ «– » „ «– » „ «– » „ «„ «– » „ «„ «–
ffi(d) = [1] + 2 1 − + 3 1− + 4 1− + 6 1− 1− + 12 1 − 1−
d|12
2 3 2 2 3 2 3
X
ffi(d) = 1 + 1 + 2 + 2 + 2 + 4
d|12
X
ffi(d) = 12:
d|12

Exercise 5

I. Evaluate the following integers at fi; ff and ffi-functions.

1. 90 4. 840
2. 150 5. 1200
3. 450

II. Do as indicated.

1. If p is prime, then determine fi (8p 2 ) and ff(8p 2 ).


2. Find the smallest positive integer n so that ff(x) = n has no solutions; exactly one solution;
exactly two solutions.
3. Determine ffi(100). List all such integers.
4. Show that ffi(2k ) = 2k .
5. Apply Euler’s Theorem for the integers 6 and 25.

56
Chapter 6

Primitive Roots and Indices

OVERVIEW
This chapter contains discussions on modular order, primitive roots for prime and composites and
theory of indices.

Learning Objectives
At the end of this chapter, the students are expected to:

1. Determine the modular order of an integer and establish related properties;

2. Relate primitive roots with prime and composite numbers; and

3. Define indices and prove properties related to indices .

6.1 The order of an integer modulo n

Definition 13
Let n > 1 and gcd(a; n) = 1. The order of a modulo n is the smallest positive integer k such
that ak ≡ 1 (mod n)

Example 49. Consider the integers 1, 3, 5 and 7 that are all relatively prime with 8.

a ak ≡ 1 ( mod 8) order of a
1
1 (1) ≡ 1 ( mod 8) 1
3 (3)2 ≡ 1 ( mod 8) 2
2
5 (5) ≡ 1 ( mod 8) 2
7 (7)2 ≡ 1 ( mod 8) 2

57
Theorem 36
Let the integer a have order k modulo n. Then ah ≡ 1 (mod n) if and only if k | h; in particular,
k | ffi(n):

1
„ «
Example 50. In reference to the previous example, ffi(8) = 8 1 − = 4. Observe that the orders
2
of 1, 3, 5 and 7 are divisors of 4.

Theorem 37
If a has order k modulo n, then ai ≡ aj (mod n) if and only if i ≡ j (mod k).

Example 51. Note that 5 has order 2 modulo 8.


With 52 = 25 and 54 = 625, then 25 ≡ 625 ( mod 2) since 2 ≡ 4 ( mod 2) .
Also, with 53 = 125 and 55 = 3125, then 125 ≡ 3125 ( mod 2) since 3 ≡ 5 ( mod 2) .

Corollary 12

If a has order k modulo n, then the integers a; a2 ; : : : ; ak are incongruent modulo n:

Example 52. Note that 5 has order 2 modulo 8. With 52 = 25 and 53 = 125, then 25 6≡ 125 mod 8.

Theorem 38
k
If a has order k modulo n and h > 0, then ah has order modulo n:
gcd(h; k)

Corollary 13

Let a have order k modulo n. Then ah also has order k if and only if gcd(h; k) = 1:

Example 53. Note that 5 has order 2 modulo 8.


2 2
Let h = 5. Thus, 55 = 3125 has order = = 2 modulo 8.
gcd(5; 2) 1
2 2
Let h = 4. Thus, 54 = 625 has order = = 1 modulo 8.
gcd(4; 2) 2

58
6.2 Primitive Roots for Primes

Definition 14
If gcd(a; n) = 1 and a is of order ffi(n) modulo n, then a is a primitive root of n

Example 54. Consider the integers 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 and 12 under congruence modulo
13.
a order of a a order of a a order of a
1 1 5 4 9 3
2 12 6 12 10 6
3 3 7 12 11 12
4 6 8 4 12 2

Based on the table above, we have 2, 6, 7 and 11 as primitive roots of 13.

Theorem 39
Let gcd(a; n) = 1 and let a1 ; a2 ; : : : ; affi(n) be the positive integers less than n and relatively prime
to n. If a is a primitive root of n, then

a; a2 ; : : : ; affi(n)

are congruent modulo n to a1 ; a2 ; : : : ; affi(n) ; in some order.

Example 55. Consider 2 as a primitive root of 13. The powers of 2 are expressed as follows:

21 = 2 ≡ 2 ( mod 13) 26 = 64 ≡ 12 ( mod 13) 211 = 2048 ≡ 7 ( mod 13)


22 = 4 ≡ 4 ( mod 13) 27 = 128 ≡ 11 ( mod 13) 212 = 4096 ≡ 1 ( mod 13)
23 = 8 ≡ 8 ( mod 13) 28 = 256 ≡ 9 ( mod 13)
24 = 16 ≡ 3 ( mod 13) 29 = 512 ≡ 5 ( mod 13)
25 = 32 ≡ 6 ( mod 13) 210 = 1024 ≡ 10 ( mod 13)

The powers of 2, namely: 2, 4, 8, 3, 6, 12, 11, 9, 5, 10, 7 and 1.

59
Corollary 14

If n has a primitive root, then it has exactly ffi(ffi(n)) of them.

Example 56. We have


1
„ „ ««
ffi(ffi(13)) = ffi 13 1 −
13
12
„ „ ««
ffi(ffi(13)) = ffi 13
13
ffi(ffi(13)) = ffi(12)
1 1
„ «„ «
ffi(ffi(13)) = 12 1 − 1−
2 3
ffi(ffi(13)) = 4:
Indeed, 13 has 4 primitive roots.

Theorem 40: Lagrange’s Theorem


If p is a prime and

f (x) = an x n + an−1 x n−1 + · · · + a1 x + a0 ; an 6≡ 0 (mod p)

is polynomial of degree n ≥ 1 with integral coefficients, then the congruence

f (x) ≡ 0 (mod p)

has at most n incongruent solutions modulo p:

Example 57. Consider the polynomial congruence x 2 − 5x + 6 ≡ 0 ( mod 7) . We have either x ≡


2 ( mod 7) or x ≡ 3 ( mod 7) . Indeed, there are at most two incongruent solutions modulo 7.

Corollary 15

If p is a prime number and d | p − 1, then the congruence

x d − 1 ≡ 0 (mod p)

has exactly d solutions.

Example 58. Given the prime number 7. Take 2 and 3 as the divisors d of 6 = 7 − 1.
The congruence x 2 − 1 ≡ 0 ( mod 7) has exactly two solutions, namely 1 and 6.
The congruence x 3 − 1 ≡ 0 ( mod 7) has exactly three solutions, namely 1, 2 and 4.

60
Theorem 41
If p is a prime number and d | p − 1, then there are exactly ffi(d) incongruent integers having
order d modulo p:

Example 59. Given the prime number 7. Take 2 and 3 as the divisors d of 6 = 7 − 1.
For d = 2, we have ffi(2) = 1. There is a unique integer with order 2 modulo 7, namely 6.
For d = 3, we have ffi(3) = 2. There is are two incongruent integers with order 3 modulo 7, namely 2
and 4.

Corollary 16

If p is prime, then there are exactly ffi(p − 1) incongruent primitive roots of p:

Example 60. Consider the prime number 7. We have


1 1
„ «„ «
ffi(7 − 1) = ffi(6) = 6 1 − 1− = 2.
2 3
There are two incongruent primitive roots of 7. In fact, these are 3 and 5. Note that 36 ≡ 1 ( mod 7) ,
56 ≡ 1 ( mod 7) and 3 6≡ 5 mod 7.

6.3 Composite Numbers Having Primitive Roots

Theorem 42
For k ≥ 3; the integer 2k has no primitive roots.

Example 61. Consider 23 = 8. The only integers that are relatively prime with 8 and less than 8 are
1, 3, 5 and 7. Also,
1 ≡ 1 ( mod 8)
32 ≡ 1 ( mod 8)
52 ≡ 1 ( mod 8)
72 ≡ 1 ( mod 8) :
1
„ «
But, ffi(8) = 8 1 − = 4. Since, none of the four integers have an order 4, then 8 has no primitive
2
roots.

61
Theorem 43
If gcd(m; n) = 1, where m > 2 and n > 2, then the integer mn has no primitive roots.

Corollary 17
The integer n fails to have a primitive root if either

1. n is divisible by two odd primes, or

2. n is of the form n = 2m p k , where p is an odd prime and m ≥ 2:

Example 62.

1. Consider the integer 15 = 3 · 5. The only integers that are relatively prime with 15 and less than
15 are 1, 2, 4, 7, 8, 11, 13 and 14. Also,

1 ≡ 1 ( mod 15)
24 ≡ 1 ( mod 15)
42 ≡ 1 ( mod 15)
74 ≡ 1 ( mod 15)
84 ≡ 1 ( mod 15)
112 ≡ 1 ( mod 15)
134 ≡ 1 ( mod 15)
142 ≡ 1 ( mod 15) :

1 1
„ «„ «
Since, ffi(15) = 15 1 − 1− = 8. None of these integers have order 8. Therefore, 15
3 5
has no primitive roots.

2. Consider the integer 12 = 22 · 3. The only integers that are relatively prime with 12 and less than
12 are 1, 5, 7 and 11. Also,
1 ≡ 1 ( mod 12)
52 ≡ 1 ( mod 12)
72 ≡ 1 ( mod 12)
112 ≡ 1 ( mod 12) :
1 1
„ «„ «
Since, ffi(12) = 12 1 − 1− = 4. one of these integers have order 4. Therefore, 12 has
2 3
no primitive roots.

62
Lemma 5
If p is an odd prime, then there exists a primitive root r of p such that r p−1 6≡ 1 (mod p 2 ):

Corollary 18

If p is an odd prime, then p 2 has a primitive root; in fact, for a primitive root r of p, either r or
r + p is a primitive root of p 2 :

Example 63. Consider p = 7 and p 2 = 49. It is exhibited earlier that 3 and 5 are primitive roots of 7.
It can be validated that 37−1 6≡ 1 mod 49 and 57−1 6≡ 1 mod 49, as guided by the previous lemma.
Moreover, it can be verified that 3, 5, 3 + 7 = 10 and 5 + 7 = 12 are primitive roots of 49 as guided
by the previous corollary.

Lemma 6
Let p be an odd prime and r be a primitive root of p such that r p−1 6≡ 1 (mod p 2 ): Then for
each positive integer k ≥ 2;
k−2
r p (p−1) 6≡ 1 (mod p k ):

Theorem 44
If p is an odd prime and k ≥ 1, then there exists a primitive root for p k :

Corollary 19

There are primitive roots for 2p k ; where p is an odd prime and k ≥ 1:

Example 64.
1
„ «
1. Consider 27 = 33 . Since, ffi(27) = 27 1 − = 18, it can be verified that 21 8 ≡ 1 ( mod 27) .
3
Thus, 2 is a primitive root of 27.
1 1
„ «„ «
2. Consider 18 = 2 · 32 . Since, ffi(18) = 18 1 − 1− = 6, it can be verified that 56 ≡
2 3
1 ( mod 18) . Thus, 5 is a primitive root of 18.

63
Theorem 45
An integer n > 1 has a primitive root if and only if

n = 2; 4; p k ; or 2p k

where p is an odd prime.

Example 65.

1. 4 has 3 as its primitive root since ffi(4) = 2 and 32 ≡ 1 ( mod 4) .

2. 30 has no primitive root since it is neither a power of an odd prime nor a product of 2 and a
power of an odd prime.

6.4 Theory of Indices

Definition 15
Let r be a primitive root of n. If gcd(a; n) = 1, then the smallest positive integer k such that
a ≡ r k (mod n) is called the index of a relative to r .

Example 66. Recall that 13 has the following primitive roots: 2, 6, 7 and 11. Consider the integer 5
being relatively prime with 13. Note that 5 ≡ 29 ( mod 13) , 5 ≡ 69 ( mod 13) , 5 ≡ 73 ( mod 13) and
5 ≡ 113 ( mod 13) . Thus, the index of 5 is 9 relative to 2 and 6. Also, the index of 5 is 3 relative to 7
and 11.

Theorem 46
If n has a primitive root r and ind a denotes the index of a relative to r , then

1. ind (ab) ≡ ind a + ind b (mod ffi(n));

2. ind (ak ) ≡ k ind a (mod ffi(n)); for k > 0;

3. ind 1 ≡ 0(mod ffi(n)) and ind r ≡ 1(mod ffi(n)):

Example 67. Recall that 2 is a primitive root of 13. Consider that 5 and 9 are relatively prime with
13. Verify that 5 ≡ 29 ( mod 13) , 9 ≡ 28 ( mod 13) and ffi(13) = 12. Hence, ind 5 = 9 and ind 9 = 8
relative to 2.

64
We have the following

1. The index of 45 modulo ffi(13) is given as

ind 45 ≡ ind(5 · 9) ( mod ffi(13))


ind 45 ≡ ind 5 + ind 9 ( mod 12)
ind 45 ≡ 9 + 8 ( mod 12)
ind 45 ≡ 17 ( mod 12)
ind 45 ≡ 5 ( mod 12) :

Note that 45 ≡ 6 ≡ 25 ( mod 13) .

2. The index of 125 modulo ffi(13) is given as

ind 125 ≡ ind(53 ) ( mod ffi(13))


ind 125 ≡ 3ind5 ( mod 12)
ind 125 ≡ 3 · 9 ( mod 12)
ind 125 ≡ 27 ( mod 12)
ind 125 ≡ 3 ( mod 12) :

Note that 125 ≡ 8 ≡ 23 ( mod 13) .

3. We have ind 1 ≡ 0 ( mod 12) and ind 2 ≡ 1 ( mod 12) .

Theorem 47
Let n be an integer possessing a primitive root and let gcd(a; n) = 1. Then the congruence
x k ≡ a (mod n) has a solution if and only if

affi(n)=d ≡ 1 (mod n);

where d =gcd(k; ffi(n)); if it has a solution, there are exactly d solutions modulo n:

Corollary 20: (Euler)

Let p be a prime and gcd(a; p) = 1. Then the congruence x k ≡ a (mod p) has a solution if and
only if a(p−1)=d ≡ 1 (mod p) where d =gcd(k; p − 1):

65
Example 68. Recall that 13 has primitive roots, namely: 2, 6, 7 and 11. Also, ffi(13) = 12.
Let a = 5. Note that g cd(5; 13) = 1. By Theorem 47, the congruence x 9 ≡ 5 ( mod 13) has a solution
ffi(13)
if and only if 5 3 = 54 ≡ 1 ( mod 13) , where 3 = gcd(9, 12).
Moreover, there are exactly three solutions to x 9 ≡ 5 ( mod 13) , namely: 2, 5 and 6.

Exercise 6

I. Determine the order of the given integer a under the indicated the congruence modulo n.

1. a = 6; n = 9 4. a = 12; n = 16
2. a = 8; n = 11 5. a = 11; n = 18
3. a = 5; n = 14

II. Find all the primitive roots of the following integers.

1. 19 4. 50
2. 24 5. 81
3. 25

III. Solve the following congruences.

1. x 9 ≡ 12 ( mod 13) 4. x 4 ≡ 2 ( mod 17)


2. x 3 ≡ 1 ( mod 13) 5. x 9 ≡ 8 ( mod 13)
3. x 3 ≡ 3 ( mod 17)

66
Chapter 7

Quadratic Reciprocity Law

OVERVIEW
This chapter discusses the quadratic residues and nonresidues, and relates its concepts with the
Legendre function and the quadratic reciprocity.

Learning Objectives
At the end of this chapter, the students are expected to:

1. Differentiate quadratic residues and quadratic nonresidues;

2. Evaluate the Legendre function to determine quadratic residues; and

3. Apply quadratic reciprocity law in evaluating the Legendre function .

7.1 Euler’s Criterion

Definition 16
Let p be an odd prime and gcd(a; p) = 1: If the congruence x 2 ≡ a (mod p) has a solution, then
a is said to be a quadratic residue of p. Otherwise, a is called a quadratic nonresidue of p:

Example 69. Let p = 7. Consider the following squares:

12 ≡ 1 ( mod 7) 32 ≡ 2 ( mod 7) 52 ≡ 4 ( mod 7)


22 ≡ 4 ( mod 7) 42 ≡ 2 ( mod 7) 62 ≡ 1 ( mod 7)

Thus, 1, 2 and 4 are quadratic residues of 7. Also, 3, 5 and 6 are quadratic nonresidues of 7.

67
Theorem 48: Euler’s Criterion
Let p be an odd prime and gcd(a; p) = 1: Then a is a quadratic residue of p if and only if
a(p−1)=2 ≡ 1 (mod p):

Corollary 21

Let p be an odd prime and gcd(a; p) = 1: Then

1. a is a quadratic residue of p if and only if a(p−1)=2 ≡ 1 (mod p)

2. a is a quadratic nonresidue of p if and only if a(p−1)=2 ≡ −1 (mod p).

Example 70. Determine the quadratic residues and nonresidues of 7.

Solution:
By corollary of Euclid’s criterion,
7−1
1 2 = 1 ≡ 1 ( mod 7)
7−1
2 2 = 8 ≡ 1 ( mod 7)
7−1
3 2 = 27 ≡ 6 ≡ −1 ( mod 7)
7−1
4 2 = 64 ≡ 1 ( mod 7)
7−1
5 2 = 125 ≡ 6 ≡ −1 ( mod 7)
7−1
6 2 = 216 ≡ 6 ≡ −1 ( mod 7) :

Thus, by corollary of Euclid’s Criterion, 1, 2 and 4 are the quadratic residues of 7, while, 3, 5 and 6 are
the quadratic nonresidues of 7.

68
7.2 Legendre Symbol

Definition 17: Legendre Symbol


!
a
Let p be and odd prime and gcd(a; p) = 1: The Legendre symbol (a=p) or is defined by
p
8
>
>
< 1; if a is a quadratic residue of p
(a=p) = >
:−1;
>
if a is a quadratic nonresidue of p

Example 71.

1. (1=13) = (3=13) = (4=13) = (9=13) = (10=13) = (12=13) = 1

2. (2=13) = (5=13) = (6=13) = (7=13) = (8=13) = (11=13) = −1

Theorem 49
Let p be an odd prime and a and b be integers which are relatively prime to p: Then the Legendre
symbol has the following properties:

1. If a ≡ b (mod p); then (a=p) = (b=p):

2. (a2 =p) = 1

3. (a=p) ≡ a(p−1)=2 (mod p)

4. (ab=p) = (a=p)(b=p)

5. (1=p) = 1 and (−1=p) = (−1)(p−1)=2

Example 72. Note that 2 ≡ −5 ( mod 7) .

1. We have 7−1
2 2 = 8 ≡ 1 ( mod 7) ; and
7−1
(−5) 2 = −125 ≡ 1 ( mod 7) :
Thus, (2=7) = (−5=7):
7−1
2. Observe that 42 = 16 and 16 2 = 4096 ≡ 8 ≡ 1 ( mod 7) . Thus, (42 =7) = 1.

69
3. Note that
7−1
(2 · (−5)) 2 ≡ (−10)3 ( mod 7)
7−1
(2 · (−5)) 2 ≡ −1000 ( mod 7)
7−1
(2 · (−5)) 2 ≡ 1 ( mod 7) :
Also, (2=7)(−5=7) = 1 · 1 = 1 = ((2 · −5)=7).
7−1 7−1
4. We have 1 2 ≡ 1 ( mod 7) and (−1) 2 ≡ −1 ( mod 7) . (1=7) = 1 and (−1=7) = −1.

Corollary 22
if p is an odd prime, then
8
>
< 1; if p ≡ 1 (mod 4)
(−1=p) = >
:−1; if p ≡ 3 (mod 4)

Example 73.

1. Let p = 7. Since, 7 ≡ 3 ( mod 4) , then (−1=7) = −1.

2. Let p = 13. Since, 13 ≡ 1 ( mod 4) , then (−1=7) = 1.

Theorem 50
There are infinitely many primes of the form 4k + 1.

Theorem 51
If p is and odd prime, then
p−1
X
(a=p) = 0:
a=1

hence, there are precisely (p − 1)=2 quadratic residues and (p − 1)=2 quadratic nonresidues of p:

70
Example 74. Let p = 7. Thus, (1=7) = (2=7) = (4=7) = 1 and (3=7) = (5=7) = (6=7) = −1. Thus,

6
X
(a=7) = (1=7) + (2=7) + (3=7) + (4=7) + (5=7) + (6=7)
a=1
X6
(a=7) = (1) + (1) + (−1) + (1) + (−1) + (−1)
a=1
X6
(a=7) = 0:
a=1

Corollary 23
The quadratic residues of an odd prime p are congruent modulo p to the even powers of a
primitive root r of p; the quadratic nonresidues are congruent to the odd powers of r:

Example 75. Let p = 7, where 3 is a primitive root of 7 since 36 ≡ 1 ( mod 7) .


We have

31 ≡ 3 ( mod 7) 33 ≡ 6 ( mod 7) 35 ≡ 5 ( mod 7)


32 ≡ 2 ( mod 7) 34 ≡ 4 ( mod 7) 36 ≡ 1 ( mod 7) .

Thus, the quadratic residues of 7 are the even powers of 3, namely: 2, 4 and 1. Also, the quadratic
nonresidues of 7 are the odd powers of 3, namely: 3, 6 and 5.

Theorem 52: Gauss’ Lemma


Let p be an odd prime and let gcd(a; p) = 1. If n denotes the number of integers in the set

p−1
 „ « ff
S = a; 2a; 3a; : : : ; a
2

whose remainders upon division by p exceed p=2, then

(a=p) = (−1)n :

Example 76. Let p = 13 and a = 5: Then (p − 1)=2 = 6; so that S = {5; 10; 15; 20; 25; 30}. By
modulo 13, then S = {5; 10; 2; 7; 12; 4}. Three of these are greater than (p −1)=2 = 13=2 = 6. Hence,
n = 3 and by Theorem 43, (5=13) = (−1)3 = −1.

71
Theorem 53
If p is an odd prime, the
8
>
< 1; if p ≡ 1 (mod 8) or p ≡ 7 (mod 8)
(2=p) = >
:−1; if p ≡ 3 (mod 8) or p ≡ 5 (mod 8):

Example 77.

1. Let p = 11. Since, 11 ≡ 3 ( mod 8) , then (2=11) = −1.

2. Let p = 13. Since, 13 ≡ 5 ( mod 8) , then (2=13) = −1.

3. Let p = 17. Since, 17 ≡ 1 ( mod 8) , then (2=17) = 1.

4. Let p = 31. Since, 31 ≡ 7 ( mod 8) , then (2=31) = 1.

Corollary 24
2 −1)=8
If p is an odd prime, then (2=p) = (−1)(p .

Example 78.
112 −1
1. Let p = 11. Since, (2=11) = (−1) 8 = −1
132 −1
2. Let p = 13. Since, (2=13) = (−1) 8 = −1.
172 −1
3. Let p = 17. Since, (2=17) = (−1) 8 = 1.
312 −1
4. Let p = 31. Since, (2=31) = (−1) 8 = 1.

Theorem 54
If p and 2p + 1 are both odd primes, then the integer (−1)(p−1)=2 2 is a primitive root of 2p + 1:

Theorem 55
There are infinitely many primes of the form 8k − 1.

Example 79. Consider p = 3 and 2p + 1 = 7. We have (−1)((3)−1)=2 2 = −2 and −2 ≡ 5 ( mod 7) .


With ffi(7) = 6 and 56 ≡ 1 ( mod 7) , then 5 is a primitive root of 7.

72
7.3 Quadratic Reciprocity

Theorem 56: Quadratic Reciprocity Law


If p and q are distinct odd primes, then

p−1 q−1
(p=q)(q=p) = (−1) 2 2 :

Example 80. Consider p = 5 and p = 7. We have


7−1 5−1
(5=7) = 5 2 = 125 ≡ 6 ≡ −1 ( mod 7) and (7=5) = 7 2 = 49 ≡ 4 ≡ −1 ( mod 5) .
Also,
5−1 7−1
(−1) 2 2 = (−1)6 = 1 = (−1)(−1) = (5=7)(7=5).

Corollary 25
If p and q are distinct odd primes, then
8
1; if p ≡ 1 (mod 4) or q ≡ 1 (mod 4)
>
<
(p=q)(q=p) = >
:−1; if p ≡ q ≡ 3 (mod 4):

Example 81. Consider p = 5 and p = 7. Since, 5 ≡ 1 ( mod 4) and 7 ≡ 3 ( mod 4) , then


(5=7)(7=5) = 1.

Corollary 26
If p and q are distinct odd primes, then
8
>
< (q=p); if p ≡ 1 (mod 4) or q ≡ 1 (mod 4)
(p=q) =
:−(q=p);
>
if p ≡ q ≡ 3 (mod 4):

Example 82. Consider the Legendre symbol (29=53): Since 29 ≡ 1 (mod 4) and 53 ≡ 1 (mod 4), we
see that
(29=53) = (53=29)
= (24=29)
= (2=29)(3=29)(4=29)
= (2=29)(3=29)

73
By Theorem 44, (2=29) = −1, while inverting again, (3=29) = (29=3) = (2=3) = −1, where we used
the congruence 29 ≡ 2 (mod 3). Therefore, (29=53) = (2=29)(3=29) = (−1)(−1) = 1:

Theorem 57
If p 6= 3 is an odd prime, the
8
>
< 1; if p ≡ ±1 (mod 12)
(3=p) =
:−1;
>
if p ≡ q ≡ ±5 (mod 12):

Example 83. Let p = 23. Since, 23 ≡ −1 ( mod 12) , then (3=23) = 1. Note that
23−1
3 2 = 31 1 ≡ 1 ( mod 23) .

Exercise 7

I. List the quadratic and nonquadratic residues of the following.

1. 13 4. 23
2. 17 5. 29
3. 19

II. Simplify the following.

1. (2/11) 6. (5/19)
2. (8/11) 7. (-7/23)
3. (7/13) 8. (11/23)
4. (12/13) 9. (6/31)
5. (-43/17) 10. (66/89)

74
First Quiz

MATH 2213: NUMBER THEORY


Long Exam 1: Divisibility in the Integers and Prime Numbers

Surname, Given Name, M.I.:

Course, Year and Section:

Date:

Raw Score Possible Score

I 22

II 18

II 15

Total 55

75
I. Write O if the statement is true and X if otherwise, on the space provided. [2 points each]

1. For any a; b ∈ Z, then there exists an n ∈ N such that na ≥ b.


2. If a | c and b | c, where a; b; c ∈ N, then ab | c.
3. There is no remainder when an even integer is divided by 2.
4. If a | b, where a; b ∈ Z, then |a| ≤ |b|.
ab
5. If a; b ∈ N, then gcd(a; b) = .
lcm(a; b)
a b
6. If gcd(a; b) = d, then and are relatively prime.
d d
7. A positive integer is called prime if its only positive divisors are 1 and itself.
8. Every integer n ≥ 2 has a prime factor.
9. If lcm(a; b) = ab and lcm(b; c) = bc, then lcm(a; c) = ac
10. Every positive integer can be expressed as a product of primes.

11. If an integer n > 1 is not divisible by a prime p ≤ n, then n is prime.

II. Mechanical. Show all necessary solutions for full credit and ENCLOSE YOU FINAL AN-
SWER.

1. Find the gcd and lcm of the following. [4 points each]


(a) 1076 and 5076

76
(b) 1024 and 15625

2. Find the general solution using Euclidean Algorithm and Backward Euclidean Algorithm.
(a) 2076x + 1776y = 108 [5 points]

77
(b) 2024x + 1024y = 96 [5 points]

78
Second Quiz

MATH 2213: NUMBER THEORY


Long Exam 2: Congruences and its Applications

Surname, Given Name, M.I.:

Course, Year and Section:

Date:

Raw Score Possible Score

I 18

II 22

III 10

Total 50

79
I. Write O if the statement is true and X if otherwise, on the space provided. [2 points each]

1. Every integer is congruent to exactly one of the least residues 0; 1; 2; :::; n − 1


modulo n.
2. The set of integers Z can be partitioned into n nonempty pairwise disjoint classes,
called congruence classes modulo n.
3. Every palindrome number is divisible by 11.
4. The square of every odd integer is congruent to 1 modulo 4.
5. If today is Monday, then it will be Tuesday in 1976 days.
6. If ac ≡ bc(mod n), then a ≡ b(mod n).
7. If ab ≡ 0(mod n), then either a ≡ 0(mod n) or b ≡ 0(mod n).
8. If p is prime, then ap ≡ a(mod p) for any a ∈ Z:
9. If p is prime and gcd(a; p) = 1, then x ≡ ap−2 b(mod p) is a solution of the linear
congruence ax ≡ b(mod p).

II. Mechanical. Show all necessary solutions for full credit.

1. Find the remainder when 1! + 2! + 3! + ::: + 98! + 99! + 100! is divided by 15. [3 points]

80
2. Find the remainder when 72002 is divided by 19. [3 points]

3. Find the remainder when 23243 is divided by 17. [3 points]

81
4. Solve the linear congruence 12x ≡ 48(mod 18). [4 points]

5. Using the given formula, determine the day of your birth.

82
Third Quiz

MATH 2213: NUMBER THEORY


Long Exam 3: Number Theoretic Functions

Surname, Given Name, M.I.:

Course, Year and Section: Date:

Raw Score Possible Score

I 20

II 24

III 16

Total 60

83
I. Write O if the statement is true and X if otherwise, on the space provided. [2 points each]

1. If f is multiplicative, then f (mn) = f (m)f (n) for every m; n ∈ N:


X
2. If F is multiplicative and F (n) = f (d), then f is also multiplicative.
d|n

3. If n > 1 is composite, then ffi(n) ≤ n − 2:


4. Multiplicative functions are completely determined once their values at prime
powers are known.
5. If m; n ∈ N, then every divisor d = d1 d2 of mn can be uniquely written such
that d1 |m and d2 |n:
6. The product of the positive divisors of n > 1 is equal to nfi (n) .
7. A positive integer n is said to be per f ect if n is equal to the sum of all its
positive divisors.
m ffi(m)
„ «
8. Let m; n ∈ N: Then ffi = where m = nk; k ∈ N:
n ffi(n)
9. If f is a multiplicative function not identically zero, then f (1) = 1:
10. Let n ∈ N. Then ff(n) is odd if and only if n is a perfect square or twice a
perfect square.

II. Mechanical. ENCLOSE YOUR FINAL ANSWER.

1. Compute the following. [3 points each]


(a) fi (6120)

(b) ff(6120)

(c) ffi(6120)

84
2. Let n = p1 p2 p3 · · · pr be a product of r distinct primes. Determine the ff.: [3 points each]
(a) fi (n)

(b) ff(n)

(c) ffi(n)

85
III. Prove.

1. Define the function  by


8
<1;
>
> if n = 1
(n) =
if n > 1 and n = p1k1 p2k2 · · · prkr is the prime factorization of n:
>
:2r ;
>

(a) Compute (360). [3 points]

(b) Prove that  is a multiplicative function. [5 points]

86
Final Examination

MATH 2213: NUMBER THEORY


Final Examination

Surname, Given Name, M.I.:

Course, Year and Section:

Student number:

General Instructions: Encircle the letter that corresponds to your choice of answer. Use only black
or blue-inked pen. Any form of ERASURE is considered INCORRECT. If your answer is NOT
among the choices, then write your preferred answer on the left side of the item number. Use the back
pages for scratch. You may use your calculator in this exam. [2 points each]

a
1. “Let a and b be any positive integers. Then there is a positive integer n such that n ≥ ."
b
is commonly known as
(a) Well-Ordering Principle (c) Archimedean Property

(b) Division Algorithm (d) Fundamental Theorem of Arithmetic

2. If a; b; c ∈ Z, which of the following DOES NOT hold?


(a) If a|b, then |a| ≤ |b|. (c) If a|b and b|c, then a|c.

(b) a|0; ∀ a 6= 0: (d) a|b and b|a if and only if a = ±b.

87
3. Let gcd(a; b) = d, where a; b ∈ Z; a; b 6= 0. Which of the following is FALSE?
(a) d|a and d|b. (c) d = ax + by , for some x; y ∈ Z.
!
a b
(b) If c|a and c|b, then c ≥ d. (d) gcd ; = 1.
d d
4. Euclid’s Lemma states that:

(a) If a|c and b|c, with gcd(a; b) = 1, then ab|c.


(b) If a|bc, with gcd(a; b) = 1, then a|c.
(c) If a|b and a|c, then a|(bx + cy ), for some x; y ∈ Z.
(d) If a|b, then a|bc, c 6= 0.

5. Determine the gcd(12378; 3054):


(a) 24 (b) 18 (c) 6 (d) 2

6. Find the solutions of 3x + 4y = 7.


(a) x = 7 + 4t; y = 7 − 3t; t ∈ Z (c) x = 7 − 4t; y = 7 + 3t; t ∈ Z

(b) x = −7 + 4t; y = −7 − 3t; t ∈ Z (d) x = −7 + 4t; y = 7 − 3t; t ∈ Z

7. A man lost his wallet that contains Php5 and Php10 bills amounting to Php45. Suppose we
want to know how many of each kind of bill will produce the given amount. What is the general
solution? Assume x and y is the number of Php5 and P10 bill, respectively.

(a) x = −9 + 2t; y = 9 + t; t ∈ Z (c) x = 9 − 2t; y = 9 + t; t ∈ Z


(b) x = 9 + 2t; y = 9 − t; t ∈ Z (d) x = −9 + 2t; y = 9 − t; t ∈ Z

8. From the previous problem, which of the following are the solutions of the form (x; y )?
(a) {(1; 3); (3; 4); (5; 2); (7; 1)} (c) {(1; 4); (3; 3); (5; 2); (7; 1)}

(b) {(1; 2); (3; 3); (5; 3); (7; 1)} (d) {(1; 1); (3; 2); (5; 3); (7; 4)}

9. Let p be prime. Which of the following is FALSE?

(a) If p|ab, then either a or b is prime.


(b) If p|a1 a2 · · · an , then p|ak , for some k, where 1 ≤ k ≤ n.
(c) If q1 ; q2 ; :::; qn are all primes and p|q1 q2 · · · qn , then p = qk , for some k, where 1 ≤ k ≤ n.

(d) p is irrational.

88
10. Find the remainder when 1! + 2! + ::: + 50! is divided by 8.
(a) 1 (b) 3 (c) 5 (d) 7

11. Find the units digit of 3103 .


(a) 3 (b) 5 (c) 7 (d) 9

12. The following are equivalent to two of the other three, EXCEPT:
(a) x | (y + z) (c) y + z = xk, k ∈ Z

(b) y ≡ −z(mod x) (d) y k = x + zk; k ∈ Z

13. Let a; b; c; n ∈ Z where n > 0. Which of the following does NOT hold?

(a) If a ≡ b(mod n), then b ≡ a(mod n).


(b) If a ≡ b(mod n), then ak ≡ b k (mod n), where k ∈ Z.
(c) If a ≡ b(mod n), then ac ≡ bc(mod n).
(d) If a ≡ b(mod n), then a + c ≡ b + c(mod n),

14. Find the solution of 5x ≡ 3(mod 17).


(a) x ≡ 4(mod 17) (c) x ≡ 6(mod 17)

(b) x ≡ 5(mod 17) (d) x ≡ 7(mod 17)

15. Determine the solutions of 9x ≡ 15(mod 24).


(a) x ≡ 7; 15; 23(mod 24) (c) x ≡ 3; 11; 18(mod 24)

(b) x ≡ 5; 13; 21(mod 24) (d) x ≡ 1; 9; 17(mod 24)

16. Compute fi (1560).


(a) 62 (b) 52 (c) 42 (d) 32

17. Compute ff(1560).


(a) 3,040 (b) 4,040 (c) 5,040 (d) 6,040

18. Which of the following is FALSE?

(a) Every integer is congruent to exactly one of the least residues 0; 1; 2; :::; n − 1 modulo n.
(b) The set of integers Z can be partitioned into n nonempty pairwise disjoint classes, called
congruence classes modulo n.
(c) Every palindrome number is divisible by 11.

89
(d) The square of every odd integer is congruent to 1 modulo 4.

19. Which of the following is TRUE?

(a) The product of the positive divisors of n > 1 is equal to nfi (n) .
(b) An integer n > 0 is said to be per f ect if n is equal to the sum of all its positive divisors.
n
(c) If n = 2k ; where k > 0, then ffi(n) = .
2
(d) Let n ∈ N. Then fi (n) is odd if and only if n is a perfect number.

20. Which of the following is FALSE?


X
(a) If F is multiplicative and F (n) = f (d), then f is also multiplicative.
d|n

(b) If n > 1 is composite, then ffi(n) ≤ n − 2:


(c) Multiplicative functions are completely determined once their values at prime powers are
known.
(d) If m; n ∈ N, then every divisor d = d1 d2 of mn can be uniquely written such that d1 |m and
d2 |n:
n
X „ «
21. Compute —(d)fi
d|20
d

(a) 0 (b) 1 (c) 2 (d) 3


n
X „ «
22. Compute —(d)ff
d|20
d

(a) 18 (b) 17 (c) 16 (d) 15

23. Which of the following is TRUE?

(a) Let n ∈ N. Then ff(n) is odd if and only if n is a perfect square or twice a perfect square.
(b) The product of the positive divisors of n > 1 is equal to nfi (n) .
(c) If f is multiplicative, then f (mn) = f (m)f (n) for every m; n ∈ N:
m ffi(m)
„ «
(d) Let m; n ∈ N: Then ffi = where m = nk; k ∈ N:
n ffi(n)
24. Let n = p1 p2 p3 · · · pr be a product of r distinct primes. Which of the following is FALSE?

(a) fi (n) = 2r (c) ffi(n) = (p1 − 1)(p2 − 1) · · · (pr − 1)


(b) ff(n) = (p1 + 1)(p2 + 1) · · · (pr + 1) (d) One of the above is false.

25. This is a bonus item. You have to send the three quizzes and this Examination back to PUP via
its official courier service partner before January 2021 ends.

90
References:

1. K. H. Rosen. Elementary Number Theory and Its Applications

2. G. Jones and M. Jones. Elementary Number Theory

3. Niven and Zuckermann. An Introduction to the Theory of Numbers

4. G. H. Hardy and E. M. Wright. An Introduction to the Theory of Numbers

5. C. Vanden Eynden. Elementary Number Theory

6. K. Ireland and M. Rosen. A Classical Introduction to Modern Number Theory

7. Burton. Elementary Number Theory

8. Barnett. Elements of Number Theory

9. Ore and Oystein. Number Theory and Its History

10. S. Ymas. Elementary Number Theory

11. Precalculus Learner’s Material, First Edition 2016, Department of Education, Republic of the
Philippines

91

You might also like