PRIME NUMBERS We denote by N the set of natural numbers: 1,2

PRIME NUMBERS
YANKI LEKILI
We denote by N the set of natural numbers: 1,2, . . . ,
These are constructed using Peano axioms. We will not get into the philosophical questions related to this and simply assume the usual properties of natural numbers: There is
an addition and multiplication law on numbers. These satisfy the commutative, associative
and distributive laws. There is an order on N so that either a < b or b < a for distinct
natural numbers. Furthermore, every non-empty set in N has a smallest element, i.e. the
order on N is a well-ordering. Finally, we shall appeal to the principle of mathematical
induction.
We write Z for all integers: {. . . , −2, −1, 0, 1, 2, . . .} and Z≥0 for non-negative integers.
1. Divisibility
Definition 1. An integer a is divisible by b if there is a third integer c such that
a = bc
We write b | a if b divides a and b - a if b does not divide a.
The relation | is reflexive, a | a; transitive, b | a and c | b implies c | a, but not symmetric,
if b | a then it is not usually the case that a | b. In fact, if b and a are positive integers and
b | a, then we have b ≤ a.
Definition 2. A positive integer p is said to be a prime number (or simply a prime) if
p > 1 and p has no positive divisors except 1 and p.
The first few prime numbers are: 2, 3, 5, 7, 11, 13, 17, 19, 23, . . .
The primes are the “building blocks” of numbers. The following theorem makes this
precise:
Theorem 3. Every positive integer except 1 is a product of primes.
Proof. Let n ∈ N be a number. Either n is prime, when there is nothing to prove or n has
divisors between 1 and n. Let S be the set of divisors of n greater than 1. Then this set
has a smallest element m. We claim that m is a prime. Otherwise, there would be natural
number l with 1 < l < m such that l | m but since m | n, by transitivity, we have that
l | n. We obtained an element of S, namely l, that is smaller than the smallest element of
S. This is a contradiction. Hence, m must have been a prime. Therefore, n is either prime
or divisible by a prime less than n, say p1 in which case,
n = p1 n1 , 1 < n1 < n
1
2
YANKI LEKILI
Here n1 is either a prime, in which case the proof is completed or it is divisible by a prime
p2 , in which case, we have
n = p1 n1 = p1 p2 n2 ,
1 < n2 < n1 < n
Repeating the argument, we obtain a sequence of decreasing numbers n, n1 , . . . , nk−1 , . . .
The sequence stops when nk is prime for some k, and then we have:
n = p1 p2 . . . pk
Note that pi ’s in the above proof do not have to be distinct, we can group them together
and write:
n = pe11 pe22 . . . pess
to get the prime factorisation of the integer n. For example, we have:
666 = 2.32 .37
We will see later that the factors pei i are unique apart from rearrangement of factors. But,
first we need to develop our understanding of division a little more.
Lemma 4. (Division Algorithm) Given a ∈ Z and b > 0, there exists a unique q, r ∈ Z
such that a = qb + r and 0 ≤ r < b.
Proof. Consider the arithmetic progression
. . . , a − 3b, a − 2b, a − b, a, a + b, a + 2b, a + 3b . . .
extending indefinitely in both directions. Let S be the set of nonnegative elements in
this list. S is non-empty: Either a is nonnegative then a ∈ S, or if a is negative,then
a − ab = a(1 − b) ≥ 0 hence a − ab ∈ S. Now, S is non-empty, hence has a smallest element
r. Thus, by definition, we have r = a − qb for some q and r ≥ 0. Also r < b because
otherwise r − b = a − (q + 1)b would be an element of S that is smaller than r.
Next, to prove uniqueness, let a = q1 b + r1 = q2 b + r2 satisfying the same conditions.
Then (q1 − q2 )b = r2 − r1 . Taking absolute values, we get |q1 − q2 |b = |r2 − r1 |, hence
b | |r2 − r1 |, but 0 ≤ r1 , r2 < b hence |r2 − r1 | < b. Hence, it must be that |r2 − r1 | = 0 and
|q2 − q1 | = 0. In other words, r1 = r2 and q1 = q2 .
Definition 5. Let a, b ∈ N. The greatest common divisor of a and b is the greatest number
d ∈ N such that d | a and d | b. We write (a, b) (or gcd(a, b)) for the greatest common
divisor of a and b . The numbers a and b are said to be coprime (or relatively prime) if
(a, b) = 1.
For example, by listing all divisors of 12 and all divisors of 8, one can easily compute
(12, 8) = 4 but soon we will do this in a much more efficient way.
Theorem 6. If d = (a, b) then there exists integers x0 and y0 such that
d = (a, b) = ax0 + by0
PRIME NUMBERS
3
Another way to state this fundamental result is that the greatest common divisor of a
and b is a Z-linear combination of a and b.
Proof. Consider the set S of all natural numbers of the form ax + by with x and y in Z.
The set is non-empty, for example it contains a and b. Hence, S has a smallest element m.
So m is a natural number of the form m = ax0 + by0 for some integers x0 and y0 . Every
common divisor of a and b divides m, hence in particular d | m. To conclude that d = m,
we shall show that m | a and m | b. Using the division algorithm, write a = qm + r for
0 ≤ r < m. Let x0 = (1 − qx0 ) and y 0 = −qy0 . Then, we have
ax0 + by 0 = a − qax0 − qby0 = a − qm = r
Hence, by the minimality property of m it follows that r = 0. This shows that m | a,
similarly we show that m | b.
Note that the integers x0 , y0 are not uniquely determined. Indeed, given one solution
(x0 , y0 ) to d = ax0 + by0 , we can obtain infinitely many other solutions as:
d = a(x0 + nb) + b(y0 − na) for n ∈ Z.
The previous theorem gives a characterization of the greatest common divisor of a and b.
Namely, it is least positive integer value of ax + by where x and y ranges over all integers.
But how to compute this value? (and the integers x0 , y0 ? )
We shall use Euclid’s algorithm. The crucial observation is the following lemma:
Lemma 7. If a = qb + r then (a, b) = (b, r).
Proof. If d is a common divisor of a and b, then d | a − qb = r, hence d is a common divisor
of b and r. Conversely, if d is a common divisor of b and r, then d | qb + r = a, hence d
is a common divisor of a and b. Therefore, the set of common divisors of a and b agree
with the set of common divisors of b and r, hence the greatest common divisors are the
same.
Now, given a, b ∈ N, Euclid’s algorithm works as follows to determine (a, b). Without
loss of generality, suppose b < a, then we apply division algorithm to write a = q1 b+r1 with
0 ≤ r1 < b. If r1 6= 0, then we apply division algorithm to b and r1 to write b = q2 r1 + r2
with 0 ≤ r2 < r1 . We repeat this until we find a remainder which is zero. (This must
happen at some finite step, since b > r1 > r2 . . . ≥ 0. Thus, we have a system of equations:
a = q1 b + r1 , 0 < r1 < b
b = q2 r1 + r2 , 0 < r2 < r1
r1 = q3 r2 + r3 , 0 < r3 < r2
..
.
rn−3 = qn−1 rn−2 + rn−1 , 0 < rn−1 < rn−2
rn−2 = qn rn−1 + rn , 0 < rn < rn−1
rn−1 = qn rn + 0.
4
YANKI LEKILI
We apply the above lemma repeatedly to deduce
(a, b) = (b, r1 ) = (r1 , r2 ) = . . . = (rn−2 , rn−1 ) = (rn−1 , rn ) = (rn , 0) = rn
Thus, we proved:
Theorem 8. The last non-zero remainder rn of Euclid’s algorithm is the greatest common
divisor of a and b.
Here is an example. Let us compute (187, 35). We have
187 = 5.35 + 12
35 = 2.12 + 11
12 = 1.11 + 1
11 = 11.1
Thus, we see that (187, 35) = 1. Thus, we should be able to find integers x0 and y0 such
that
187x0 + 35y0 = 1
Euclid’s algorithm also gives a way to do this. Namely, we have
1 = 12 − 1.11
1 = 12 − 1.(35 − 2.12)
1 = 187 − 5.35 − 1.(35 − 2.(187 − 5.35)) = 3.187 − 16.35
Indeed, one can use Euclid’s algorithm to give another proof of Theorem 6.
We will now return back to factorisations of natural numbers into primes. We start with
the following:
Theorem 9. (Euclid’s first theorem) Let p be a prime number and let a1 , a2 ∈ N. If
p | a1 a2 then p | a1 or p | a2 . More generally, if a prime p divides a product a1 a2 . . . an ,
then p divides ai for some i.
Proof. The case of a product with n factors follows easily from the case with two factors.
Suppose p is a primes and p | a1 a2 . If p - a1 then (a1 , p) = 1 and therefore, by Theorem
6, there are an x0 and a y0 for which
x0 a1 + y0 p = 1
Multiplying this by a2 gives
x0 a1 a2 + y0 pa2 = a2
Now, p | x0 a1 a2 and p | y0 pa2 , hence p | a2 .
Let’s use this to prove a theorem due to Pythagoras.
√
Theorem 10. 2 is irrational.
PRIME NUMBERS
5
√
√
Proof. If 2 is rational, we can write it as 2 = ab for integers a, b such that (a, b) = 1.
Then, a and b satisfy the equation:
a2 = 2b2
Hence, b | a2 . Therefore, p | a2 for any prime factor p of b. It follows from Theorem 9 that
p | a. But, this is contrary to the assumption that (a, b) = 1. Hence b = 1, and this also is
clearly false.
We now come to one of the main tools of elementary number theory:
Theorem 11. (Fundamental theorem of arithmetic) Every positive integer a > 1 has
a factorisation into prime factors as a = pe11 pe22 . . . pess , and apart from rearrangement of
factors, this factorisation is unique.
Proof. We have already seen the existence of a factorisation in Theorem 3. Now, we show
uniqueness.
Suppose that a = p1 . . . pk = q1 . . . qj are two prime factorisations of a. Then, by
Theorem 9, p1 |qi1 for some i1 . Since qi1 is a prime, this implies that p1 = qi1 . We can then
divide out p1 and qi1 from both sides to get two prime factorisations of a/p1 = p2 . . . pk =
q1 . . . qi1 −1 qi1 +1 . . . qj . We can then match p2 with qi2 for some i2 by the same argument.
Continuing this way, we get that for all s, ps = qis for some is . After cancelling out all of
p1 , p2 , . . . pk , the remaining product must equal 1. Hence, there are no remaining factors
on the right hand side either. Hence k = j and the matching p1 = qi1 , p2 = qi2 , . . . pk = qik
shows that the two factorisations differ by only a rearrangement of factors.
It is now clear why 1 should not be counted as a prime. If it were, then Theorem 11
would be false, since we could insert any number of unit factors.
If we know the prime factorisation of positive integer a then we can immediately write
down all positive divisors: if a = pe11 pe22 . . . pekk then b|a if and only if b has a prime factorisation of the form b = pf11 pf22 . . . pfkk with 0 ≤ fi ≤ ei for all i. This observation gives the
following lemma:
Lemma 12. If m, n ∈ N are coprime then every natural number d with d | mn can be
written uniquely as d = d1 d2 where d1 , d2 ∈ N and d1 | m and d2 | n.
Proof. Since m and n are coprime, they don’t have any prime factors in common. So,
kr+1
kr+s
m = pk11 . . . pkr r and n = pr+1
. . . pr+s
where all the pi are distinct. If d | mn then
lr+1
lr+s
lr+s
l1
d = p1 . . . pr+s with 0 ≤ li ≤ ki for 1 ≤ i ≤ r + s. Let d1 = pl11 . . . plrr and d2 = pr+1
. . . pr+s
.
Then, obviously d = d1 d2 , d1 | m and dr | n.
l0
l0
Conversely, if d = d01 d02 , d01 | m and d02 | n then we must have d01 = p11 . . . prr and
0
0
lr+1
lr+s
d02 = pr+1
. . . pr+s
. From d = d01 d02 it follows that li = li0 for 1 ≤ i ≤ r + s and therefore
0
d1 = d1 and d2 = d02 . This shows uniqueness.
We will also need the following lemma.
Lemma 13. If p1 , p2 . . . pr be distinct prime numbers and let n be any integer. If pi | n for
all i then p1 p2 . . . pr | n.
6
YANKI LEKILI
Proof. For every r ≥ 1, we must show the following statement: If p1 , p2 . . . , pr are distinct
primes, n is any integer and pi | n for i = 1, 2, . . . , r, then p1 p2 . . . pr | n. To do this, we
use induction on r. The case r = 1 is obviously true. Now assume r ≥ 2 and that we have
shown the statement for r − 1. Let p1 . . . , pr be distinct primes and n an integer such that
pi | n for all i. By induction hypothesis, we get that p1 p2 . . . pr−1 | n. So, we can write
n = p1 p2 . . . pr−1 m for some m ∈ Z. Now, since pr | n and pr - pi for 1 ≤ i ≤ r − 1, it
follows, by Theorem 9, that pr | m. Hence, it follows that p1 p2 . . . pr | p1 p2 . . . pr−1 m = n
as desired.
Exercise: Give an alternative proof of Lemma 13 using FTA.
Finally, let us discuss factorials and their prime factorisations. Recall that given a
natural number N , we have the notation:
N ! :=
N
Y
i = 1.2 . . . (N − 1).N
i=1
This number is equal to the number of permutations of a set of N elements.
Let us observe that if p | N !, then p must divide one of the numbers 1, 2, . . . , N and
therefore p ≤ N . On the other hand, every prime number p ≤ N is a prime factor of N !.
So, to find a prime factorisation of N !, we need to determine the exponent of each prime
p ≤ N which divides N !. Let us write this first as:
Y
N! =
pep
p≤N
where the product is over all p ≤ N and ep are non-negative integers.
To state the next result, we find convenient to introduce the following notation:
Definition 14. For any real number x ∈ R, one signifies by [x] the largest integer ≤ x,
that is, the unique integer such that x − 1 < [x] ≤ x. This function is called the integral
part of x.
Q
P
N
Lemma 15. N ! = p≤N pep where ep = ∞
m=1 [ pm ]
P
N
m
Note that the sum ∞
m=1 [ pm ] has only finitely many non-zero terms because if p > N ,
then [ pNm ] = 0.
Proof. Consider a prime number p ≤ N . We must count how often p appears in the
product N ! = 1.2. · · · .N . Clearly, [ Np ] of the factors 1, 2, . . . , N are multiples of p; [ pN2 ]
factors are multiples of p2 etc. Hence, in ep = [ Np ] + [ pN2 ] + . . . we have counted once the
number of factors which are divisible by p but not p2 (as part of [ Np ]), we have counted
twice the number of factors which are divisible by p2 but not p3 (as part of [ Np ] + [ pN2 ]) etc.
This completes the proof.
PRIME NUMBERS
7
Note that it follows easily from above that
ep ≤ [
N
]
p−1
P
P∞ N
N
1
1
N
for the sum ∞
m=1 [ pm ] <
m=1 pm = N ( p + p2 + . . .) = p−1 .
As an example, let us find the largest integer k such that 7k | 50!. We can compute this
as:
50
50
k = [ ] + [ 2 ] = 7 + 1 = 8.
7
7
1.1. Computational problems.
√
Lemma 16. A positive integer n is composite if and only if n has a prime divisor p ≤ n
Proof. If n is composite then n = ab with 1 < a < n and 1 < b < n. We can assume
√ that
a
≤
b.
Let
p
be
a
prime
factor
of
a.
Then
p
is
also
a
prime
factor
of
n
and
p
≤
a
=
a.a ≤
√
√
a.b = n.
A primality test is an algorithm that determines whether an integer n > 1 is √
a prime
or composite. The above lemma gives the following test. For every prime√p ≤ n test
whether n is divisible by p or not. We know that if p|n for some p ≤ n then n is
composite, otherwise n is prime.
The sieve of Eratosthenes is the method of computing list of primes up to a number n
by using this algorithm. Write down all the integers n and cross out multiples of 2, then
√
cross out multiples of 3 and continue until we cross out multiples of all primes p ≤ n.
Then the remaining numbers are prime.
This method is useful for small numbers but, of course, it is clear that it is not very
efficient for large numbers. In 2002, Agrawal, Kayal and Saxena developed the first polynomial time primality test (known as the AKS primality test). Polynomial time means that
there exists constants C, k such that for every integer n > 1 the algorithm needs at most
C.(log n)k many steps to decide whether n is prime or not. Note that AKS test determines
whether n is prime or not without finding a prime factor.
2. Basic distribution results
Recall that fundamental theorem arithmetic leads us to think that prime numbers are
“building blocks” of all numbers.
We begin with the famous result of Euclid that says that there are infinitely many primes:
Theorem 17. (Euclid’s second theorem) The number of primes is infinite.
We will give two proofs of this result. Here is Euclid’s own proof:
Proof. Let 2, 3, 5, . . . , p be the list of primes up to p, and let
q = 2.3.5 . . . p + 1
Then q is not divisible by any of the numbers 2, 3, 5, . . . , p. It is therefore either prime, or
divisible by a prime between p and q. In either case, there is a prime greater than p, which
proves the theorem.
8
YANKI LEKILI
To study the distribution of prime numbers among all natural numbers, we give the
following definition:
Definition 18. For a real number x ∈ R, we let
π(x) = “the number of primes that are not greater than x”
For example, π(7) = 4, π(10) = 4, π(π) = 2, π(1) = 0.
Note that if we know the function π then we also know all the prime numbers: an integer
n is prime if and only if π(n) > π(n − 1).
Obviously, π(x) ≤ x for all x ≥ 0. Euclid’s second theorem implies that π(x) → ∞ as
x → ∞. Can we show that π(x) is given by a formula in terms of more familiar functions?
Let us try to deduce a bit more from Euclid’s argument. Let pn denote the nth prime.
So p1 = 2, p2 = 3, . . . etc.. Let us define
q = p1 .p2 .p3 . . . pn + 1
Then, since pi < pn for i = 1, . . . , n − 1, we deduce that
q < pnn + 1
for n > 1, and so that
pn+1 < pnn + 1
as either q = pn+1 or there is a prime bigger than p1 , . . . , pn that divides q.
n
In fact, we can do a bit better. Suppose that pn < 22 for n = 1, 2, . . . N , then Euclid’s
argument shows that
N
N +1
pN +1 ≤ p1 p2 . . . pN + 1 < 22+4+...2 + 1 < 22
Since, p1 = 2 < 22 = 4, by induction we conclude that
n
pn < 22 , for all n.
n
Therefore, we have that π(22 ) ≥ n. Now, given any positive real number x, we can
sandwich it as
n−1
n
ee
< x ≤ ee , for some n
m
since the series ee for m = 1, 2, . . ., is monotonically increasing. In other words, we have:
n − 1 < log log x ≤ n
n−1
Let us suppose n ≥ 3, so that en−1 > 2n and so ee
π(x) ≥ π(ee
n−1
n
> 22 , then we see
n
) ≥ π(22 ) ≥ n ≥ log log x
n−1
Note that the only place where we used the assumption n ≥ 3 was in deducing π(ee ) ≥
n. This can easily be checked directly for n = 1 and n = 2 as well. Hence, we proved that
π(x) ≥ log log x for all x > e. We also note that log log x ≤ 0 for 1 < x ≤ e, hence we get
that:
Theorem 19. π(x) ≥ log log x, for x > 1.
PRIME NUMBERS
9
However, log log x is a rather weak bound. For example, for x = 109 , it gives π(x) ≥ 3,
whereas the value of π(x) is over 50 million.
Figure 1 shows the graph of π(x) for 0 ≤ x ≤ 100.
Figure 1. Graph of π(x) for 0 ≤ x ≤ 100
To draw this for yourselves, go to Mathematica and type ”Plot[PrimePi[x],{x,0,100}]”.
Around 1800, several mathematicians conjectured approximations for π(x) as x → ∞.
Legendre suggested in 1798 that π(x) is approximately equal to the function logx x . Figure
2 shows how π(x) and logx x compares for x ≤ 400.
It is close but does not quite match. Of course, we are able to see this much easily
today with the help of computers. A better approximation to π(x) is provided by the
“logarithmic integral”, defined by:
Z x
dt
Li(x) :=
2 log t
Here is the Mathematica code for playing with these functions:
p1 = P lot[P rimeP i[x], {x, 2, 100000}, ImageSize → Large]
p2 = P lot[x/Log[x], {x, 2, 100000}, P lotStyle → {Green}, ImageSize → Large]
p3 = P lot[LogIntegral[x], {x, 2, 100000}, P lotStyle → {Red}, ImageSize → Large]
Show[p1, p2, p3]
We will return to this interesting subject of asymptotic approximation of π(x) later in
the next section.
10
YANKI LEKILI
Figure 2. Graph of π(x) vs. x/ log x for 2 ≤ x ≤ 400
Let’s discuss a second proof of Euclid’s theorem. The proof uses a special sequence of
rather fast growing numbers called Fermat’s numbers. They are defined by:
n
Fn = 22 + 1
so that
F1 = 5, F2 = 17, F3 = 257, F4 = 65537.
It can be checked easily that F1 , F2 , F3 , F4 are prime numbers. Fermat conjectured that
all Fn are primes but in fact this was disproved by Euler in 1732 when he showed that
5
F5 = 22 + 1 = 4294967297 = 641 × 6700417
An easy proof was given by Coxeter. Indeed,
641 = 54 + 24 = 5.27 + 1
hence divides each of 54 .228 + 232 = 228 (54 + 24 ) and 54 .228 − 1 (since x4 − 1 = (x + 1)(x −
1)(x2 + 1)). So, it divides their difference.
In fact, there is no known prime number of the form Fn for n > 4. People are still
searching for them (why?). Here is a website for it: http://www.fermatsearch.org/
However, we have a more theoretical use of Fermat numbers in mind. Namely, let us
prove the following:
Theorem 20. (Goldbach) No two Fermat numbers have a common divisor greater than 1.
PRIME NUMBERS
11
Proof. Suppose that Fn and Fn+k where k > 0 are two Fermat numbers and that m | Fn
n
and m | Fn+k . Letting x = 22 we can write:
n+k
k
Fn+k − 2
22 − 1
x2 − 1
k
k
k
= 2n
=
= x2 −1 − x2 −2 + x2 −3 . . . − 1
Fn
2 +1
x+1
So, we see that Fn | Fn+k − 2, but now since m | Fn+k and m | Fn+k − 2, we deduce that
m | 2. So m = 1 or 2 but it can’t be 2 since all the Fermat numbers are odd. Hence, the
theorem follows.
Corollary 21. There are infinitely many primes.
Proof. Each Fi is either prime or have an odd prime divisor which does not divide any
other. So, there are at least as many primes as there are Fermat numbers. There are
infinitely many Fermat numbers by definition.
n
This proof also gives pn+1 ≤ Fn = 22 + 1, which is slightly better than what we have
seen before (but not much).
Can one find a simple function f : N → N such that for each natural number n, f (n)
is a prime number? Clearly, Fermat’s sequence could not do this job. There is no known
satisfactory answer to this. Of course, one could define f (n) = pn , the nth prime number
but this is by no means a “simple” function.
There is a remarkable polynomial function given by
f (n) = n2 − n + 41
It turns out this polynomial takes prime values for all n with 0 ≤ n ≤ 40, but obviously
f (41) is composite, since 41 | f (41).
The following theorem says that polynomial functions with integer coefficients are no
good for answering the above question.
Theorem 22. No polynomial f (n) with integral coefficients, not a constant, can be a prime
for all n, or for all sufficiently large n.
Proof. Consider a polynomial given by
f (x) = a0 xk + a1 xk−1 + . . . ak
We may assume that the leading coefficient a0 > 0 so that f (n) → ∞ as n → ∞ since
otherwise f (x) will become negative when x is big. Thus, f (x) > 1 for all x sufficiently
large, so say f (x) > 1 for all x > N . Let x0 > N be such a number, and let us take
y = f (x0 ) > 1.
Then, for all integers r ∈ Z, we see that
f (ry + x0 ) = a0 (ry + x0 )k + . . .
is divisible y by the binomial expansion theorem. Now, f (ry + x0 ) → ∞ as r → ∞. Hence,
there are infinitely many composite values of f (n).
12
YANKI LEKILI
What about simple functions f : N → N such that f (n) is prime for infinitely many n?
If f (n) is of the form
f (n) = an + b for some a, b with a > 0 and (a, b) = 1
then there is a nice answer to this.
Let’s first practice in a few examples.
Theorem 23. There are infinitely many primes of the from 4n + 3.
Proof. Let p1 , . . . , pn be the first n primes, then consider:
q = 22 .3.5. . . . pn − 1
Then q is of the form 4n + 3, and is not divisible by any of the primes p1 , . . . , pn , hence it
should have prime divisors p > pn . Furthermore, it cannot be that all the prime divisors
of q are of the form 4n + 1 since the product of such numbers is of the same form, hence
there must be at least one prime divisor of q of the form 4n + 3 and greater than pn . By
letting n → ∞, we can construct infinitely many primes of this form.
Here is a similar result:
Theorem 24. There are infinitely many primes of the from 6n + 5.
Proof. The proof is similar. We define q by
q = 2.3.5 . . . .pn − 1
and observe that any prime number, except 2 or 3 is of the form 6n + 1 or 6n + 5 (why?),
and the product of two numbers of the form 6n + 1 is again of the same form.
All these theorems are particular cases of a famous theorem of Dirichlet:
Theorem 25. (Dirichlet 1837) If a > 0 and b are integers such that (a, b) = 1, then there
are infinitely many primes of the form an + b.
The proof of this theorem uses analytical methods too difficult to discuss here. We shall
not cover its proof in this course.
That deals with the linear functions. What about quadratic polynomials? The question
becomes much harder and we don’t even know whether the following conjecture is true or
not.
Conjecture 26. There are infinitely many primes of the form n2 + 1.
3. Chebyshev’s theorem
We now return back to our study of the prime distribution function π(x).
We will give a proof of a theorem due to Chebyshev (also spelled Tchebychef):
Theorem 27. There exists constants c1 , c2 > 0 such that
x
x
c1
< π(x) < c2
log x
log x
PRIME NUMBERS
13
The closer the constants cj are to 1, the more technical the proof becomes. Here we will
show that c1 = log2 2 and c2 = 6 log(2).
The proof will use the following elementary facts:
2n
≤ 22n
(1) 22n ≤ 2n
n
(2) 2n
is not divisible by any p > 2n.
n
2n
(3) n is divisible by all primes n < p ≤ 2n.
P
2n
The first one follows from (1 + 1)2n = 2n
m=0 m , the second and third follows from our
formula for the prime factorizations of factorials (2n)! and n!.
Proof. (Proof of Chebyshev’s theorem)
Upper bound : Any p with n < p ≤ 2n divides
Y
p
2n
n
so by Lemma 13, the product
2n
≤ 22n
n
n<p≤2n
divides 2n
. Therefore, we have
n
π(2n)−π(n)
n
≤
Y
p≤
n<p≤2n
Taking the log gives
π(2n) − π(n) ≤ 2 log(2)
n
log n
Using induction, we now easily see that
2k
k
In fact, this is checked directly for k ≤ 5; k > 5, we argue by induction:
π(2k ) ≤ 3 ·
2k+1
3.2k 2.2k
5.2k
3.2k+1
≤
+
≤
≤
k
k
k
k
k+1
x
Next, since the function f (x) = log x is monotonically increasing for x ≥ e, we have that
if 4 ≤ 2k < x ≤ 2k+1 , then
π(2k+1 ) ≤ π(2k ) +
2k
2k
x
≤ 6 log 2
≤ 6 log 2
k
k+1
log 2
log x
for x ≤ 4 as well, we have now established the claimed upper
π(x) ≤ π(2k+1 ) ≤ 6.
Since π(x) ≤ 6 log 2 logx x
bound for all x.
Lower bound
Put N = 2n
, let vp (N ) denote the highest power of p that divides N . By the formula
n
from Lemma 15, we now that
X 2n n
vp (N ) =
−
2
pm
pm
m≥1
Now, we use the following lemma:
14
YANKI LEKILI
Lemma 28. For all x ∈ R, we have [2x] − 2[x] ∈ {0, 1}.
Proof. Let us write x = [x] + {x} where {x} is called the fractional part of x. Now, if
{x} < 1/2, then 2x = [2x] + {2x}, hence [2x] − 2[x] = 0. Otherwise, if {x} ≥ 1/2, then we
get [2x] − 2[x] = 1.
h i
h i
2n
n
2n
If pm > 2n or equivalently m > log
−
2
= 0. Thus, we
,
then
we
have
that
log p
pm
pm
find that
log 2n
vp (N ) ≤
log p
Now,
2n
22n
2n
2n log 2 − log 2n ≤ log
, because
≤
n
n
2n
X
Y
2n
log 2n
log 2n
vp (N )
log
≤
log p, because N =
p
, and vp (N ) ≤
n
log p
log p
p≤2n
p≤2n
X log 2n p≤2n
log p
log p ≤
X
log 2n = π(2n) log 2n
p≤2n
This yields the lower bound
π(2n) ≥ log 2
2n
−1
log 2n
We claim that this implies that
π(x) ≥
log 2 x
, for all x ≥ 2
2 log x
This inequality can be checked directly for x ≤ 16, hence it suffices to prove it for x > 16.
Pick an integer n with 16 ≤ 2n < x ≤ 2n + 2. Then,
2n
n+1
n−1
7
1
−
=
≥
>
log 2n log 2n
log 2n
4 log 2
log 2
hence,
π(x) ≥ π(2n) ≥ log 2
2n
(n + 1) log 2
(n + 1) log 2
log 2 x
−1≥
≥
≥
log 2n
log(2n)
log(2n + 2)
2 log x
as required.
We will next prove Bertrand’s postulate. It was conjectured by Bertrand in 1845 and
proved by Chebyshev in 1850.
Theorem 29. For every integer n ≥ 1, there is a prime p satisfying n < p ≤ 2n.
PRIME NUMBERS
15
Chebyshev introduced an auxiliary function, the θ-function. It is defined by
X
θ(x) =
log p
p≤x
for real numbers x (summation over all prime numbers p ≤ x). For example,
θ(10) = log 2 + log 3 + log 5 + log 7
Chebyshev proved upper and lower estimates for the function θ, and then deduced upper
and lower estimates for the function π. We have the following upper estimate for θ.
Lemma 30. If x > 0, then θ(x) < log(4) · x.
Proof. The statement is clearly true for 0 < x < 1, so we can assume that x ≥ 1. Since
θ(x) = θ([x]), it is enough to prove the statement θ(n) < log(4) · n for n ∈ N.
For this, we use induction on n. The cases n = 1 and n = 2 are obviously true. Now,
assume that n ≥ 3 and that θ(m) < log(4) · m for m < n. We must distinguish the cases
n even and n odd.
If n is even then θ(n) = θ(n − 1) < log(4) · (n − 1) < log(4) · n, as required.
If n is odd, let n = 2m + 1 for m ≥ 1. We will show below that θ(2m + 1) − θ(m + 1) <
log(4) · m. It then follows that
θ(n) = θ(2m+1)−θ(m+1)+θ(m+1) < log(4)·m+log(4)·(m+1) = log(4)(2m+1) = log(4)·n
as required.
So, it remains to show
θ(2m + 1) − θ(m) < log(4) · m for every m ≥ 1.
that
(2m+1)2m···(m+2)
2m+1
Consider M = m =
. If p is a prime number with m+2 ≤ p ≤ 2m+1,
m!
then p divides M (because p divides the numerator but not the denominator). Hence, by
Lemma 13, the product
Y
p
m+2≤p≤2m+1
divides M , in particular, is less than or equal to M .
On the other hand, M < 22m because
2m + 1
2m + 1
2M =
+
< (1 + 1)2m+1
m
m+1
It follows that
!
θ(2m+1)−θ(m+1) =
X
m+2≤p≤2m+1
log p = log
Y
p
≤ log M < log 22m = m·log 4
m+2≤p≤2m+1
Proof. (Proof
of Bertrand’s postulate) Recall first that any prime number p that divides
N = 2n
has
to
satisfy p ≤ 2n and if there is any prime n < p ≤ 2n then it divides N .
n
16
YANKI LEKILI
Next, let us observe that for n ≥ 3 if 23 n < p ≤ n, then p does not divide N = 2n
.
n
2n
2
Indeed, 2n < 3p ≤ p , hence 2 ≤ p < 3. Thus,
2n
n
vp (N ) =
−2
=2−2=0
p
p
Now, we prove Bertrand’s postulate by contradiction. Suppose that there is an integer
n and there is no prime in the interval (n, 2n]. By the discussion above, this implies that
there is no prime p > 23 n that divides N .
Next, consider primes
p | N , such that vp (N ) > 1. They satisfy p2 ≤ pvp (N ) ≤ 2n, hence
√
we must have p ≤ 2n for such primes. The number of such primes is clearly bounded by
√
2n. Now, we have
√
Y
Y
Y
2n
22n
≤
≤
pvp (N ) ·
p ≤ (2n) 2n ·
p
n
2n
vp (N )>1
vp (N )=1
vp (N )=1
Taking logs, we get:
2n(log(2))−log(2n) ≤
√
2n log(2n)+log(
Y
)p ≤
vp (N )=1
√
√
2n
2n
2n log(2n)+θ( ) ≤ 2n log(2n)+log(4)( )
3
3
Reorganizing, we get
√
2n log(2) ≤ 3(1 + 2n) log(2n)
Now, since logx x is monotonically increasing for x > 3, this inequality cannot hold
for large n. In fact, it is false for n ≥ 512 and we arrive at a contradiction if n ≥
512. For n < 512, Bertrand’s postulate is proved by looking at the sequence of primes
7, 13, 23, 43, 83, 163, 317, 631.
Corollary 31. Let pn denote the n-th prime number. Then pn ≤ 2n .
Proof. By Bertrand’s postulate we know that each of the intervals (1, 2], (2, 4], (4, 8], etc.
contains at least one prime number. Hence the interval (1, 2n ] contains at least n prime
numbers. Thus the n-th prime number must be contained in this interval, i.e. pn ≤ 2n .