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

3.

1 The Sieve of Eratosthenes


(MATH 206- Elementary Number Theory)

NESTOR G. ACALA, PhD

Mathematics Department
Mindanao State University Main Campus
Marawi City
nestor.acala@msumain.edu.ph
If an integer a > 1 is composite, then it can be written as

a = bc , where 1 < b < a and 1 < c < a.

Assuming that b ≤ c, then we obtain



a = bc ≥ b2 =⇒ b ≤ a.

Since b > 1,by Theorem 3-2, it has at least one prime factor p. Hence,

p ≤ b ≤ a.

Moreover, since p |b and b|a, it follows that p |a. Thus, a composite number a

will always possess a prime factor p satisfying p ≤ a.
Remark. In testing the primality of a specific integer a > 1, it is therefore

suffices to divide a by those primes not exceeding a (presuming, of course,

the availability of a list of primes up to a).


Example. Consider the integer a = 509. Inasmuch as 22 < 509 < 23, we
need only to try out the primes which are not larger than 22 as possible
divisors; namely 2, 3, 5, 7, 11, 13, 17, 19. Dividing 509 by each of these in
turn, we find that none serves as a divisor of 509. Hence, 509 must be a
prime number.
Example. Consider the √ integer a = 2093. We determine its the canonical
form. Note that 45 < 2093 < 46, hence it is enough to examine the
multiples 2p , 3p , 5p , 7p , 11p , 13p , 17p , 19p , 23p , 29p , 31p , 37p , 41p , 43p .. By
trial, the prime 7√divides 2093 and 2093 = 7 · 299. Using the same idea to
299, since 17 < 299 < 18, we need to check the divisibility of 299 to the
primes less than 18 such as 2, 3, 5, 7, 11, 13, 17. And we can check that 13 is
a divisor of 299 and 299 = 13 · 23. But 23 is already a prime number. Hence,
2093 has exactly three prime factors, 7, 13 and 23:

2093 = 7 · 13 · 23.
Eratosthenes of Cyrene (276-194 B.C.-Greek Mathematician, he was
consdered gifted in all branches of learning, was nicknamed “Beta" because
he stood at least second in every field. His most impressive feat was the
accurate measurement of the Earth’s circumference by a simple application of
Euclidean geometry.


If an integer a > 1 is not divisble by a prime p ≤ a, then a is of necessity a
prime. Eratosthenes used this fact as a basis of a clever technique called the
“Sieve of Eratosthenes" for finding all primes below a given integer n.
Scheme: This can be done by writing down the integers from 2 to n in their
natural order and then systematically eliminating by striking out all multiples

2p , 3p , 5p , · · · of primes p <≤ n. The integers that are left on the
list=those that do not fall through the “seive" are primes.
Example: Determine all prime numbers not exceeding 100.
2 3 4 5 6 7 8 9 10
11 12 13 14 15 16 17 18 19 20
21 22 23 24 25 26 27 28 29 30
31 32 33 34 35 36 37 38 39 40
41 42 43 44 45 46 47 48 49 50
51 52 53 54 55 56 57 58 59 60
61 62 63 64 65 66 67 68 69 70
71 72 73 74 75 76 77 78 79 80
81 82 83 84 85 86 87 88 89 90
91 92 93 94 95 96 97 98 99 100
Theorem 3-4 (Euclid). There are infinite number of primes.

Proof: Going by contradiction, suppose there is the last prime say Pn . Thus, we
can make a list of primes: 2, 3, 5, 7, · · · pn . Consider the positive integer

P = p1 p2 · · · pn + 1.

Since P > 1 , we may put Theorem 3-2 to work once again and conclude that P
is divisible by some prime p. But p1 , p2 , · · · , pn are the only prime numbers, so
that p must be one of the primes p1 , p2 , · · · , pn .
Combining the relation
p |p1 p2 · · · pn with p |P ,
we arrive at p |P − p1 p2 · · · pn or, equivalently, p |1. The only positive divisor of
the integer 1 is 1 and itself and, since p > 1, a contradiction arises. Thus no
finite list of primes is complete, whence the number of primes is infinite.
It is interesting to note that in forming the integers

pk = p1 p2 · · · pk + 1,

the first five, namely

P1 = 2 + 1 = 3
P2 = 2 · 3 + 1 = 7
P3 = 2 · 3 · 5 + 1 = 31
p4 = 2 · 3 · 5 · 7 + 1 = 211
P5 = 2 · 3 · 5 · 7 · 11 + 1 = 2311,

are all prime numbers.


However,
P6 = 59 · 509, P7 = 19 · 97 · 277, P8 = 347 · 27953
are not prime.
Question.
A question to which the answer is not known is whether there exist infinitely
many k for which Pk is a prime. For that matter, are there infinitely many
composite Pk ?
Form the infinite sequence of positive integers

n1 = 2,
n2 = n1 + 1,
n3 = n1 n2 + 1,
n4 = n1 n2 n3 + 1,
..
.
nk = n1 n2 · · · nk −1 + 1.

Since each nk > 1, each of these integers is divisible by a prime. But no two nk
can have the same prime divisor.
To see this, let d = gcd(ni , nk ) and suppose that i < k. Then d divides ni ,
hence must divide n1 n2 · nk −1 . Since d |nk , Theorem 2-2(7) tells us that
d |nk − n1 n2 · · · nk −1 or d |1. The implication is that d = 1 and so the integerss
nk (k = 1, 2, · · · ) are pairwise relatively prime. The point which we wish to make
is that there are as many distinct primes as there intgers nk , namely, infinitely
many of them.
Let Pn denote the nth of the prime numbers in their natural order. Euclid’s proof
shows that an estimate to the rate of increase of pn is

pn+1 < p1 p2 · · · pn + 1 < pnn + 1.

For instance, when n = 3, the inequality states that

7 = p4 < p33 + 1 = 53 + 1 = 126.

One can see that this estimate is wildly extravagant. A sharper limitation to the
size of pn is given in the next theorem.
n −1
Theorem 3-5. If pn is the nth prime number, then pn ≤ 22 .

Proof: We will use induction on n. Clearly, the asserted inequality is true when
n = 1. As hypothesis of the induction, we assume that n > 1 and that the result
holds for all integers up to n. Then

pn + 1 ≤ p1 p2 · pn + 1
n −1 2
+···+2n−1 +1
≤ 2 · 22 · · · 22 + 1 = 21+2+2 .

Recalling the identity

1 + 2 + 22 + · · · + 2n−1 = 2n − 1,
we obtain
n −1
pn+1 ≤ 22 + 1.
n
But 1 ≤ 22 −1
for all n; whence
n n
pn+1 ≤ 22 −1
+ 22 −1
n n
= 2 · 22 −1
= 22 ,

completing the induction step, and the argument.


n
Corollary. For n ≥ 1, there are at least n + 1 prime less than 22 .

Proof: From the previous theorem, we know that p1 , p2 , · · · , pn+1 are all less
n
than 22 .

You might also like