4.7 Applications of prime factorization
The Fundamental Theorem of Arithmetic (Theorem 4.6.5) has a
number of important consequences; in this section we shall explore
some of them. The first goes back all the way to Euclid (again!), and
concerns the question of how many prime numbers there are.
 
At the beginning of Section 4.6 we saw the
technique of the Sieve of Eratosthenes to find the first few prime
numbers; it consisted of taking a grid of the first so many natural
numbers and crossing out all multiples of , then all multiples of
, then all multiples of  and so on, and afterwards the numbers
which remained were the primes. We took only a fairly small grid, with
the numbers up to ; if we had taken a larger grid (say, all the
numbers up to ), we would have had to go through rather more
times crossing out. Is it possible that, if we were to go far enough,
there would come a point beyond which all the numbers were
crossed out? In other words, might there only be a finite number of
prime numbers? Euclid was able to show that the answer to these
questions is ‘‘no’’. We shall give Euclid’s proof, essentially
unchanged after more than  years.
 
Theorem 4.7.1
There are infinitely many prime numbers
in .
 
 
Proof. The proof is by contradiction. Assume that there are only
finitely many prime numbers, say ,
where , and consider the number
 | 
 | 
 | 
Theorem 4.6.5
implies that  can be written as a product of primes, so
 must divide  for some
; but this is a contradiction, since
 is of the form  for some
. Thus there must be infinitely many prime
numbers in .  
 
There we are; just a few short lines of argument, but they settle the
matter beyond any doubt, showing in particular how powerful the
technique of proof by contradiction is.
 
Euclid’s result above did not require the full force of the
Fundamental Theorem of Arithmetic, since it only needed the existence
of prime factorizations, not their uniqueness. In the other
applications which we shall consider, both parts of the Fundamental
Theorem of Arithmetic will be needed.
 
We begin with a notational convention: it is customary to write the
factors in a product of primes in ascending order of size, and to
collect together equal factors, writing  for  factors equal to
. Thus we write a given number  as
 for some , where
 are prime numbers with , and
. (Note that this notation does not imply
that  are the first  prime numbers.)
 
Example 4.7.2
 
 
It is often convenient to relax the requirement
 to , with the obvious
convention that  (this is particularly useful when comparing
the prime factorizations of two or more numbers).
Given the prime factorization of a natural number, it is now easy to
obtain its positive factors.
 
Proposition 4.7.3
Let
, where ,
 are prime numbers, and
. Then a natural number  is a factor
of  if and only if ,
where  for each .
 
 
Example 4.7.4
The positive factors of  are of the form
 | 
 | 
 | 
Thus the set of all
positive factors of  is
 | 
 | 
 | 
 
 
Proof. ‘‘.’’ Suppose that  is a factor of
, say , where . Since the
prime factorization of  is obtained by joining
together those of  and , the only
possible prime factors of  and 
are . Writing
 | 
 | 
 | 
we obtain
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
Using the uniqueness of prime factorization, we may equate powers of
, from which we conclude that
 for each
.
 
‘‘’’. Conversely, it is clear that each number of the form
, where
 for each , is a
factor of .
 
 
This result enables us to compute the number of positive factors of
a given number.
 
Corollary 4.7.5
Let
, where ,
 are prime numbers, and
. Then  has
 positive factors.
 
 
Example 4.7.6
The number of positive factors of  is
 | 
 | 
 | 
 
 
Proof. This follows from Proposition 4.7.3, as there are
 choices for each   
 
Example 4.7.7
The factors of 
are  with 
and , that is,
; the number of
factors is 
 
In this example we can display the factors in a -dimensional
array as follows:
 | 
 | 
 | 
If there are more than two primes involved, it is not quite so easy to
arrange the array on the page; but the idea is the same.
 
 
We next introduce a standard piece of notation.
 
Notation 4.7.8
Given , we write  for
the smaller of  and  and  for the larger.
 
 
Lemma 4.7.9
For all ,
.
 
 
Proof. We may assume , and then  and
  
 
We can now explain how prime factorizations can be used to find the
highest common factor and lowest common multiple of two natural
numbers.
 
Proposition 4.7.10
Let
 and
, where ,
 are prime numbers, and
. Then
 | 
 | 
 | 
where
 and  for each
.
 
 
Example 4.7.11
Given  and , the prime
factorizations are
 | 
 | 
 | 
so  and
 
 
Proof. By Proposition 4.7.3, each factor  of  has the
form , where
 for each
; if  is also to be a factor
of , we require that  for each
 as well. Thus the set of
common factors of  and  consists of the numbers
 with
 for each
; the largest possible such
value of  is , so
the highest common factor is as described.
 
Theorem 4.5.5 implies that
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
where, for each ,
 | 
 | 
 | 
by Lemma 4.7.9, as required.