Bab 2 Bilangan Prima
Bab 2 Bilangan Prima
Bab 2 Bilangan Prima
Prime Numbers
Prime numbers, the building blocks of integers, have been studied extensively
over the centuries. Being able to present an integer uniquely as product of
primes is the main reason behind the whole theory of numbers and behind the
interesting results in this theory. Many interesting theorems, applications and
conjectures have been formulated based on the properties of prime numbers.
In this chapter, we present methods to determine whether a number is prime
or composite using an ancient Greek method invented by Eratosthenes. We also
show that there are infinitely many prime numbers. We then proceed to show
that every integer can be written uniquely as a product of primes.
We introduce as well the concept of diophantine equations where integer so-
lutions from given equations are determined using the greatest common divisor.
We then mention the Prime Number theorem without giving a proof of course in
addition to other conjectures and major results related to prime numbers.
31
Example 15. The integers 2, 3, 5, 7, 11 are prime integers.
Note that any integer greater than 1 that is not prime is said to be a composite
number.
Proof. We present the proof of this Lemma by contradiction. Suppose that there
is an integer greater than one that has no prime divisors. Since the set of integers
with elements greater than one with no prime divisors is nonempty, then by the
well ordering principle there is a least positive integer n greater than one that has
no prime divisors. Thus n is composite since n divides n. Hence
Notice that a < n and as a result since n is minimal, a must have a prime divisor
which will also be a divisor of n.
Theorem 12. If n is a composite integer, then n has a prime factor not exceeding
√
n.
Proof. Since n is composite, then n = ab, where a and b are integers with 1 <
√
a ≤ b < n. Suppose now that a > n, then
√
n<a≤ b
and as a result
√ √
ab > n n = n.
2.1. THE SIEVE OF ERATOSTHENES 33
√
Therefore a ≤ n. Also, by Lemma 3, a must have a prime divisor a1 which is
√
also a prime divisor of n and thus this divisor is less than a1 ≤ a ≤ n.
We now present the algorithm of the Sieve of Eratosthenes that is used to de-
termine prime numbers up to a given integer.
1. Write a list of numbers from 2 to the largest number n you want to test.
Note that every composite integer less than n must have a prime factor less
√
than n. Hence you need to strike off the multiples of the primes that are
√
less than n
2. Strike off all multiples of 2 greater than 2 from the list . The first
remaining number in the list is a prime number.
4. Repeat the above steps until no more multiples are found of the prime
√
inte- gers that are less than n
Exercises
1. Use the Sieve of Eratosthenes to find all primes less than 100.
2. Use the Sieve of Eratosthenes to find all primes less than 200.
Proof. We present the proof by contradiction. Suppose there are finitely many
primes p1, p2, ..., pn, where n is a positive integer. Consider the integer Q such
that
Q = p1p2...pn + 1.
By Lemma 3, Q has at least a prime divisor, say q. If we prove that q is not one
of the primes listed then we obtain a contradiction. Suppose now that q = pi for 1
≤ i ≤ n. Thus q divides p1p2...pn and as a result q divides Q − p1p2...pn.
Therefore q divides 1. But this is impossible since there is no prime that divides
1 and as a result q is not one of the primes listed.
The following theorem discusses the large gaps between primes. It simply
states that there are arbitrary large gaps in the series of primes and that the
primes are spaced irregularly.
Theorem 14. Given any positive integer n, there exists n consecutive composite
integers.
Notice that every integer in the above sequence is composite because k divides
(n + 1)! + k if 2 ≤ k ≤ n + 1 by 4.
2.3. THE FUNDAMENTAL THEOREM OF ARITHMETIC 35
Exercises
Lemma 4. If a,b,c are positive integers such that (a, b) = 1 and a | bc, then a | c.
Proof. We present the proof of this result by induction. For k = 1, the result is
trivial. Assume now that the result is true for k. Consider n1n2...nk+1 that is
divisible by p. Notice that either
We now state the fundamental theorem of arithmetic and present the proof
using Lemma 5.
Cancel out all common primes from the factorizations above to get
pj1 pj2 ...pju = qi1 qi2 ...qiv
Thus all the primes on the left side are different from the primes on the right
side. Since any pjl (l = 1, · · · , n) divides pj1 pj2 ...pju , then pjl must divide qi1
qi2 ...qiv , and hence by Lemma 5, pj1 must divide qjk for some 1 ≤ k ≤ v
which is impos- sible. Hence the representation is unique.
where all the pi are distinct for 1 ≤ i ≤ j. One can also write a formal product
Y
n= pαi i , (2.2)
all primes pi
2.3. THE FUNDAMENTAL THEOREM OF ARITHMETIC 38
where we exclude in these expansions any prime p with power 0 in both a and b
(and thus some of the powers above may be 0 in one expansion but not the
other). Of course, if one prime pi appears in a but not in b, then ai =ƒ 0 while bi
= 0, and vise versa. Then the greatest common divisor is given by
min(a1,b2) min(a2,b2)
(a, b) = p 1 p 2 ...pmin(ann,bn)
Lemma 6. Let a and b be relatively prime positive integers. Then if d divides ab,
there exists d1 and d2 such that d = d1d2 where d1 is a divisor of a and d2 is a
divisor of b. Conversely, if d1 and d2 are positive divisors of a and b,
respectively, then d = d1d2 is a positive divisor of ab.
Proof. Let d1 = (a, d) and d2 = (b, d). Since (a, b) = 1 and writing a and b in
terms of their prime decomposition, it is clear that d = d1d2 and (d1, d2) = 1. Note
that every prime power in the factorization of d must appear in either d1 or d2.
Also the prime powers in the factorization of d that are prime powers dividing a
must appear in d1 and that prime powers in the factorization of d that are prime
powers dividing b must appear in d2.
2.3. THE FUNDAMENTAL THEOREM OF ARITHMETIC 39
is a divisor of ab.
This result had been conjectured by Gauss but was first proved by Dirichlet.
Dirichlet proved this theorem using complex analysis, but the proof is so chal-
lenging. As a result, we will present a special case of this theorem and prove that
there are infinitely many primes in a given arithmetic progression. Before stating
the theorem about the special case of Dirichlet’s theorem, we prove a lemma
that will be used in the proof of the mentioned theorem.
Lemma 7. If a and b are integers both of the form 4n + 1, then their product ab
is of the form 4n + 1
Theorem 17. There are infinitely many primes of the form 4n + 3, where n is a
positive integer.
2.3. THE FUNDAMENTAL THEOREM OF ARITHMETIC 40
Proof. Suppose that there are finitely many primes of the form 4n + 3, say p0 =
3, p1, p2, ..., pn. Let
N = 4p1p2...pn + 3.
Notice that any odd prime is of the form 4n + 1 or 4n + 3. Then there is at least
one prime in the prime factorization of N of the form 4n + 3, as otherwise, by
Lemma 7, N will be in the form 4n + 1. We wish to prove that this prime in the
factorization of N is none of p0 = 3, p1, p2, ..., pn. Notice that if
3 | N,
which is impossible since pi ƒ= 3 for every i. Hence 3 doesn’t divide N . Also, the
other primes p1, p2, ..., pn don’t divide N because if pi | N , then
pi | (N − 4p1p2...pn) = 3.
Hence none of the primes p0, p1, p2, ..., pn divides N. Thus there are infinitely
many primes of the form 4n + 3.
Exercises
3. Show that all the powers of in the prime factorization of an integer a are
even if and only if a is a perfect square.
Definition 9. The least common multiple (l.c.m.) of two positive integers is the
smallest positive integer that is a multiple of both.
We denote the least common multiple of two positive integers a an b by (a, b).
We can figure out (a, b) once we have the prime factorization of a and b. To
do that, let
a = pa1 pa2 ...pan and b = pb1 pb2 ...pbn,
1 2 m 1 2 m
where (as above) we exclude any prime with 0 power in both a and b. Then
max(a1,b1) max(a2,b2) max(an,bn)
(a, b) = p1 p2 ...pm , where max(a, b) is the maximum of
the two integers a and b. We now prove a theorem that relates the least common
multiple of two positive integers to their greatest common divisor. In some
books, this theorem is adopted as the definition of the least common multiple.
To prove the theorem we present a lemma
min(a, b) + max(a, b) = a + b
1. (a, b) ≥ 0;
2.5. LINEAR DIOPHANTINE EQUATIONS 42
and
max(a1,b1) max(a2,b2)
max(an,bn)
(a, b) = p1 p2 ...pm ,
then
max(a1,b1) max(a2,b2) max(an,bn) min(a1,b2) min(a2,b2) min(an,bn)
(a, b)(a, b) = p1 p2 ...pm p1 p2 ...pn
max(a1,b1)+min(a1,b1) max(a2,b2)+min(a2,b2)
1= p p2 ...pmax(a
m
n,bn)+min(an,bn)
= pa1+b
1
1 a2+b2
p 2 ...p(an+b n
n)
Note also that we used Lemma 8 in the above equations. For part 3, it would be a
nice exercise to show that ab/(a, b) | m (Exercise 6). Thus (a, b) | m.
Exercises
3. Find the least common multiple and the greatest common divisor of 25567211
and 23587213.
5. Show that if a and b are positive integers then the greatest common
divisor of a and b divides their least common multiple. When are the least
common multiple and the greatest common divisor equal to each other.
Note that a solution to the linear diophantine equation (x0, y0) requires x0 and
y0 to be integers. The following theorem describes the case in which the
diophantine equation has a solution and what are the solutions of such equations.
x = x0 + (b/d)t y = y0 − (a/d)t
Proof. Suppose that the equation ax + by = c has integer solution x and y. Thus
since d | a and d | b, then
d | (ax + by) = c.
2.5. LINEAR DIOPHANTINE EQUATIONS 44
Now we have to prove that if d | c, then the equation has integral solution.
Assume that d | c. By theorem 9, there exist integers m and n such that
d = am + bn.
c = dk
x0 = km and y0 = kn.
We have to prove now that x and y are solutions for all integers t. Notice that
We now show that every solution for the equation ax + by = c is of the form
x = x0 + (b/d)tand y = y0 − (a/d)t.
Hence
a(x − x0) = b(y − y0).
2.5. LINEAR DIOPHANTINE EQUATIONS 45
Notice that (a/d, b/d) = 1 and thus we get by Lemma 4 that a/d | y − y0. As a
result, there exists an integer t such that y = y0 − (a/d)t. Now substituting y − y0
in the equation
a(x − x0) = b(y − y0).
We get
x = x0 + (b/d)t.
Example 19. The equation 3x+6y = 7 has no integer solution because (3, 6) = 3
does not divide 7.
Example 20. There are infinitely many integer solutions for the equation 4x +
6y = 8 because (4, 6) = 2 | 8. We use the Euclidean algorithm to determine m
and n where 4m + 6n = 2. It turns out that 4(−1) + 6(1) = 2. And also 8 = 2.4.
Thus x0 = 4.(−1) = −4 and y0 = 4.1 = 4 is a particular solution. The solutions
are given by
x = −4 + 3t y = 4 − 2t
for all integers t.
Exercises
1. Either find all solutions or prove that there are no solutions for the
diophan- tine equation 21x + 7y = 147.
2. Either find all solutions or prove that there are no solutions for the
diophan- tine equation 2x + 13y = 31.
3. Either find all solutions or prove that there are no solutions for the
diophan- tine equation 2x + 14y = 17.
2.5. LINEAR DIOPHANTINE EQUATIONS 46
4. A grocer orders apples and bananas at a total cost of $8.4. If the apples
cost 25 cents each and the bananas 5 cents each, how many of each type of
fruit did he order.
2.6 The function [x] , the symbols ”O”, ”o” and ”∼”
We start this section by introducing an important number theoretic function. We
proceed in defining some convenient symbols that will be used in connection
with the growth and behavior of some functions that will be defined in later
chapters.
Definition 11. The function [x] represents the largest integer not exceeding x. In
other words, for real x, [x] is the unique integer such that
1. [x + n] = [x] + n, if n is an integer.
Using the definition of [x], it will be easy to see that the above properties are
direct consequences of the definition.
We now define some symbols that will be used to estimate the growth of number
theoretic functions. These symbols will be not be really appreciated in the
context of this book but these are often used in many analytic proofs.
Now, the relation g(x) = o(f (x)), pronounced ”small-oh” of f (x), is used
to indicate that f (x) grows much faster than g(x). It formally says that
g(x)
lim = 0. (2.4)
x→∞ f
(x)
More generally, g(x) = o(f (x)) at a point b if
g(x)
lim = 0. (2.5)
x→b f
(x)
Example 22. sin(x) = o(x) at ∞, and xk = o(ex) also at ∞ for every constant
k.
There are some other properties that we did not mention here, properties that are
rarely used in number theoretic proofs.
Exercises
Lemma 9. Let p be a prime and let m ∈ Z+. Then the highest power of p dividing
m! is
Σ∞ Σ
m
Σ pi
i=1
Σ Σ
Proof. Among all the integers from 1 till m, there are exactly m integers that
Σ Σ p Σ
m
are divisible by p. These are p, 2p, ..., p p. Similarly we see that there are
Σ p
i
m
integers that are divisible by pi. As a result, the highest power of p dividing m! is
Σ .Σ m Σ Σ
m
ΣΣ Σ Σ Σ
m
i − i+1 =
i≥1 p p i≥1 p
i i
π(x) ∼ x/logx
So this theorem says that you do not need to find all the primes less than x to
find out their number, it will be enough to evaluate x/logx for large x to find an
estimate for the number of primes. Notice that I mentioned that x has to be large
enough to be able to use this estimate.
Several other theorems were proved concerning prime numbers. many great
mathematicians approached problems that are related to primes. There are still
many open problems of which we will mention some.
Conjecture 1. Twin Prime Conjecture There are infinitely many pairs primes p
and p + 2.