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

MAMathEd 220

Number Theory
DAVES L. TONGA
Asst. Prof. 3
Bicol University
Introduction
Number theory, in a general sense, is the study of
numbers and their properties.
As far back as 5,000 years ago, ancient civilizations
had developed ways of expressing and doing
arithmetic with integers.
Throughout history, different methods have been
used to denote integers. For instance, the ancient
Babylonians used 60 as the base for their number
system and the Mayans used 20.
Introduction
Our method of expressing integers, the decimal
system, was first developed in India approximately
six centuries ago.
With the advent of modern computers, the binary
system came into widespread use.
Number theory has been used in many ways to
devise algorithms for efficient computer arithmetic
and for computer operations with large integers.
Introduction
The ancient Greeks in the school of Pythagoras,
2500 years ago, made the distinction between
primes and composites.
A prime is a positive integer with no positive factors
other than one and the integer itself.
In his writings, Euclid, an ancient Greek
mathematician, included a proof that there are
infinitely many primes.
Introduction
Mathematicians have long sought formulas that
generate primes.
For instance, Pierre de Fermat, the great French number
theorist of the 17th century, thought that all integers of
2𝑛
the form 2 + 1 are prime.
This was shown as false, a century after Fermat made
this claim, by the renowned Swiss mathematician
Leonard Euler, who demonstrated that 641 is a factor of
25
2 + 1.
Introduction
The problem of distinguishing primes from
composites has been extensively studied. The
ancient Greek scholar Eratosthenes devised a
method, now called the Sieve of Eratosthenes, that
finds all primes less than a specified limit.
It is inefficient to use this sieve to determine
whether a particular integer is prime. The problem
of efficiently determining whether an integer is
prime has long challenged mathematicians.
Introduction
Ancient Chinese mathematicians thought that the
primes were precisely those positive integers n such
that n divides 2n - 2.
Fermat showed that if n is prime, then n does divide 2n -
2.
However, by the early 19th century, it was known that
there are composite integers n such that n divides 2n - 2,
such as n = 341 .
These composite integers are called pseudoprimes.
Introduction
Because most composite integers are not
pseudoprimes, it is possible to develop primality
tests based on the original Chinese idea, together
with extra observations.
It is now possible to efficiently find primes; in fact,
primes with as many as 200 decimal digits can be
found in minutes of computer time.
Introduction
The fundamental theorem of arithmetic, known to
the ancient Greeks, says that every positive integer
can be written uniquely as the product of primes.
This factorization can be found by trial division of
the integer by primes less than its square-root;
unfortunately, this method is very time consuming.
Introduction
Fermat, Euler, and many other mathematicians
have produced imaginative factorization
techniques.
However, using the most efficient technique yet
devised, billions of years of computer time may be
required to factor an integer with 200 decimal
digits.
Introduction
The German mathematician Carl Friedrich Gauss,
considered to be one of the greatest
mathematicians of all time, developed the
language of congruences in the early 19th century.
When doing certain computations, integers may be
replaced by their remainders when divided by a
specific integer, using the language of congruences.
Introduction
Many questions can be phrased using the notion of
a congruence that can only be awkwardly stated
without this terminology.
Congruences have diverse applications to computer
science, including applications to computer file
storage, arithmetic with large integers, and the
generation of pseudo-random numbers.
Introduction
One of the most important applications of number
theory to computer science is in the area of
cryptography. Congruences can be used to develop
various types of ciphers.
Recently, a new type of cipher system, called a public-
key cipher system, has been devised. When a public-key
cipher is used, each individual has a public enciphering
key and a private deciphering key.
Messages are enciphered using the public key of the
receiver.
Introduction
Moreover, only the receiver can decipher the
message, since an overwhelming amount of
computer time is required to decipher when just
the enciphering key is known.
The most widely used public-key cipher system
relies on the disparity in computer time required to
find large primes and to factor large integers.
Introduction
In particular, to produce an enciphering key requires
that two large primes be found and then multiplied; this
can be done in minutes on a computer.
When these large primes are known, the deciphering
key can be quickly found. To find the deciphering key
from the enciphering key requires that a large integer,
namely the product of the large primes, be factored.
This may take billions of years!
The Well-Ordering Property
Every nonempty set of positive integers has a least
element.
For example, the set {17, 23, 5, 18, 13} has a least
element, namely, 5. The elements of the set can be
ordered as 5, 13, 17, 18, and 23.
By virtue of the well-ordering principle, the set of
positive integers is well ordered. You may notice
that the set of negative integers is not well ordered.
The Principle of Mathematical Induction
A set of positive integers that contains the integer 1
and the integer n + 1 whenever it contains n must
be the set of all positive integers.
The Principle of Mathematical Induction
Proof:
Let S be a set of positive integers containing the integer
1 and the integer n + 1 whenever it contains n.
Assume that S is not the set of all positive integers.
Therefore, there are some positive integers not
contained in S.
By the well-ordering property, since the set of positive
integers not contained in S is nonempty, there is a least
positive integer n which is not in S. Note that n ≠ 1 ,
since 1 is in S.
The Principle of Mathematical Induction
Now since n > 1, the integer n - 1 is a positive
integer smaller than n, and hence must be in S.
But since S contains n - l, it must also contain (n - 1)
+ 1 = n, which is a contradiction, since n is
supposedly the smallest positive integer not in S.
This shows that S must be the set of all positive
integers
The Principle of Mathematical Induction
To prove theorems using the principle of mathematical
induction (PMI), we must show two things.
We must show that the statement we are trying to
prove is true for 1 (basis step), the smallest positive
integer.
In addition, we must show that it is true for the positive
integer n + 1 if it is true for the positive integer n
(induction step).
By the PMI, one concludes that the set S of all positive
integers for which the statement is true must be the set
of all positive integers.
The Principle of Mathematical Induction
Example: Prove that
𝑛(𝑛 + 1)
1 + 2 + 3 +··· +𝑛 =
2
for every positive integer n.
The Principle of Mathematical Induction
Problem:
Conjecture a formula for the sum of the first n odd
positive integers and then use induction to
establish the conjecture.
The Principle of Mathematical Induction
Problem: Prove the theorem:
If a and r are real numbers and r ≠ 1, then
𝑛 𝑛+1
𝑗
𝑎𝑟 −𝑎
෍ 𝑎𝑟 =
𝑟−1
𝑗=0
Notation for Products
The product of the real numbers a1, a2,...,an, is
denoted by
𝑛

ෑ 𝑎𝑗 = 𝑎1 𝑎2 ⋯ 𝑎𝑛
𝑗=1

The letter j above is a "dummy variable", and can


be replaced arbitrarily.
Notation for Products
Examples:
1. ς5𝑗=1 𝑗 = 1 ∙ 2 ∙ 3 ∙ 4 ∙ 5 = 120
5 5
2. ς 𝑗=1 2 = 2 ∙ 2 ∙ 2 ∙ 2 ∙ 2 = 2 = 32
5 𝑗 1 2 3 4 5 15
3. ς 𝑗=1 2 = 2 ∙ 2 ∙ 2 ∙ 2 ∙ 2 = 2
Notation for Products
We note that with this notation,
𝑛

𝑛! = ෑ 𝑗
𝑗=1

Factorials are used to define binomial coefficients.


Binomial Coefficients
Let m and k be nonnegative integers with k ≤ m.
𝑚
The binomial coefficient is defined by
𝑘
𝑚 𝑚!
=
𝑘 𝑘! 𝑚 − 𝑘 !
1 ∙ 2 ∙ 3⋯ 𝑚 − 𝑘 𝑚 − 𝑘 + 1 ⋯ 𝑚 − 1 𝑚
=
𝑘! 1 ∙ 2 ∙ 3 ⋯ 𝑚 − 𝑘
𝑚−𝑘+1 ⋯ 𝑚−1 𝑚
=
𝑘!
Properties of Binomial Coefficients
Proposition 1.2 Let n and k be nonnegative integers
with k ≤ n. Then
𝑛 𝑛
i. = =1
0 𝑛

𝑛 𝑛
ii. =
𝑘 𝑛−𝑘
Properties of Binomial Coefficients
Proof:
𝑛 𝑛! 𝑛!
= = =1
0 0! 𝑛 − 0 ! 𝑛!

𝑛 𝑛! 𝑛! 𝑛!
= = = =1
𝑛 𝑛! 𝑛 − 𝑛 ! 𝑛! 0! 𝑛!

𝑛 𝑛! 𝑛! 𝑛
= = =
𝑘 𝑘! 𝑛 − 𝑘 ! 𝑛−𝑘 ! 𝑛− 𝑛−𝑘 ! 𝑛−𝑘
Properties of Binomial Coefficients
Theorem 1.2
Let n and k be positive integers with n ≥ k. Then

𝑛 𝑛 𝑛+1
+ =
𝑘 𝑘−1 𝑘
Properties of Binomial Coefficients
Theorem 1.2 Proof
𝑛 𝑛
+
𝑘 𝑘−1
𝑛! 𝑛!
= +
𝑘! 𝑛 − 𝑘 ! 𝑘−1 ! 𝑛−𝑘+1 !

𝑛! 𝑛 − 𝑘 + 1 𝑛! 𝑘
= +
𝑘! 𝑛 − 𝑘 + 1 ! 𝑘! 𝑛 − 𝑘 + 1 !
Properties of Binomial Coefficients
Theorem 1.2 Proof
𝑛! 𝑛 − 𝑘 + 1 + 𝑘
=
𝑘! 𝑛 − 𝑘 + 1 !
𝑛! 𝑛 + 1
=
𝑘! 𝑛 − 𝑘 + 1 !
𝑛+1 ! 𝑛+1 !
= =
𝑘! 𝑛 − 𝑘 + 1 ! 𝑘! 𝑛 + 1 − 𝑘 !
𝑛+1
=
𝑘
Pascal’s Triangle
Using Theorem 1.2, we can easily construct Pascal’s
Triangle, which displays the binomial coefficients.
𝑛
In this triangle, the binomial coefficient is the
𝑘
𝑘 + 1 𝑡ℎ number in the 𝑛 + 1 𝑡ℎ row.
Pascal’s Triangle
1
1 1
1 2 1
1 3 3 1
1 4 6 4 1
1 5 10 10 5 1
1 6 15 20 15 6 1
1 7 21 35 35 21 7 1
1 8 28 56 70 56 28 8 1
Pascal’s Triangle
We see that the exterior numbers in the triangle are all
1. To find an interior number, we simply add the two
numbers in the positions above and to either side, of
the position being filled.
From Theorem 1.2, this yields the correct integer.
Binomial coefficient s occur in the expansions of powers
of sums.
Exactly how they occur is described by the binomial
theorem.
The Binomial Theorem
Let x and y be variables and n a positive integer.
Then

𝑛 𝑛 𝑛 𝑛 𝑛−1 𝑛 𝑛−2 2
𝑥+𝑦 = 𝑥 + 𝑥 𝑦+ 𝑥 𝑦 +
0 1 2
𝑛 2 𝑛−2 𝑛 𝑛−1 𝑛 𝑛
⋯+ 𝑥 𝑦 + 𝑥𝑦 + 𝑦
𝑛−2 𝑛−1 𝑛
The Binomial Theorem
In summation notation,
𝑛
𝑛
𝑛 𝑛−𝑗 𝑗
𝑥+𝑦 =෍ 𝑗 𝑥 𝑦
𝑗=0
The Binomial Theorem
Proof:
We use mathematical induction. When n = 1,
according to the binomial theorem, the formula
becomes
1 1 1 0 1 0 1
𝑥+𝑦 = 𝑥 𝑦 + 𝑥 𝑦
0 1
1 1
Since = = 1, this states that
0 1
(x +y )1 = x + y, which is obviously true.
The Binomial Theorem
Proof:
We now assume the theorem is valid for the
positive integer n, that is, we assume that
𝑛
𝑛
𝑛 𝑛−𝑗 𝑗
𝑥+𝑦 =෍ 𝑗 𝑥 𝑦
𝑗=0
The Binomial Theorem
Proof:
We must now verify that the corresponding
formula holds with n replaced by n + 1, assuming
the result holds for n.
Hence, we have

𝑛+1 𝑛
𝑥+𝑦 = 𝑥+𝑦 𝑥+𝑦
The Binomial Theorem
Proof:
𝑛
𝑛 𝑛−𝑗 𝑗
= ෍ 𝑗 𝑥 𝑦 𝑥+𝑦
𝑗=0

𝑛 𝑛
𝑛 𝑛−𝑗+1 𝑗 𝑛 𝑛−𝑗 𝑗+1
=෍ 𝑗 𝑥 𝑦 +෍ 𝑗 𝑥 𝑦
𝑗=0 𝑗=0
The Binomial Theorem
Proof:
We see that by removing terms from the sums and
consequently shifting indices, that
𝑛 𝑛
𝑛 𝑛−𝑗+1 𝑗 𝑛+1
𝑛 𝑛−𝑗+1 𝑗
෍ 𝑗 𝑥 𝑦 =𝑥 +෍ 𝑗 𝑥 𝑦
𝑗=0 𝑗=1
The Binomial Theorem
Proof:
and
𝑛 𝑛−1
𝑛 𝑛−𝑗 𝑗+1 𝑛 𝑛−𝑗 𝑗+1
෍ 𝑗 𝑥 𝑦 =෍ 𝑗 𝑥 𝑦 + 𝑦 𝑛+1
𝑗=0 𝑗=1

𝑛
𝑛
= ෍ 𝑗 − 1 𝑥 𝑛−𝑗+1 𝑦 𝑗 + 𝑦 𝑛+1
𝑗=1
The Binomial Theorem
Proof:
Hence we find that,

𝑛+1
𝑥+𝑦
𝑛
𝑛+1
𝑛 𝑛 𝑛−𝑗+1 𝑗 𝑛+1
=𝑥 +෍ 𝑗 + 𝑗−1 𝑥 𝑦 +𝑦
𝑗=1
The Binomial Theorem
Proof:
By theorem 1.2, we have

𝑛 𝑛 𝑛+1
𝑗 + 𝑗−1 =
𝑗
The Binomial Theorem
So we conclude that
𝑛+1
𝑥+𝑦
𝑛
𝑛+1 𝑛 + 1 𝑛−𝑗+1 𝑗
=𝑥 +෍ 𝑥 𝑦 + 𝑦 𝑛+1
𝑗
𝑗=1

𝑛+1
𝑛 + 1 𝑛−𝑗+1 𝑗
=෍ 𝑥 𝑦
𝑗
𝑗=0
The Binomial Theorem
We now illustrate one use of the binomial theorem.
If we let x = y = 1, we see from the binomial
theorem that
𝑛 𝑛
𝑛 𝑛−𝑗 𝑗 𝑛
2𝑛 = 1 + 1 𝑛
=෍ 𝑗 1 1 =෍ 𝑗
𝑗=0 𝑗=0
The Binomial Theorem
This formula shows that if we add all elements of
the (n + 1)th row of Pascal’s triangle, we get 2n.
For instance, for the fifth row, we find that

4 4 4 4 4
+ + + +
0 1 2 3 4
4
= 1 + 4 + 6 + 4 + 1 = 16 = 2
Divisibility
When an integer is divided by a second nonzero
integer, the quotient may or may not be an integer.
For instance, 407/11 = 37 is an integer, while 86/8 =
10.75 is not.
This observation leads to the following definition.
Divisibility
If a and b are integers, we say that a divides b if
there is an integer c such that b = ac.
lf a divides b, we also say that a is a divisor or factor
of b.
If a divides b we write 𝑎|𝑏, while if a does not
divide b, we write a ∤ 𝑏.
Divisibility
The following examples illustrate the concept of
divisibility of integers:
17|187
−13|91
21|0
8 ∤ 45
−6 ∤ 100
0∤9
Divisibility
The divisors of 12 are ±1, ±2, ±3, ±4, ±6, ±12.
The divisors of 31 are ±1 and ±31.
In subsequent sections, we will need some simple
properties of divisibility.
We now state and prove these properties.
Divisibility
Proposition 1.3.
If a, b, and c are integers with 𝑎|𝑏 and 𝑏|𝑐, then
𝑎|𝑐.
Proof. Since 𝑎|𝑏 and 𝑏|𝑐, there are integers e and f
with ae = b and bf = c.
Hence bf = (ae)f = a(ef) = c, and we conclude that
𝑎|𝑐.
Example: Since 7|56 and 56|168, then 7|168.
Divisibility
Proposition 1.4.
If a, b, m and n are integers with 𝑐|𝑎 and 𝑐|𝑏, then
𝑐|(𝑚𝑎 + 𝑛𝑏).
Proof. Since 𝑐|𝑎 and 𝑐|𝑏, there are integers e and f such
that a = ce and b = cf.
Hence ma + nb = mce + ncf = c(me + nf). Consequently,
𝑐|(𝑚𝑎 + 𝑛𝑏)
Example: Since 7|14 and 7|21, then
7|(11 ∙ 14 − 5 ∙ 21).
Divisibility
The Division Algorithm.
Example. If a = -217 and b = 13 then q = -17 and r =
4, since -217 = 13·(-17) + 4.
Divisibility
The Greatest Integer Function.
Definition. Let x be a real number. The greatest
integer in x, denoted by 𝑥 , is the largest integer
less than or equal to x.
Example. 7.8 = 7, 5 = 5, and −3.1 = −4.
Divisibility
Proposition 1.5.
If x is a real number, then 𝑥 − 1 < 𝑥 ≤ 𝑥.
Divisibility
Proposition 1.5.
𝑎 𝑎
Proof. Let 𝑞 = and 𝑟 = 𝑎 − 𝑏 .
𝑏 𝑏
Clearly 𝑎 = 𝑏𝑞 + 𝑟.
To show that the remainder r satisfies the
appropriate inequality, note that from Proposition
𝑎 𝑎 𝑎
1.5, it follows that −1< ≤
𝑏 𝑏 𝑏
Divisibility
Proposition 1.5.
Proof.
𝑎 𝑎 𝑎
−1< ≤
𝑏 𝑏 𝑏
𝑎
𝑎−𝑏 <𝑏 ≤𝑎
𝑏
Divisibility
Proposition 1.5.
Proof.
𝑎
−𝑎 ≤ −𝑏 <𝑏−𝑎
𝑏
𝑎
0≤𝑎−𝑏 <𝑏
𝑏

0≤𝑟<𝑏
Divisibility
Proposition 1.5.
Proof. To show that the quotient q and the
remainder r are unique, assume that we have two
equations a = bq1 + r1 and a = bq2 + r2, with 0 ≤ r1 <
b and 0 ≤ r2 < b.
By subtracting the second of these from the first,
we find that 0 = b(q1 – q2) + (r1 – r2).
Hence, we see that r2 – r1 = b(q1 – q2)
Divisibility
Proposition 1.5.
This tells us that b divides r2 – r1. Since 0 ≤ r1 < b
and 0 ≤ r2 < b, we have –b < r2 – r1 < b.
This shows that b can divide r2 – r1 only if r2 – r1 = 0,
or, in other words, if r2 = r1.
Since bq1 + r1 = bq2 + r2 and r1 = r2 we also see that
q1 = q2, this shows that the quotient q and
remainder r are unique.
Divisibility
Proposition 1.5.
Example. Let a = 1028 and b = 34.
Then a = bq + r with 0 ≤ r < b,
1028
where 𝑞 = = 30, and
34
1028
𝑟 = 1028 − ∙ 34 = 8
34
Divisibility
Given a positive integer d, we can classify integers
according to their remainders when divided by d.
For example, with d = 2, we see from the division
algorithm that every integer when divided by 2 leaves a
remainder of either 0 or 1.
If the remainder when n is divided by 2 is 0, then n = 2k
for some positive integer k, and we say n is even, while
if the remainder when n is divided by 2 is 1, then n = 2k
+ 1 for some integer k, and we say n is odd.
Divisibility
Similarly, when d = 4, we see from the division
algorithm that when an integer n is divided by 4,
the remainder is either 0,1,2, or 3.
Hence, every integer is of the form 4k, 4k + 1, 4k +
2, or 4k + 3, where k is a positive integer.
Polygonal Numbers
Figurate numbers are positive integers that can be
represented by geometric patterns. They provide a
fascinating link between number theory and
geometry.
Not surprisingly, figurate numbers are of ancient
origin, and, in fact, it is believed that they were
invented by the Pythagoreans.
In 1665, Pascal published a book on them, Treatise
on Figurate Numbers.
Polygonal Numbers
Polygonal numbers, also known as plane figurate
numbers, are positive integers that can be represented
by regular polygons in a systematic fashion.
We will use four types of such numbers:
triangular numbers,
square numbers,
pentagonal numbers, and
hexagonal numbers.
Polygonal Numbers
If you have been to a bowling alley, you know that
there are ten pins in bowling, and they are
arranged initially in a triangular array.
Likewise, the 15 balls in the game of pool are also
initially stored in a triangular form.
Both numbers, 10 and 15, are triangular numbers;
likewise, the number of dots on a die is a triangular
number.
Triangular Numbers
A triangular number is a positive integer that can
be represented in an equilateral triangular array.
The nth triangular number is denoted by tn, n ≥ 1.
The first four triangular numbers are 1, 3, 6, and 10,
and they are pictorially represented in the next
slide.
Triangular Numbers
Triangular Numbers
Since the ith row contains i dots, tn equals the sum of the
first n positive integers; that is,
𝑛
𝑛 𝑛+1
𝑡𝑛 = ෍ 𝑖 =
2
𝑖=1
𝑛+1
Since 𝑡𝑛 = , triangular numbers can be read from
2
Pascal’s triangle.
Since each row in the triangular array contains one dot
more than the previous row, tn can be defined recursively.
Triangular Numbers
A Recursive Definition of tn
𝑡1 = 1
𝑡𝑛 = 𝑡𝑛−1 + 𝑛, 𝑛 ≥ 2

As an example, since t3 = 6, t4 = t3 + 4 = 6 + 4 = 10.


The Twelve Days of Christmas
On the first day of Christmas, my true love sent me a
partridge in a pear tree.
On the second day of Christmas, my true love sent me
two turtle doves and a partridge in a pear tree.
On the third day, my true love sent me three French hens,
two turtle doves, and a partridge in a pear tree.
The Twelve Days of Christmas
The pattern continues until the twelfth day, on
which my true love sent me twelve drummers
drumming, eleven pipers piping, ten lords a-
leaping, nine ladies dancing, eight maids a-milking,
seven swans a-swimming, six geese a-laying, five
gold rings, four calling birds, three French hens, two
turtle doves, and a partridge in a pear tree.
The Twelve Days of Christmas
Two interesting questions we would like to pursue:
• If the pattern in the carol continues for n days,
how many gifts gn would be sent on the nth day?
• What is the total number of gifts sn sent in n
days?
The Twelve Days of Christmas
First, notice that the number of gifts sent on the nth
day equals n more than the number of gifts sent on
the previous day, so gn = gn−1 + n, where g1 = 1.
Therefore, gn = tn, the nth triangular number.
For instance, the number of gifts sent on the
twelfth day is given by t12 = (12 · 13)/2 = 78.
The Twelve Days of Christmas
The Twelve Days of Christmas
It now follows that the total number of gifts sent in
12 days is given by

12 ∙ 13 ∙ 14
𝑠12 = = 364
6
Triangular Numbers
The cubes 1, 8, 27, 64, 125, . . . , n3 are related to
triangular numbers.
To see this, let cn denote the nth cube n3.
𝑛 𝑛+1 2
Since σ𝑛𝑘=1 𝑘 3 = it follows that
2
σ𝑛𝑘=1 𝑐𝑘 = 𝑡𝑛 2
that is, the sum of the first n cubes equals the
square of the nth triangular number.
Triangular Numbers (Problems)
1. Find the value of n such that tn = 666. (The
number 666 is called the beastly number.)
2. Prove each, where n ≥ 2.
a. 𝑡𝑛−1 2 + 𝑡𝑛 2 = 𝑡𝑛2
b. 𝑡2𝑛−1 − 2𝑡𝑛−1 = 𝑛2
c. 𝑡𝑡𝑛 = 𝑡𝑡𝑛−1 + 𝑡𝑛
3. In 1775, Euler proved that if n is a triangular
number, then so are 9n + 1, 25n + 3, and 49n + 6.
Verify this.
Triangular Numbers (Problems)
4. Find two pairs of triangular numbers whose
sums and differences are also triangular.
5. Show that there are triangular numbers whose
squares are also triangular.
6. There are three triangular numbers < 1000 and
made up of a repeated single digit. Find them.
Square Numbers
Positive integers that can be represented by square
arrays (of dots) are square numbers.
The nth square number is denoted by sn.
Square Numbers
In general, sn = n2, n ≥ 1.
Square Numbers
Recursive definition of sn:
sn = sn−1 + 2(n −1) + 1
= sn−1 + 2n − 1, n ≥ 2
Square Numbers
We now demonstrate a close relationship between
tn and sn.
Square Numbers
From the given figure we see that s5 = t5 + t4.
Generally, sn = tn + tn−1.
The following theorem, known to the Greek
mathematicians Theon of Smyrna (ca. A.D. 100)
and Nicomachus, establishes this algebraically.
Square Numbers
Theorem 1.10
The sum of any two consecutive triangular numbers is a
square.
Algebraic Proof:
𝑛 𝑛+1 𝑛 𝑛−1
𝑡𝑛 + 𝑡𝑛−1 = +
2 2
𝑛 𝑛
= 𝑛 + 1 + 𝑛 − 1 = 2𝑛 = 𝑛2 = 𝑠𝑛
2 2
Square Numbers
Theorem 1.10
Geometric Proofs:
Square Numbers
Theorem 1.11
𝑡𝑛−1 2 + 𝑡𝑛 2 = 𝑡𝑛2
Algebraic Proof:
2 2
𝑛 𝑛−1 𝑛 𝑛+1
+
2 2

2 2 2 2
𝑛 𝑛−1 𝑛 𝑛+1
= +
4 4
Square Numbers
𝑛2 𝑛2 − 2𝑛 + 1 𝑛2 𝑛2 + 2𝑛 + 1
= +
4 4
2 2 2 2
2𝑛 𝑛 + 1 𝑛 𝑛 +1
= =
4 2

= 𝑡𝑛 2
Square Numbers
Geometric Proof:
Square Numbers
Theorem 1.12
2
8𝑡𝑛 + 1 = 2𝑛 + 1

2
8𝑡𝑛−1 + 4𝑛 = 2𝑛
Pentagonal Numbers
Pentagonal Numbers
As shown on the previous slide, the first four pentagonal numbers
are 1, 5, 12, and 22.
To find the nth pentagonal number, we use the formula

𝑛 3𝑛 − 1
𝑝𝑛 =
2
Pentagonal Numbers
There is an interesting relationship connecting triangular
numbers, square numbers, and pentagonal numbers.
Pentagonal Numbers
From the figure, t1 + s2 = p2 and t2 + s3 = p3.
More generally, tn−1 + sn = pn, where n ≥ 2. Thorem 1.13
Proof:
𝑡𝑛−1 + 𝑠𝑛

𝑛 𝑛−1 𝑛 2 − 𝑛 + 2𝑛2
= + 𝑛2 =
2 2

𝑛 3𝑛 − 1
= = 𝑝𝑛
2
Hexagonal Numbers
Hexagonal Numbers
The previous slide shows the pictorial representations of the first
four hexagonal numbers 1, 6, 15, and 28.
We can verify that hn = n(2n−1), n ≥ 1.
The triangular numbers, pentagonal numbers, and hexagonal
numbers satisfy the relationship pn + tn−1 = hn.
Hexagonal Numbers
Theorem 1.14
𝑝𝑛 + 𝑡𝑛−1 = ℎ𝑛
Proof:
𝑛 3𝑛 − 1 𝑛 𝑛−1
𝑝𝑛 + 𝑡𝑛−1 = +
2 2

𝑛 3𝑛 − 1 + 𝑛 𝑛 − 1 3𝑛2 − 𝑛 + 𝑛2 − 𝑛
= =
2 2

4𝑛2 − 2𝑛 2𝑛 2𝑛 − 1
= = = 𝑛 2𝑛 − 1 = ℎ𝑛
2 2
Polygonal Numbers (Problems)
1. Prove (or disprove) each, where n ≥ 2.
a. pn = n + 3tn−1
b. hn = 4tn−1 + n
2. Find the first four heptagonal numbers.
3. Find the first four octagonal numbers.
4. Verify that the numbers 1 225, 41 616, and 1 413 721 are both
triangular and square.
5. The nth number an that is both triangular and square can be defined
recursively as an = 34an−1 − an−2 + 2, where a1 = 1 and a2 = 36. Using this
definition, compute a4 and a5.
Pyramidal Numbers
Solid figurate numbers, positive integers that can be
represented by pyramidal shapes, are obtained by taking
successive sums of the corresponding polygonal numbers.
The number of sides in the base of a pyramid increases
from three, so the various pyramidal numbers are
triangular, square, pentagonal, hexagonal, etc.
Triangular Pyramidal Numbers
Triangular pyramidal numbers is also known as
tetrahedral numbers.
The nth triangular pyramidal number Tn is the sum of the
first n triangular numbers tn. The first four such numbers
are:
T1 = t1 = 1
T2 = t1 + t2 = 1 + 3 = 4
T3 = t1 + t2 + t3 = 1 + 3 + 6 = 10; and
T4 = t1 + t2 + t3 + t4 = 1 + 3 + 6 + 10 = 20.
Triangular Pyramidal Numbers
The first four triangular pyramidal numbers are shown
below:
Triangular Pyramidal Numbers

From the table above, we see that Tn = Tn-1 + tn


𝑛 𝑛+1
and Tn = Tn-1 +
; therefore:
𝑛 2
𝑖 𝑖+1 𝑛 𝑛+1 𝑛+2 𝑛+2
𝑇𝑛 = ෍ = =
2 6 3
𝑖=1
Square Pyramidal Numbers
The first four square pyramidal numbers are:
Square Pyramidal Numbers
n 1 2 3 4 5 6 … n

sn 1 4 9 16 25 36 … n2

Sn 1 5 13 29 54 ? … ?
Square Pyramidal Numbers
The nth square pyramidal number is

𝑛 𝑛

𝑆𝑛 = ෍ 𝑠𝑖 = ෍ 𝑖 2 = 12 + 22 + 32 + ⋯ + 𝑛2
𝑖=1 𝑖=1

𝑛 𝑛 + 1 2𝑛 + 1
𝑆𝑛 =
6
Pentagonal Pyramidal Numbers
n 1 2 3 4 5 6 … n
𝑛 3𝑛 − 1
pn 1 5 12 22 35 51 … 2

Pn 1 6 18 40 75 ? … ?
The explicit formula for pentagonal pyramidal number is

𝑛2 𝑛 + 1
𝑃𝑛 =
2
Hexagonal Pyramidal Numbers
n 1 2 3 4 5 6 … n
n(2n-1)
hn 1 6 15 28 45 66 …

Hn 1 7 22 50 95 ? … ?
The explicit formula for hexagonal pyramidal number is

𝑛 𝑛 + 1 4𝑛 − 1
𝐻𝑛 =
6
Pyramidal Numbers (Problems)
1. Prove by mathematical induction that the sum of the
first n
𝑛 𝑛+1 𝑛+2
a) triangular numbers is
6

𝑛 𝑛+1 𝑛 𝑛+1 𝑛+2


Ex: 1 + 3 + 6 + 10 + … + =
2 6
Pyramidal Numbers (Problems)
1. Prove by mathematical induction that the sum of the
first n
𝑛 𝑛+1 2𝑛+1
b) square numbers is
6

𝑛2 𝑛+1
c) pentagonal numbers is
2

𝑛 𝑛+1 4𝑛−1
d) hexagonal numbers is
6
Pyramidal Numbers (Problems)
2. Find the first seven heptagonal pyramidal numbers.
3. Find the first seven octagonal pyramidal numbers.
4. Find a formula for the nth heptagonal pyramidal
number En.
5. Find a formula for the nth octagonal pyramidal number
On .
Heptagonal & Octagonal Pyramidal Numbers
5𝑛2 − 3𝑛 𝑛 𝑛 + 1 5𝑛 − 2
𝑒𝑛 = , 𝐸𝑛 =
2 6

2
𝑛 𝑛 + 1 6𝑛 − 1
𝑜𝑛 = 3𝑛 − 2𝑛, 𝑂𝑛 =
6
Representations of Integers
The conventional manner of expressing numbers is by
decimal notation.
We write out numbers using digits to represent multiples
of powers of ten.
For instance, when we write the integer 34765, we mean
3·104 + 4·103 + 7·102 + 6·101 + 5·100
Representations of Integers
There is no particular reason for the use of ten as the
base of notation, other than the fact that we have ten
fingers.
Other civilizations have used different bases, including the
Babylonians, who used base sixty , and the Mayans, who
used base twenty.
Electronic computers use two as a base for internal
representation of integers, and either eight or sixteen for
display purposes.
Representations of Integers
Theorem 2.1
Let b be a positive integer with b > 1.
Then every positive integer n can be written
uniquely in the form
n = akbk + ak-1bk-1 + … + a1b + a0,
where aj is an integer with 0 ≤ aj ≤ b, for j = 0, 1, ... ,
k and the initial coefficient ak ≠ 0.
Representations of Integers
Corollary 1.1.
Every positive integer may be represented as the sum of distinct
powers of two.
Proof.
Let n be a positive integer.
From Theorem 2.1 with b = 2, we know that
n = ak2k + ak – 12k – 1 + … + a1 + a0
Where each aj is either 0 or 1.
Hence, every positive integer is the sum of distinct powers of 2.
Representations of Integers
In the expansions described in Theorem 2.1, b is
called the base or radix of the expansion.
We call base 10 notation, our conventional way of
writing integers, decimal notation.
Base 2 expansions are called binary expansions,
base 8 expansions are called octal expansions, and
base 16 expansions are called hexadecimal, or hex
for short, expansions.
Representations of Integers
The coefficients aj are called the digits of the
expansion. Binary digits are called bits (binary
digits) in computer terminology.
To distinguish representations of integers with
different bases, we use a special notation.
We write (ak ak-1 … a1 a0)b to represent the
expansion akbk + ak-1bk-1 + … + a1b + a0.
Representations of Integers
Examples
(549)7 = 5∙72 + 4∙71 + 9∙70
= (282)10 = 282

(10011101000)2
= 1∙210 + 1∙27 + 1∙26 + 1∙25 + 1∙23
= (1256)10 = 1256
Representations of Integers
Example: Find the base 2 expansion of 2016.
2016 = 2∙1008+ 0
1008 = 2∙504 +0
504 = 2∙252 +0
252 = 2∙126 +0
126 = 2∙63 +0
63 = 2∙31 +1
31 = 2∙15 +1
15 = 2∙7 +1
7 = 2∙3 +1
3 = 2∙1 +1
1 = 2∙0 +1
Representations of Integers
To obtain the base 2 expansion of 2016, we simply
take the remainders of these divisions.
This shows that (2016)10 = (11111100000)2.
Representations of Integers
Computers represent numbers internally by using a
series of "switches“ which may be either "on" or
"off". (This may be done mechanically using
magnetic tape, electrical switches, or by other
means.)
Hence, we have two possible states for each switch.
We can use "on" to represent the digit 1 and "off"
to represent the digit 0. This is why computers use
binary expansions to represent integers internally.
Representations of Integers
Computers use base 8 or base 16 for display
purposes.
In base 16, or hexadecimal, notation there are 16
digits, usually denoted by 0, 1, 2, 3, 4, 5, 6, 8, 7, 9,
A, B, C, D, E, and F.
The letters A ,B, C, D, E, and F are used to represent
the digits that correspond to 10, 11, 12, 13, 14, and
15, respectively (written in decimal notation).
Representations of Integers
Example: Convert (FEFEC0)16 to decimal.
Solution:
(FEFEC0)16 = 15(16)5 + 14(16)4 + 15(16)3
+ 14(16)2 + 12(16)1 + 0(16)0
= (16711360)10
Representations of Integers
A simple conversion is possible between binary and
hexadecimal notation. We can write each hex digit
as a block of four binary digits.
Hex Digit Binary Digits Hex Digit Binary Digits
0 0000 8 1000
1 0001 9 1001
2 0010 A 1010
3 0011 B 1011
4 0100 C 1100
5 0101 D 1101
6 0110 E 1110
7 0111 F 1111
Representations of Integers
An example of conversion from hex to binary is
(2FB3)16 = (10111110110011)2.
Each hex digit is converted to a block of four binary
digits (the initial zeros in the initial block (0010)2
corresponding to the digit (2)16 are omitted).
Representations of Integers
To convert from binary to hex, consider
(11110111101001)2.
We break this into blocks of four starting from the right.
The blocks are, from right to left, 1001, 1110, 1101, and
0011 (we add the initial zeros).
Translating each block to hex, we obtain (3DE9)16.
We note that a conversion between two different bases
is as easy as binary-hex conversion, whenever one of
the bases is a power of the other.
Representations of Integers (Problems)
1. Convert (2A16)16 to
a) decimal notation,
b) octal notation,
c) base 7 notation, and
d) binary notation.
Representations of Integers (Problems)
2. Convert (2016)10 to
a) hex notation,
b) octal notation,
c) base 7 notation, and
d) binary notation.
Representations of Integers (Problems)
3. Convert (2016)8 to
a) hex notation,
b) decimal notation,
c) base 7 notation, and
d) binary notation.
Representations of Integers (Problems)
4. Convert (2016)7 to
a) hex notation,
b) decimal notation,
c) octal notation, and
d) binary notation.
Representations of Integers (Problems)
5. Convert
(111001000100001001001000010001001)2 to
a) hex notation,
b) decimal notation,
c) octal notation, and
d) base 7 notation.
❖Koshy, Thomas (2007). Elementary
Number Theory with Applications, 2nd
BIBLIOGRAPHY Edition. Academic Press Publications.
❖Rosen, Kenneth H. (1986). Elementary
Number Theory and Its Applications.
Addison-Wesley Publishing Company.
WEB PAGES

You might also like