CHAPTER 5. Number Theory. 1. Integers and Division. Discussion
CHAPTER 5. Number Theory. 1. Integers and Division. Discussion
Number Theory
1.1. Divisibility.
Definition 1.1.1. Given two integers a and b we say a divides b if there is an
integer c such that b = ac. If a divides b, we write a|b. If a does not divide b, we
write a6 | b.
Discussion
Discussion
146
1. INTEGERS AND DIVISION 147
Theorem 1.2.1 states the most basic properties of division. Here is the proof of
part 3:
Proof of part 3. Assume a, b, and c are integers such that a|b and b|c. Then by
definition, there must be integers m and n such that b = am and c = bn. Thus
c = bn = (am)n = a(mn).
Since the product of two integers is again an integer, we have a|c.
Exercise 1.2.1. Prove part 1 of Theorem 1.2.1.
Exercise 1.2.2. Prove part 2 of Theorem 1.2.1.
Discussion
The division algorithm is probably one of the first concepts you learned relative
to the operation of division. It is not actually an algorithm, but this is this theorem’s
traditional name. For example, if we divide 26 by 3, then we get a quotient of 8 and
remainder or 2. This can be expressed 26 = 3 · 8 + 2. It is a little trickier to see what
q and r should be if a < 0. For example, if we divide −26 is by 3, then the remainder
is not −2. We can, however, use the equation 26 = 3 · 8 + 2 to our advantage:
−26 = 3 · (−8) − 2 = [3 · (−8) − 3] − 2 + 3 = 3(−9) + 1
So dividing −26 by 3 gives a quotient of −9 and remainder 1. The condition 0 ≤ r < d
makes r and q unique for any given a and d.
1.4. Proof of Division Algorithm. Proof. Suppose a and d are integers, and
d > 0. We will use the well-ordering principle to obtain the quotient q and remainder
r. Since we can take q = a if d = 1, we shall assume that d > 1.
Let S be the set of all natural numbers of the form a−kd, where k is an integer.
In symbols
S = {a − kd|k ∈ Z and a − kd ≥ 0}.
If we can show that S is nonempty, then the well-ordering principle will give us a
least element of S, and this will be the remainder r we are looking for. There are two
cases.
1. INTEGERS AND DIVISION 148
Discussion
Prime numbers are the building blocks of arithmetic. At the moment there are
no efficient methods (algorithms) known that will determine whether a given integer
is prime or find its prime factors. This fact is the basis behind many of the cryp-
tosystems currently in use. One problem is that there is no known procedure that
will generate prime numbers, even recursively. In fact, there are many things about
prime numbers that we don’t know. For example, there is a conjecture, known as
Goldbach’s Conjecture, that there are infinitely many prime pairs, that is, consecu-
tive odd prime numbers, such as 5 and 7, or 41 and 43, which no one so far has been
able to prove or disprove. As the next theorem illustrates, it is possible, however, to
prove that there are infinitely many prime numbers. Its proof, attributed to Euclid,
is one of the most elegant in all of mathematics.
Theorem 1.5.1. There are infinitely many prime numbers.
1. INTEGERS AND DIVISION 149
Proof. We prove the theorem by contradiction. Suppose there are only finitely
many prime numbers, say, p1 , p2 , ..., pn . Let
N = p1 p2 · · · pn + 1.
Then N is an integer greater than each of p1 , p2 , ..., pn , so N cannot be prime. In
Example 9, Module 3.3, we showed that N can be written as a product of prime
numbers; hence, some prime p divides N . We may assume, by reordering p1 , p2 , ..., pn ,
if necessary, that p = p1 . Thus N = p1 a for some integer a. Substituting, we get
p1 a = p1 p2 · · · pn + 1
p1 a − p1 p 2 · · · p n = 1
p1 (a − p2 · · · pn ) = 1.
Thus, a − p2 · · · pn is a positive integer. Since p1 is a prime number, p1 > 1, and so
p1 (a − p2 · · · pn ) > 1.
But this contradicts the equality above.
Discussion
We have already given part of the proof Theorem 1.6.1 in an example of Module
3.3 Induction. There we showed that every positive integer greater than 1 can be
written as a product of prime numbers. The uniqueness of the factors is important,
and the proof that they are unique, which requires a few additional ideas, will be
postponed until the next module.
The prime factorization of 140 is 2 · 2 · 5 · 7. You can see one reason why we do
not want 1 to be prime: There is no limit to the number of times 1 may be repeated
as a factor, and that would give us non-unique prime factorizations.
1.7. Factoring.
√Theorem 1.7.1. If n is a composite integer, then n has a factor less than or equal
to n.
1. INTEGERS AND DIVISION 150
Discussion
Theorem 1.7.1 can be helpful in narrowing down the list of possible prime factors
of a number. It was proved in an example of Module 3.2 Methods of Proof and
exploited in another example of that module. If the number 253 is composite, for
example, it must have a factor less than or equal to 15. Thus we need only check the
primes 2, 3, 5, 7, 11, and 13. It turns out 253 = 11 · 23.
Discussion
Mersenne primes are a special class of primes, which lend themselves to a nice
theoretical development. Not all primes are Mersenne, though, and not all numbers
of the form 2p − 1 are prime. For example, 2p − 1 is prime for p = 2, 3, 5, and 7, but
211 − 1 = 2047 = 23 · 89, which is not prime. On the other hand, the primes 5 and 11
cannot be written in this form.
(1) The greatest common divisor of a and b, denoted GCD (a, b), is the
largest positive integer d such that d|a and d|b.
(2) The least common multiple of a and b, denoted LCM (a, b), is the smallest
positive integer m such that a|m and b|m.
(3) a and b are called relatively prime if GCD (a, b) = 1.
(4) The integers a1 , a2 , a3 , . . . , an are called pairwise relatively prime if GCD(ai , aj ) =
1 for 1 ≤ i < j ≤ n.
(5) The Euler φ function is the function φ : Z+ → N defined by φ(n) = the
number of positive integers less than n that are relatively prime to n.
Lemma 1.9.1. Suppose a and b are integers and m = LCM(a, b). If c is a positive
integer such that a|c and b|c, then m|c.
Proof. Suppose a|c and b|c, but m6 | c. By the division algorithm there are
(unique) positive integers q and r such that c = mq + r and 0 ≤ r < m. Since m6 | c,
r 6= 0; that is, r > 0. Write r = c − mq. Since a and b both divide c and m, a
and b both divide r. But this contradicts the fact that m is supposed to be the least
positive integer with this property. Thus m|c.
1. INTEGERS AND DIVISION 151
Discussion
If we are given the prime factorizations of two integers, then it is easy to find
their GCD and LCM. For example, 600 = 23 · 3 · 52 and 220 = 22 · 5 · 11 has greatest
common divisor 22 · 5 = 20 and least common multiple 23 · 3 · 52 · 11 = 6600. Since
prime factorizations can be difficult to find, however, this idea does not lead to an
efficient way to compute GCD’s. We will introduce an efficient algorithm in the next
module that does not involve knowledge about prime factorizations.
Exercise 1.9.1. Let F (n) denote the n-th term of the Fibonacci Sequence. Prove
using induction that GCD(F (n), F (n − 1)) = 1 for all integers n ≥ 2.
Discussion
The mod operation is derived from the Division Algorithm: If we divide the
integer a by the positive integer m, we get a unique quotient q and remainder r
satisfying a = mq + r and 0 ≤ r < m. The remainder r is defined to be the value of
a mod m. One of the notational aspects that may seem a little unusual is that we
write a + b(mod m) for (a + b)(mod m). Also, the symbol (mod m) may occasionally
be omitted when it is understood.
Example 1.10.1. Here are some examples.
(a) 12 mod 5 = 2
(b) 139 mod 5 = 4
(c) 1142 mod 5 = 2
(d) 1142 ≡ 12 ≡ 2(mod 5)
(e) 1142 + 139 ≡ 2 + 4 ≡ 6 ≡ 1(mod 5)
(f ) 1142 · 139 ≡ 2 · 4 ≡ 8 ≡ 3(mod 5)
One of the differences to note between the concept of congruence modulo m verses
the mod operator is that an integer, k may be congruent to infinitely many other
integers modulo m, however, k mod m is equal to one single integer. For example, 139
mod 5 = 4, but 139 is congruent to all the elements of {. . . , −6, −1, 4, 9, 14, 19, . . . }.
Exercise 1.10.1. Given a positive integer m, prove that the assignment a 7→
a mod m defines a function f : Z → Z. Is f one-to-one? onto? What is its range?
Proof of 3b. Since a ≡ b(mod m) and c ≡ d(mod m), there must be integers s
and t such that b = a + sm and d = c + tm (part 2). Thus
bd = (a + sm)(c + tm)
= ac + atm + smc + stm2
= ac + (at + sc + stm)m
1. Hashing Functions
2. Pseudorandom Number Generators
3. Cryptology
Discussion
x0 = 1
x1 = (7 · 1 + 3)mod 11 = 10
x2 = (7 · 10 + 3)mod 11 = 7
x3 = (7 · 7 + 3)mod 11 = 8
x4 = (7 · 8 + 3)mod 11 = 4
x5 = (7 · 4 + 3)mod 11 = 9
x6 = (7 · 9 + 3)mod 11 = 0
x7 = (7 · 0 + 3)mod 11 = 3
etc.
Exercise 1.11.1. Prove that for a given modulus m, and arbitrary multiplier a,
increment c, and seed x0 , the sequence x0 , x1 , x2 , ... must eventually repeat.