Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Elementary Number Theory

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

Elementary Number Theory and Its Applications

Kenneth H. Rosen

Chapter 1

The Integers
1.1

The Well-Ordering Property

In this section, we discuss several important tools that are useful for proving
theorems. We begin by stating an important axiom, the well-ordering property.
The Well-Ordering Theorem. Every nonempty set of positive integers has
a least element.
The principle of mathematical induction is a valuable tool for proving results about the integers. We now state this principle, and show how to prove it
using the well-ordering property. Afterwards, we give an example to demonstrate the use of the principle of mathematical induction. In our study of
number theory, we will use both the well-ordering property and the principle
of mathematical induction many times.
The Principal 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.
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 6= 1, since 1 is in S. Now since n > l, the integer n 1 is a
positive integer smaller than n, and hence must be in S. But since S contains
n 1, 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.

CHAPTER 1. THE INTEGERS

To prove theorems using the principle of mathematical induction, we must


show two things. We must show that the statement we are trying to prove
is true for 1, 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. By the principle of mathematical induction, one concludes that the set
S of all positive integers for which the statement is true must be the set of
all positive integers. To illustrate this procedure, we will use the principle of
mathematical induction to establish a formula for the sum of the terms of a
geometric progression.
Definition. Given real numbers a and r, the real numbers
a, ar, ar2 , ar3 , ...
are said to form a geometric progression. Also, a is called the initial term and
r is called the common ratio.
Example. The numbers 5, -15, 45, -135,... form a geometric progression with
initial term 5 and common ration -3.
In our discussion of sums, we will find summation notation useful. The
following notation represents the sum of the real numbers a1 , a2 , ..., an .
n
X

ak = a1 + a2 + ... + an .

k=1

We note that the letter k, the index of summation, is a dummy variable and
can be replaced by any letter, so that
n
X
k=1

ak =

n
X
j=1

aj =

n
X

ai ,

i=1

and so forth.
Example. We see that
5
X

j = 1 + 2 + 3 + 4 + 5 = 15,

j=1
5
X

2 = 2 + 2 + 2 + 2 + 2 = 10,

j=1

and

5
X
j=1

2j = 2 + 22 + 23 + 24 + 25 = 62.

1.1. THE WELL-ORDERING PROPERTY

We also note that in summation notation, the index of summation may


range between any two integers, as long as the lower limit does not exceed the
upper limit. If m and h are integers such that m n, then
n
X

ak = am + am+1 + ... + an .

k=m

For instance, we have


5
X

k 2 = 32 + 42 + 52 = 50,

k=3
2
X

3k = 30 + 31 + 32 = 13,

k=0

and
1
X

k 3 = (2)3 + (1)3 + 03 + 13 = 8.

k=2

We now turn our attention to sums of terms of geometric progressions.


The sum of the terms a, ar, ar2 , ..., arn is
n
X

arj = a + ar + ar2 + ... + arn ,

j=0

where the summation begins with j = 0. We have the following theorem.


Theorem 1.1. If a and r are real numbers and r 6= 1, then
n
X
j=0

arj = a + ar + ar2 + ... + arn =

arn+1 a
.
r1

(1.1)

Proof. To prove that the formula for the sum of terms of a geometric progression is valid, we must first show that it holds for n = 1. Then, we must show
that if the formula is valid for the positive integer n, it must also be true for
the positive integer n 1.
To start things off, let n = 1. Then, the left side of (1.1) is a + ar, while on
the right side of (1.1) we have
ar2 a
a(r2 1)
a(r + 1)(r 1)
=
=
= a(r + 1) = a + ar.
r1
r1
r1

CHAPTER 1. THE INTEGERS

So the formula is valid when n = 1.


Now, we assume that (1.1) holds for the positive integer n. That is, we assume
that
arn+1 a
a + ar + ar2 + ... + arn =
.
(1.2)
r1
We must show that the formula also holds for the positive integer n + 1. What
we must show is that
a + ar + ar2 + ... + arn + arn+1 =

ar(n+1)+1 a
arn+2 a
=
.
r1
r1

(1.3)

To show that (1.3) is valid, we add arn+1 to both sides of (1.2), to obtain
(a + ar + ar2 + ... + arn ) + arn+1 =

arn+1 a
+ arn+1 .
r1

(1.4)

The left side of (1.4) is identical to that of (1.3). To show that the right sides
are equal, we note that
arn+1 arn+1 (r 1)
arn+1 a
+ arn+1 =
+
r1
r1
r1
arn+1 a + arn+2 arn+1
=
r1
arn+2 a
=
.
r1
Since we have shown that (1.2) implies (1.3), we can conclude that (1.1) holds
for all positive integers n.
Example. Let n be a positive integer. To find the sum
n
X

2k = 1 + 2 + 22 + ... + 2n ,

k=0

we use Theorem 1.1 with a = 1 and r = 2, to obtain


2n+1 1
= 2n+1 1.
21
Hence, the sum of consecutive nonnegative powers of 2 is one less than the
next largest power of 2.
1 + 2 + 22 + ... + 2n =

A slight variant of the principle of mathematical induction is also sometimes useful in proofs.
The Second Principle of Mathematical Induction. A set of positive
integers which contains the integer 1, and which has the property that if it
contains all the positive integers 1, 2, ..., k , then it also contains the integer
k + l, must be the set of all positive integers.

1.1. THE WELL-ORDERING PROPERTY

Proof. Let T be a set of integers containing 1 and containing k + 1 if it contains 1, 2, ..., k. Let S be the set of all positive integers n such that all the
positive integers less than or equal to n are in Z. 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.
The principle of mathematical induction provides a method for defining
the values of functions at positive integers.
Definition. We say the function f is defined recursively if the value of f at
1 is specified and if a rule is provided for determining f (n + 1) from f (n).
If a function is defined recursively, one can use the principles of mathematical induction to show it is defined uniquely at each positive integer. (See
problem 12 at the end of this section.)
We now give an example of a function defined recursively. We define the
factorial function f (n) = n!. First, we specify that
f (1) = 1,
and then we give the rile for finding f (n + 1) from f (n), namely
f (n + 1) = (n + 1) f (n).
These two statements uniquely define n!.
To find the value of f (6) = 6! from the recursive definition of f (n) = n!,
use the second property successively, as follows
f (6) = 6 f (5) = 6 5 f (4) = 6 5 4 f (3) = 6 5 4 3 f (2) = 6 5 4 3 2 f (1).
We now use the first statement of the definition to replace f (1) by its stated
value to 1, to conclude that
6! = 6 5 4 3 2 1 = 720.
In general, by successively using the recursive definition, we see that n! is the
product of the first n positive integers, i.e.
n! = 1 2 3...n.
For convenience, and future use, we specify that 0! = 1.

CHAPTER 1. THE INTEGERS

We take this opportunity to define a notation for products, analogous to


summation notation. The product of the real numbers a1 , a2 , ..., an is denoted
by
n
Y
aj = a1 a2 ...an .
j=1

The letter j above is a dummy variable, and can be replaced arbitrarily.


Example. To illustrate the notation for products we have
5
Y

j = 1 2 3 4 5 = 120.

j=1
5
Y

2 = 2 2 2 2 2 = 32.

j=1
5
Y

2j = 2 22 23 24 25 = 215 .

j=1

We note that with this notation, n! =

n
Y

j.

j=1

Factorials are used to define binomial coefficients.


Definition.
 m and k be nonnegative integers with k m. The binomial
 Let
m
is defined by
coefficient
k
 
m
m!
=
.
k
k!(m k)!
 
m
In computing
, we see that there is a good deal of cancellation, bek
cause
 
m
m!
1 2 3 (m k)(m k + 1) (m 1)m
=
=
k
k!(m k)!
k! 1 2 3 (m k)
(m k + 1) (m 1)m
=
.
k!
 
7
Example. To evaluate the binomial coefficient
, we note that
3
 
1234567
567
7
7!
=
=
=
= 35.
3
3!4!
1231234
123

1.1. THE WELL-ORDERING PROPERTY

We now prove some simple properties of binomial coefficients.

Proposition 1.1. Let n and k be nonnegative integers with k n . Then


   
n
n
=
=1
0
n
  

n
n
=
.
k
nk

(i)
(ii)

Proof. To see that (i) is true, note that


 
n
n!
n!
=
=
=1
0
0!n!
n!
and
 
n!
n
n!
= 1.
= 0! =
n!
n!
n
To verify (ii), we see that


 
n
n
n!
n!
.
=
=
=
nk
k
k!(n k)!
(n k)!(n (n k))!

An important property of binomial coefficients is the following identity.

Theorem 1.2. Let n and k be positive integers with k n . Then


  
 

n
n
n+1
+
=
.
k
k1
k
Proof. We perform the addition
  

n
n
n!
n!
+
=
+
k
k1
k!(n k)! (k 1)!(n k + 1)!

10

CHAPTER 1. THE INTEGERS

by using the common denominator k!(n k + 1)!. This gives


  

n
n
n!(n k + 1)
n!k
+
=
+
k
k1
k!(n k + 1)! k!(n k + 1)!
n!((n k + 1) + k)
=
k!(n k + 1)!
n!(n + 1)
=
k!(n k + 1)!
(n + 1)!
=
k!(n k + 1)!


n+1
=
.
k

Using Theorem 1.2, we can easily construct Pascals Triangle, whichdis


n
plays the binomial coefficients. In this tirnagle, the binomial coefficient
k
is the (k + 1)th number in the (n + 1)th row. The first four rows of Pascals
triangle are displayed in Figure 1.1.
n = 0:
1
n = 1:

n = 2:

n = 3:
n = 4:

1
1

1
2

3
4

1
3

Figure 1.1. Pascals triangle


1

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 Theorem1.2, this yields the
correct integer.
Binomial coefficients 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
 
 
 
n n
n n1
n n2 2
n
(x + y) =
x +
x
y+
x
y + ...
0
1
2




 
n
n
n n
2 n2
n1
+
x y
+
xy
+
y ,
n2
n1
n

1.1. THE WELL-ORDERING PROPERTY

11

or using summation notation,


n  
X
n nj j
(x + y) =
x y .
j
n

j=0

We prove the binomial theorem by mathematical induction. In the proof,


we make use of summation notation.
Proof. We use mathematical induction. When n = 1, according to the binomial theorem, the formula becomes
 
 
1 1 0
1 0 1
1
(x + 1) =
x y +
x y .
0
1
 
 
1
1
But because
=
= 1, this states that (x + y)1 = x + y, which is
0
1
obviously true.
We now assume the theorem is valid for the positive integer n, that is, we
assume that
n  
X
n nj j
n
(x + y) =
x y .
j
j=0

We must not verify that the corresponding formula holds with n replaced by
n + 1, assuming the result holds for n. Hence, we have
(x + y)n+1 = (x + y)n (x + y)
" n  
#
X n
nj j
=
x y (x + y)
j
j=0
n  
n  
X
n nj+1 j X n nj j+1
=
x
y +
x y .
j
j
j=0

j=0

We see that by removing terms from the sums and consequently shifting indices, that
n  
n  
X
X
n nj+1 j
n nj+1 j
n+1
x
y =x
+
x
y
j
j
j=0

j=1

and
n  
n1  
X
n nj j+1 X n nj j+1
x y
=
x y
+ y n+1
j
j
j=0
j=0

n 
X
n
=
xnj+1 y j + y n+1 .
j1
j=1

12

CHAPTER 1. THE INTEGERS

Hence, we find that


(x + y)n+1

"  
#
n
X
n
n
= xn+1 +
+
xnj+1 y j + y n+1 .
j
j1
j=1

By Theorem 1.2, we have


  
 

n
n
n+1
+
=
,
j
j1
j
so we conclude that
(x + y)n+1 = xn+1 +


n 
X
n+1
j=1

xnj+1 y j + y n+1

n+1
X
j=0


n + 1 n+1j j
x
y .
j

This establishes the theorem.


We now illustrate one use of the binomial theorem. If we let x = y = 1,
we see from the binomial theorem that
n  
n  
X
n nj j X n
n
n
2 = (1 + 1) =
1 1 =
.
j
j
j=0

j=0

This formula shows that if we add all elements of the (n + 1)th row of Pascals
triangle, we get 2n . For instance, for the first row, we find that
         
4
4
4
4
4
+
+
+
+
= 1 + 4 + 6 + 4 + 1 = 16 = 24 .
0
1
2
3
4

1.1 Problems
1. Find the values of the following sums
a)

10
X

c)

j=1

b)

10
X
j=1

10
X

j2

j=1

d)

10
X
j=1

2j .

1.1. THE WELL-ORDERING PROPERTY

13

2. Find the values of the following products

a)

5
Y

c)

j=1

b)

5
Y

5
Y

j2

j=1

d)

j=1

5
Y

2j .

j=1

3. Find n! for n equal to each of the first ten positive integers.


       
 
10
10
10
10
10
4. Find
,
,
,
, and
.
0
3
5
7
10
   
 
9
9
10
5. Find the binomial coefficients
,
, and
, and verify that
3
4
4
     
9
9
10
+
=
.
3
4
4
6. Show that a nonempty set of negative integers has a largest element.
7. Use mathematical induction to prove the following formulae.
a)

n
X

j = 1 + 2 + 3 + ... + n =

j=1

b)

n
X

n(n + 1)
n

j 2 = 12 + 22 + 32 + ... + n2 =

j=1

c)

n
X
j=1

n(n + 1)(2n + 1)
6
"

n(n + 1)
j = 1 + 2 + 3 + ... + n =
2
3

8. Find a formula for

n
Y

#2

2j .

j=1

9. Use the principle of mathematical induction to show that the value at


each positive integer of a function defined recursively is uniquely determined.
10. What function f (n) is defined recursively by f (1) = 2 and
f (n + 1) = 2f (n) for n 1?
11. If g is defined recursively by g(1) = 2 and g(n) = 2g(n1) for n 2,
what is g(4)?

14

CHAPTER 1. THE INTEGERS

12. The second principle of mathematical induction can be used to define


functions recursively. We specify the value of the function at 1 and give
a rule for finding f (n + 1) from the values of f at the first n positive
integers. Show that the values of a function so defined are uniquely
determined.
13. We define a function recursively for all positive integers n by f (1) = 1,
f (2) = 5, and for n > 2, f (n + 1) = f (n) + 2f (n 1). Show that
f (n) = 2n +(1)n , using the second principle of mathematical induction.
14.

a) Let n be a positive integer. By expanding (1 + (1))n with the


binomial theorem, show that
 
n
X
k n
= 0.
(1)
k
k=0

b) Use part (a), and the fact that

n  
X
n
k=0

= 2n , to find

     
n
n
n
+
+
+ ...
0
2
4
and
     
n
n
n
+
+
+ ...
3
5
1
c) Find the sum1 2 + 22 23 + ... + 2100 .
15. Show by mathematical induction that if n is a positive integer, then
(2n)! < 22n (n!)2 .
 
x
16. The binomial coefficients
, where x is a variable, and n is a posin
 
x
tive integer, can be defined recursively by the equations
= x and
1


 
x
xn x
=
.
n+1
n+1 n
 
x
x!
a) Show that if x is a positive integer, then
=
, where
k
k!(x k)!
k is an integer with 1 k x.
  



x
x
x+1
b) Show that
+
=
, whenever n is a positive
n
n+1
n+1
integer.

1.1. THE WELL-ORDERING PROPERTY

15

17. In this problem, we develop the principle of inclusion - exclusion. Suppose that S is a set with n elements and let P1 , P2 , ..., Pt be t different
properties that an element of S may have. Show that the number of
elements of S possessing none of the t properties is
n [n(P1 ) + n(P2 ) + ... + n(Pt )]
+ [n(P1 , P2 ) + n(P1 , P3 ) + ... + n(Pt1 , Pt )]
[n(P1 , P2 , P3 ) + n(P1 , P2 , P4 ) + ... + n(Pt2 , Pt1 , Pt )]
+ ... + (1)t n(P1 , P2 , ..., Pt ),
where n(Pi1 , Pi2 , ..., Pit ) is the number of elements of S possessing all of
the properties Pi1 , Pi2 , ..., Pit . The first expression in brackets contains a
term for each property, the second expression in brackets contains terms
for all combinations of two properties, the third expression contains
terms for all combinations of three properties, and so forth. (Hint: For
each element of S determine the number of times it is counted in the
above
 expression.
   If an elementhas
 k of the properties, show it is counted
k
k
k
1
+
... + (1)k
times. This equals zero by problem
1
2
k
14(a).)
18. The tower of Hanoi was a popular puzzle of the late nineteenth century.
The puzzle includes three pegs and eight rings of different sizes placed
in order of size,with the largest on the bottom, on one of the pegs. The
goal of the puzzle is to move all the rings, one at a time without ever
placing a larger ring on top of a smaller ring, from the first peg to the
second, using the third peg as an auxiliary peg.
a) Use mathematical induction to show that the minimum number of
moves to transfer n rings, with the rules we have described, from
one peg to another is 2n 1.
b) An ancient legend tells of the monks in a tower with 64 gold rings
and 3 diamond pegs. They started moving the rings, one move per
second, when the world was created. When they finish transferring
the rings to the second peg, the world ends. How long will the
world last?
19. Without multiplying all the terms, show that
a) 6! 7! = 10!

c) 16! = 14! 5! 2!

b) 10! = 7! 5! 3!

d) 9! = 7! 3! 3! 2!.

20. Let an = (a1 ! a2 ! an1 !) 1, and an+1 = a1 ! a2 ! an1 !,


where a1 , a2 , ..., an1 are all positive integers. Show that
an+1 ! = a1 ! a2 ! an !.

16

CHAPTER 1. THE INTEGERS

21. Find all positive integers x, y, and z such that x! + y! = z!.

1.1 Computer Projects


Write programs to do the following:
1. Find the sum of the terms of a geometric series.
2. Evaluate n!
3. Evaluate binomial coefficients.
4. Print out Pascals triangle.
5. List the moves in the Tower of Hanoi puzzle (see problem 18).
6. Expand (x + y)n , where n is a positive integer, using the binomial theorem.

1.2

Divisibility

When an integer is divided by a second nonzero integer, the quotient may or


may not be an integer. For instance, 24/8 = 3 is an integer, while 17/5 = 3.4
is not. This observation leads to the following definition.
Definition. 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 a | b, while if a does not divide b, we write a - b.
Example. The following examples illustrate the concept of divisibility of integers: 13 | 182, 5 | 30, 17 | 289, 6 - 44, 7 - 50, 3 | 33, and 17 | 0.
Example. The divisors of 6 are 1, 2, 3, and6. The divisors of 17 are
1 and 17. The divisors of 100 are 1, 2, 4, 5, 10, 20, 25, 50, and
100.

In subsequent sections, we will need some simple properties of divisibility.


We now state and prove these properties.

1.2. DIVISIBILITY

17

Proposition 1.3. If a, b, and c are integers with a | b and b | c, then a | c.


Proof. Since a | b and b | c, there are integers e and f with ae = b and bf = c.
Hence, bf = (ae)f = a(ef ) = c, and we conclude that a | c.

Example. Since 11 | 66 and 66 | 198, Proposition 1.3 tells us that 11 | 198.

Proposition 1.4. If a, b, m, and n are integers, and if c | a and c | b, then


c | (ma + nb).
Proof. Since c | a and c | b, there are integers e and f such that a = ce and
b = cf . Hence, ma + nb = mce + ncf = c(me + nf ). Consequently, we see
that c | (ma + nb).

Example. Since 3 | 21 and 3 | 33, Proposition 1.4 tells us that


3 | (5 21 3 33) = 105 99 = 6.
The following theorem states an important fact about division.
The Division Algorithm. If a and b are integers with b > 0, then there are
unique integers q and r such that a = bq + r with 0 r < b.
In the equation given in the division algorithm, we call q the quotient and
r the remainder.
We note that a is divisible by b if and only if the remainder in the division algorithm is zero. Before we prove the division algorithm, consider the
following examples.

Example. If a = 133 and b = 21, then Q = 6 and r = 7, since 133 = 21 6 + 7.


Likewise, if a = 50 and b = 8, then q = 7 and r = 6, since 50 = 8(7)+6.

For the proof of the division algorithm and for subsequent numerical computations,we need to define a new function.

Definition. Let x be a real number. The greatest integer in x, denoted by


[x], is the largest integer less than or equal to x.

18

CHAPTER 1. THE INTEGERS

Example. We have the following values for the greatest integer in x : [2.2] =
2, [3] = 3, and [1.5] = 2.
The proposition below follows directly from the definition of the greatest
integer function.
Proposition 1.5. If x is a real number, then x 1 < [x] x.
We can now prove the division algorithm. Note that in the proof we
give explicit formulae for the quotient and remainder in terms of the greatest
integer function.
Proof. Let q = [a/b] and r = a b[a/b]. Clearly a = bq + r. To show that the
remainder r satisfies the appropriate inequality, note that from Proposition
1.5, it follows that
(a/b) 1 < [a/b] a/b.
We multiply this inequality by b, to obtain
a b < b[a/b] a.
Multiplying by -1, and reversing the inequality, we find that
a b[a/b] < b a.
By adding a, we see that
0 r = a b[a/b] < b.
To show that the quotient and the remainder r are unique, assume that we
have two equations a = bq1 + r1 and 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 ).
This tells us that b divides r1 r2 . 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 r1 = r2 . Since bq1 + r1 = bq2 + r2 and r1 = r2 we also see
that q1 = q2 . This shows that the quotient q and the remainder r are unique.

You might also like