Elementary and combinatorial
methods for counting prime numbers
By Pascal Stumpf
1. Introduction
Our natural numbers, united in the set {1, 2, 3, . . . } = N, have become so
close to us over time, secretly being used for counting almost every day (as in
this paper, by enumerating its pages and chapters), that they form one of the
most friendly and well founded invitations to mathematics, and after all they
still provide so many beautiful open problems, even within their very familiar
operations of addition (+) and multiplication (·) . . .
A tricky question
For a (finite) subset A of N with card(A) = n elements, how small or
large can its sumset A + A = {a 1 + a 2 : a 1 , a 2 ∈ A} and its productset
A · A = {a 1 · a 2 : a 1 , a 2 ∈ A} be (simultaneously) in comparison to n?
Before we try to answer some parts of this question, note that in general
for ∗ ∈ {+, ·} the cardinality of our pairwise built set A ∗ A varies between n
and n2 . In particular, the more comparable it is with n = card(A), the more
closed, and therefore structured, we can see A under ∗ (like in group theory).
If we now simply choose A = {1, 2, . . . , n} as an arithmetic progression, then
its sumset A + A = {2, 3, . . . , 2n} contains 2n − 1 elements being linear in n,
and A has a nice additive structure. Similarly, if we choose A as a geometric
progression, like {21 , 22 , . . . , 2n }, then its productset A · A = {22 , 23 , . . . , 22n }
also only has 2n − 1 elements, where our additive structure from before lives
on in the exponents and transforms itself into the multiplicative structure for
A here. But how much additively and multiplicatively structured can A be at
the same time? Surprisingly, it seems that A + A and A · A can not both be
too small, and in fact there exists a small but positive ε such that
n
o
max card(A + A), card(A · A) > c · n1 + ε
for a constant c > 0 (and independent of n), due to Erdős and Szemerédi [1],
who moreover even conjecture, that for every δ > 0, at least one of both sets
has cardinality of at least n2 − δ , whenever n is sufficiently large.
1
2
ELEMENTARY METHODS FOR COUNTING PRIME NUMBERS
While their conjecture is remaining wide open for more than thirty years
now, round about 8 years ago Solymosi [2] could improve on their result and
show that ε can be taken arbitrarily close to 1/3. If we dive a bit deeper into
his extremely pretty geometrical proof, we discover it is just a factor of order
1/ log(n)1/3 keeping us away from n4/3 , and this is also the only place, where
we technically need to leave our rational numbers for being able to introduce
our natural logarithm, by using the concept of limits inside the real numbers
at some stage, what arguably is the hugest step along all our number ranges.
Fortunately, in the work of Solymosi this can be went around in a completely
elementary fashion, because he only needs the size of a logarithm and none of
its other properties. However, in particular when our prime numbers appear,
there are a lot of other cases, like an elementary proof of Dirichlet’s theorem
about prime numbers in arithmetic progressions by Selberg [3], or the (pure)
combinatorial sieve method of Brun [4], according to Erdős, one of the most
important tools in elementary number theory, where they become crucial.
In this paper, after revisiting a couple of cute facts about prime numbers
with sometimes a bit more combinatorial proofs than usual, we will develop a
framework for our natural logarithm featuring all its key properties, but in a
way that we are able to stay inside our rational numbers which formally can
be defined by a system of equivalence classes over the set of all ordered pairs
of integers and natural numbers. Together with our previous results, we then
obtain some classical formulas for counting prime numbers twisted in certain
ways, including those Selberg is using in his work, and finally we sketch some
future work for a proof of Brun’s earlier result, that the sum of the reciprocals
of the first prime twins is bounded (by a constant), no matter how far we go.
Overall, perhaps in this at any point finitary approach, the fascinating world
of elementary prime number theory might become even a bit more accessible,
especially for anyone, who (like me, a few years ago) is missing some concepts
from calculus, but would love to understand more about our prime numbers,
which in turn will also help us see, why the productset of A = {1, 2, . . . , n},
or in other words the n by n multiplication table we learn at school, actually
does contain almost n2 pairwise distinct members, as expected.
2. Prime numbers and their friends
Although, every natural number n > 1 can be written as a sum of smaller
ones in more and more ways, as n is increasing, if we dream about the same
multiplicatively, there suddenly pop up numbers n that can not be written as
a product of smaller natural numbers, and any such n, only being a multiple
of 1 and itself, is called prime (otherwise, we say n is composite). At a first
glance our prime numbers 2, 3, 5, 7, 11, 13 (and more) look quite random, but
in fact they form multiplicative building blocks for our natural numbers.
ELEMENTARY METHODS FOR COUNTING PRIME NUMBERS
3
Lemma 2.1.
Every natural number n > 1 is a product of prime numbers.
Proof: We start at n = 2, being a prime number itself already. Now, let us
suppose for some n > 2 we know each smaller natural number (other than 1)
is a product of prime numbers. Once again if n is a prime number itself, all is
fine, and otherwise we are able to write n = a · b where 2 6 a, b < n, so here,
the ensured products of prime numbers for a and b multiplied together could
also build one for our n, and our claim follows by induction.
Keeping the important question, in how many different ways we might be
able to factor a natural number into prime numbers, on hold for a moment,
our current knowledge, that there exists (at least) one prime factorization, is
already enough to gain more feeling about the order of magnitude how many
prime numbers there are, by using a wonderful indirect argument going way
back to Euclid, where out of any finite set of prime numbers we will be able
to construct a new large number, also storing a new prime factor for us.
Corollary 2.2.
There are infinitely many prime numbers.
Proof: Assume there would be only finitely many prime numbers, we now
can enumerate by p 1 = 2, p 2 = 3, . . . , p r for some r ∈ N. On one hand, their
product p 1 · p 2 · . . . · p r looses each of them as a factor, if we add 1, because
otherwise also 1 would need to be a multiple of such prime factors. However,
our last Lemma whispers p 1 · p 2 · . . . · p r + 1 > 1 still is a product of prime
numbers, and thus everyone of those would give us a new prime number, not
being among our old ones, a contradiction to any maximal choice of r.
Back to our question about the number of possible prime factorizations a
natural number might have, after checking a few examples, it seems that upto
reordering factors there only exists one. Most often this is proved by help of
Euclid’s Lemma, that if a prime number p divides a product a 1 · a 2 , then it is
also a divisor of a 1 or a 2 (or both), which again needs some other divisibility
arguments. Here we present an alternative and independent proof, combining
our both so far used proof principles of induction and by contradiction.
Theorem 2.3.
Every natural number n > 1 is a product of prime numbers,
even being unique upto the order of its factors.
4
ELEMENTARY METHODS FOR COUNTING PRIME NUMBERS
Proof: First, if n is a prime number, we can not factor it into any smaller
natural numbers at all, and so n itself already is its only prime factorization,
which in particular is the case for n = 2. Next, let us suppose that for some
composite n > 2 we know each smaller natural number (other than 1) factors
into prime numbers uniquely, but at the same time assume there would exist
two distinct (ordered) factorizations
n = p 1 · p 2 · . . . · p r and n = q 1 · q 2 · . . . · q s
(r, s > 2)
into prime numbers p 1 6 p 2 6 . . . 6 p r and q 1 6 q 2 6 . . . 6 q s for our n.
In this setup we are allowed to focus on p 1 < q 1 (or alternatively p 1 > q 1 ),
because if p 1 = q 1 , then p 2 · . . . · p r = q 2 · . . . · q s both would still also be two
distinct prime factorizations of n/p 1 = n/q 1 < n. Along the way we may now
introduce the natural number m = (q 1 − p 1 ) · q 2 · . . . · q s > 1 · 2 > 1, while
m = q1 · q2 · . . . · qs − p1 · q2 · . . . · qs
= n − p1 · q2 · . . . · qs = p1 · p2 · . . . · pr − p1 · q2 · . . . · qs
= p 1 · (p 2 · . . . · p r − q 2 · . . . · q s )
can tell p 1 does appear in (at least) one prime factorization of m, and m < n
ensures there only exists one, already given by (q 1 − p 1 ) · q 2 · . . . · q s , in parts.
Since p 1 is too small for being among any of the prime numbers q 2 , . . . , q s , all
remaining is q 1 − p 1 = d · p 1 for some d ∈ N, but then q 1 = (d + 1) · p 1 would
not be prime anymore, a contradiction to our assumption, and hence n must
have a unique prime factorization also, completing our induction step.
Being almost impossible to give enough credit for how many links between
our prime numbers with other areas (for example in analytic number theory,
whenever Euler products appear) are encoded by this truely unique property,
it really deserves to be called our fundamental theorem of arithmetic.
In particular, from the perspective of each single prime number p we are
now allowed to define e p (n) as its exponent in the unique prime factorization
of n > 1, and the representation
n
e p (n) = max r ∈ N ∪ {0} : pr | n
o
also induces e p (1) = 0, where a 1 | a 2 means a 1 is a divisor of a 2 . As a map, e p
slowly starts reminding us of logarithms more and more, because glueing the
prime factorizations of natural numbers a 1 and a 2 together by multiplication
is transported via adding up the exponents of corresponding prime factors, so
e p (a 1 · a 2 ) = e p (a 1 ) + e p (a 2 )
(or e p (a 1/a 2 ) = e p (a 1 ) − e p (a 2 ), given a 1/a 2 ∈ N), one of the key properties of
logarithms, transforming multiplication into addition. But unfortunately e p is
not monotone, jumping back to 0 after each multiple of p.
5
ELEMENTARY METHODS FOR COUNTING PRIME NUMBERS
On average however, we have the following very helpful approximation, for
which we quickly introduce 1 · 2 · . . . · n = n! as the factorial of n, and set
n
o
o p (n) = max r ∈ N ∪ {0} : pr 6 n ,
which mimics e p on all powers of p, not inheriting its multiplicative property
completely, but therefore being monotone this time.
Lemma 2.4.
For n > 1 and a prime number p, we have
n/p
X
− 1 6 e p (n!) =
[n/pr ] 6 n/p + n/p(p − 1) ,
1 6 r 6 o p (n)
where [x] stands for the largest integer not greater than x.
Proof: One tiny combinatorial idea is, after expanding
e p (n!) = e p (
Y
X
a) =
16a6n
X
e p (a) =
16a6n
16a6n
X
1 ,
1 6 r 6 e p (a)
instead of counting for every a the multiplicity of p in its prime factorization,
to change our point of view and count for each possible level r, being at most
e p (a) 6 o p (a) 6 o p (n), how many a do reach it, so reordering our sum as
X
1 6 r 6 o p (n)
X
1 6 a 6 n, e p (a) > r
card{1 6 a 6 n : pr | a} ,
X
1 =
1 6 r 6 o p (n)
and there are exactly [n/pr ] natural numbers upto n being a multiple of pr .
For both inequalities we now can use another little trick in number theory
of removing integer parts [·] by writing x − 1 < [x] 6 x, which holds true for
every (rational) x and (after truncating our summation at r = 1) immediately
presents us the lower bound e p (n!) > [n/p] > n/p − 1. On the other side, it also
lets us simplify towards our upper bound by
X
e p (n!) =
1 6 r 6 o p (n)
g n (x) · x =
16r6n
n/pr
6 n/p + n ·
1/xr − 1
P
16r6n
=
X
X
1/pr
,
26r6n
1 6 r 6 o p (n)
and in general, if we put g n (x) =
X
X
[n/pr ] 6
1/xr
for x > 1, then
1/xr
= 1 + g n (x) − 1/xn ,
06r6n−1
which means g n (x) · (x − 1) = 1 − 1/xn 6 1 or g n (x) 6 1/(x − 1), leading to
e p (n!) 6 n/p + n · (g n (p) − 1/p) 6 n/p + n · (1/(p − 1) − 1/p)
= n/p + n · p − (p − 1)/p(p − 1) = n/p + n/p(p − 1)
in our own case (x = p), as required.
6
ELEMENTARY METHODS FOR COUNTING PRIME NUMBERS
With this nice little tool ready to present us some information about each
prime factor of a factorial, while n! = 1 · 2 · . . . · n contains all prime numbers
upto n as factors cuddled next to many composite ones, from another point of
view it also counts all permutations of a set with n elements. Are there other
combinatorial structures whose members we can count, and their number also
contains our prime numbers upto n as factors, but perhaps being a bit closer
to the original product p(n) of prime numbers (upto n) itself?
In his very first paper (from 1932), Erdős found a beautiful connection to
our central binomial cofficient, given by
Ç
2n
n
å
= card {A ⊂ {1, 2, . . . , 2n} : card(A) = n} = · · · =
(2n)!
.
n! · n!
On one hand, simply due to its combinatorial definition of counting members
of a set, we already know 2n
n is a natural number (or possibly 0), and hence
on the other side (after dreaming through the points, noting, every subset A
corresponds to n! unique n tuples built from its elements) the fractional form
tells us, its denominator is a divisor of its numerator. This also holds true for
Ç
2n
n
å
=
(2n) · (2n − 1) · . . . · (n + 1)
,
n · (n − 1) · . . . · 1
after we cancel one n! from its denominator, and now all (small) prime factors
of the other n! can munch away themselves in the numerator, leaving some of
them and for sure all (large) prime numbers between n + 1 and 2n (occuring
only once as factor) left in the numerator. Before we translate this behaviour
into an upper bound for p(n), let us first collect some bounds on 2n
n .
Lemma 2.5.
For n > 5, we have the inequalities 4n /n 6
2n
n
6 4n /4.
Proof: First, note that indeed
5
4 /5 = 204.8 6
Ç
2·5
5
å
=
10 · 9 · 8 · 7 · 6
= 252 6 256 = 45 /4 ,
5·4·3·2·1
n
and now, if we are already given 4n /n 6 2n
n 6 4 /4 for some natural number
n > 5, then there is a bridge to our next central binomial coefficient across
Ç
2(n + 1)
n+1
> 2 ·
6 2 ·
å
2n + 1
n+1
2n + 1
n+1
·
·
Ç
(2n + 2)!
(2n + 2) · (2n + 1)
2n
=
=
·
(n + 1)! · (n + 1)!
(n + 1) · (n + 1)
n
4n
n
4n
4
=2·
62·
2n + 1
n
2n + 2
n+1
·
·
4n
4n
n + 1 /(n
n+1 > 2 · 2 · n+1 = 4
4n
4n
n + 1 /4 ,
4 =2·2· 4 =4
covering both of our induction steps at once.
å
+ 1) ,
ELEMENTARY METHODS FOR COUNTING PRIME NUMBERS
7
Proposition 2.6.
If n > 2, then p(n) 6 4n (for the product of all prime numbers upto n).
Proof: After having checked our inequality for small n upto 8 by foot via
p(2) 6 p(3) 6 p(4) = 2 · 3 6 42 < p(5) 6 p(6) 6 p(7) 6 p(8) = 2 · 3 · 5 · 7 6 45 ,
let us now suppose that for some n > 9 we know p(m) 6 4m for each m < n.
If n is composite, then still p(n) = p(n − 1) holds and we are already ensured
p(n − 1) 6 4n−1 6 4n . In the other case, when n is an odd prime number, we
may write n = 2m − 1 (m > 5) and split our product into
Y
p(n) = p(2m − 1) = p(m) ·
p,
m + 1 6 p 6 2m − 1
where its first part already fulfills p(m) 6 4m . Observing its last part divides
2m
(2m)!/(m!)2 being an integer, because each prime number p in the range
m =
m < p < 2m is a factor of (2m)! but not of (m!)2 (which can be seen through
our Lemma 2.4, too), we reach
Y
m + 1 6 p 6 2m − 1
p6
Ç
2m
m
å
6 4m − 1
supported by our Lemma 2.5, and both parts reunited back together give us
p(n) = p(2m − 1) 6 4m · 4m − 1 = 42m − 1 = 4n , closing our induction.
Although today, we are able to obtain sharper bounds, like p(n) 6 4n − 1 ,
+ 1
when analyzing the shifted binomial coefficient 2nn+ 1 = 2n
n + 1 carefully, we
decided to follow the young footsteps of Erdős here (on his way to Bertrand’s
postulate, that there is always a prime number between n and 2n).
Moreover, this will also be just fine working into the other direction, but
this time, instead of trying to bound p(n) from below, we relax a little, and
consider the least common multiple for all natural numbers upto n, which is
containing every prime number p 6 n in its highest power po p (n) 6 n. Again,
our following lower bound could be improved to ℓ(n) > 2n for all n > 7, due
to an amazing idea of Nair [5], who however is using integrals. Another cute
remark is, that this result also made a tiny appearance in the breakthrough
work of Agrawal, Kayal and Saxena [6] about Primes is in P, being able to
prove for the first time, there exists a non random algorithm, that determines
whether an input number is prime or composite in polynomial time.
Proposition 2.7.
If n > 2, then ℓ(n) > 2n /2, where ℓ(n) is the least common multiple for
all natural numbers upto n.
8
ELEMENTARY METHODS FOR COUNTING PRIME NUMBERS
Proof: After having checked our inequality for small n upto 9 by foot via
ℓ(2) = 2 > 21 , ℓ(3) = 2 · 3 > 22 , ℓ(4) = 22 · 3 > 23 , ℓ(6) > ℓ(5) = 22 · 3 · 5 > 25 ,
ℓ(9) > ℓ(8) > ℓ(7) = 22 · 3 · 5 · 7 > 28 , our next step will be to show that ℓ(2m)
m(2m)!/(m!)2 )
is a multiple of m 2m
m for m > 1, or equivalently e p (ℓ(2m)) > e p (
for every possible prime factor p. One way is with help of our Lemma 2.4 by
e p (m(2m)!/(m!)2 ) = e p (m) + e p ((2m)!) − 2 · e p (m!)
= e p (m) +
X
[2m/pr ] − 2 ·
1 6 r 6 o p (2m)
X
= e p (m) +
X
[m/pr ]
1 6 r 6 o p (m)
[2m/pr ] − 2 · [m/pr ]
1 6 r 6 o p (2m)
6 e p (m) +
X
1 6 r 6 e p (m)
0 +
X
1
e p (m) < r 6 o p (2m)
= e p (m) + (o p (2m) − e p (m)) · 1 = o p (2m) = e p (ℓ(2m)) ,
where 2 · [m/pr ] = 0 for r > o p (m), and (as an integer) any summand
[2m/pr ] − 2 · [m/pr ] 6 2m/pr − 2 · [m/pr ] < 2m/pr − 2 · (m/pr − 1) = 2
actually is at most 1, and moreover for 1 6 r 6 e p (m), i.e. as long as pr | m,
we even have [2m/pr ] − 2 · [m/pr ] = 2m/pr − 2 · m/pr = 0. In particular, now our
m
2m
Lemma 2.5 is able to deliver ℓ(2m + 1) > ℓ(2m) > m 2m
m > m · 4 /m = 2
for all m > 5, covering both possible parities of all remaining n > 10.
Reflecting on our last both achievements for a moment, we could establish
both upper and lower bounds for products containing all prime numbers upto
n as factors, while cuddled next to each other by their favourite operation of
multiplication. Hence all we need for our main aim, of counting them packed
P
into the sum p 6 n 1 = π(n), is a map being able to transform multiplication
into addition, just the task our natural logarithm is so good at performing.
3. An elementary framework for logarithms
Our dream is to find a map f : N → Q such that
(∗)
f (a 1 · a 2 ) = f (a 1 ) + f (a 2 )
for all a 1 , a 2 ∈ N, and perhaps also f (a 1 ) 6 f (a 2 ) whenever a 1 6 a 2 , ensuring
a more smoother handling in computations (for example partial summation).
If we now quickly peek into calculus for a second, a first idea coming to mind
might be approximating our natural logarithm with harmonic numbers by
1
1
log(n) ≈ 1 + + . . . + ,
2
n
which indeed slowly grow with n, but also cause some error terms in (∗).
ELEMENTARY METHODS FOR COUNTING PRIME NUMBERS
× a2 /1
9
× 1/a2
1
1
1
a1
a2
a1 · a2
1
× a2 /1
a1
a2
a1 · a2
a2
a1 · a2
a2
a1 · a2
× 1/a2
1
1
1
a1
a2
a1 · a2
1
× a2 /1
a1
× 1/a2
1
1
1
a1
a2
a1 · a2
1
a1
Figure 0 – Searching for a dream . . .
However, especially among many applications in number theory, (∗) seems
to be a bit more important, like in Selberg’s proof [3], where it guarantees us
the vanishing of a certain (sifting) function, sleeping at integers having three
or more prime factors, which turns out to be crucial for his next steps.
After this key point, let us restart and focus more on (∗). Playing around
with a 1 and a 2 , we always reach f (1) = 0 due to
f (1) = f (1 · 1) = f (1) + f (1) ,
e
e
and if n > 1, its unique prime factorization n = p 11 · . . . · p rr (e 1 , . . . , e r > 1)
boils down to
f (n) = f (
Y
16i6r
e
pi i ) =
X
e
f (p i i ) =
16i6r
X
e i · f (p i ) ,
16i6r
only depending on a choice of f on our prime numbers. Here, by introducing
for a 1 6 a 2 , as a generalization of harmonic numbers,
X
1
1
1
1
1
s(a 1 , a 2 ) =
+
+ ... +
+
=
,
a1 a1 + 1
a2 − 1 a2 a 6 a 6 a a
1
2
in the spirit of last page, we finally choose
f (p) = s(δ + 1, δ · p) = log(p)δ
on our prime numbers p, where δ ∈ N (large) will be like a fineness parameter
at our hands, and everything remains well defined, when we put
log(a 1 /a 2 )δ = log(a 1 )δ − log(a 2 )δ ,
which is expanding our δ-logarithm onto all positive rational numbers.
10
ELEMENTARY METHODS FOR COUNTING PRIME NUMBERS
Our task now will be to obtain some helpful approximation properties for
our δ-logarithm on natural numbers, including monotonicity upto any wished
level. But first let us make the following convention, such that we might keep
track of lower and upper bounds of a quantity at the same time more easily.
Notation
Starting from now, let O c denote a rational number such that |O c | 6 c,
where c > 0 and O c might change its value each time appearing.
Remark
In analogy with the usual O notation (by Landau), we must be careful
to read chains of equations involving O c ’s in only one direction and not
backwards, while sometimes reordering their terms is still possible.
Motivated by the global fine tuning inequality log(n)δ > log(n)δ , whenever
δ > δ, since we already locally have
log(p)δ + 1 = s((δ + 1) + 1, (δ + 1) · p)
= s(δ + 2, δ · p) + s(δ · p + 1, (δ + 1) · p)
> s(δ + 1, δ · p) − 1/(δ + 1) + p · 1/(δ + 1) · p = log(p)δ
at our prime numbers p, let us begin with a little technical calculation.
Lemma 3.1.
If a > 1 and b > 2, then
s(aδ + 1, aδ · b) = s(δ + 1, δ · b) + |O 1 |(1/δ) .
Proof: As lower and upper bounds in general, observe that
1
1
1 > (a 2 − a 1 + 1) · 1/a 2 ,
1
+
+ ... +
+
s(a 1 , a 2 ) =
a1 a1 + 1
a 2 − 1 a 2 6 (a 2 − a 1 + 1) · 1/a 1 ,
where we replaced each of the a 2 − a 1 + 1 summands by the last or first one,
being the smallest or largest one of all, respectively. After partitioning
s(aδ + 1, aδ · b) =
X
s(a(n − 1) + 1, an)
δ+16n6δ·b
into shorter sums of length an − (a(n − 1) + 1) + 1 = a each, we thus get
> a · 1/an = a/an = 1/n ,
s(a(n − 1) + 1, an)
6 a · 1/a(n − 1) + 1 < a/a(n − 1) = 1/(n − 1) ,
ELEMENTARY METHODS FOR COUNTING PRIME NUMBERS
11
or added up back together
X
s(aδ + 1, aδ · b) >
1/n
= s(δ + 1, δ · b)
δ+16n6δ·b
and
s(aδ + 1, aδ · b) 6
X
1/(n − 1)
δ +16n6δ·b
1/n
δ6n6δ·p−1
X
< 1/δ +
X
=
1/n
= s(δ + 1, δ · b) + 1/δ
δ+16n6δ·b
as desired, when seeing both inequalities at once.
Now, almost everything is ready in order to reach two nice bounds for our
δ-logarithm itself, and monotonicity upto any level. But as a last preparation,
note that the number of prime factors of n > 1 (counted with multiplicity) is
at most o 2 (n), because 2 is our smallest prime number, while moreover
s(1, n) > s(1, 2o 2 (n) ) =
s(2r + 1, 2r + 1 )
X
0 6 r < o 2 (n)
>
X
(2r + 1 − (2r + 1) + 1) · 1/2r + 1
X
2r · 1/2r + 1 =
0 6 r < o 2 (n)
=
0 6 r < o 2 (n)
X
1/2
= o 2 (n) · 1/2 ,
0 6 r < o 2 (n)
so in turn o 2 (n) 6 2s(1, n) after swapping. These bounds will be quite useful
to keep our fineness parameter δ as small as possible.
Theorem 3.2.
For n > 2 and δ > o 2 (n), and so in particular for δ > 2s(1, n), we have
log(n)δ = s(2, n) + O 1 (1) ,
and if also δ > n3 , then
log(n + 1)δ − log(n)δ = 1/n + O 2 (1/n2 ) > 0 .
Proof: Let p 1 · . . . · p r be the (ordered) prime factorization of n, such that
we can rewrite
log(n)δ = log(
Y
p i )δ =
16i6r
X
16i6r
log(p i )δ =
X
s(δ + 1, δ · p i ) .
16 i 6 r
At the same time, the thresholds a 0 = 1 and a i = p 1 · . . . · p i for i ∈ {1, . . . , r}
(i.e. a r = n) induce the partition
s(δ + 1, δ · n) =
X
16i6r
s(δ · a i − 1 + 1, δ · a i ) ,
12
ELEMENTARY METHODS FOR COUNTING PRIME NUMBERS
whose summands become
s(a i − 1 δ + 1, a i − 1 δ · p i ) = s(δ + 1, δ · p i ) + |O 1 |(1/δ)
due to our Lemma 3.1 (when we choose a = a i − 1 and b = p i ). Adding all of
them up back together gives us
s(δ + 1, δ · n) =
X s(δ + 1, δ · p i ) + |O 1 |(1/δ)
16i6r
=
X
s(δ + 1, δ · p i ) + r · |O 1 |(1/δ)
16i6r
= log(n)δ + o 2 (n) · |O 1 |(1/δ) ,
and so, for δ > o 2 (n), with help of our Lemma 3.1 (plugging in 1 for its own
δ, and then renaming a into our δ here, as well as setting b = n) once more
log(n)δ = s(δ + 1, δ · n) − |O 1 |(o 2 (n)/δ)
= s(1 + 1, 1 · n) + |O 1 |(1/1) − |O 1 |(1)
= s(2, n) + |O 1 |(1) − |O 1 |(1) = s(2, n) + O 1 (1) .
If now even δ > n3 holds, then
log(n + 1)δ − log(n)δ
= s(δ + 1, δ · (n + 1)) − o 2 (n + 1) · |O 1 |(1/δ)
− s(δ + 1, δ · n) − o 2 (n) · |O 1 |(1/δ)
= s(δ + 1, δ · n) + s(δ · n + 1, δ · (n + 1)) − n · |O 1 |(1/δ)
− s(δ + 1, δ · n) + n · |O 1 |(1/δ)
= s(δn + 1, δn + δ) + O 1 (n/δ) ,
where O 1 (n/δ) = O 1 (n/n3 ) = O 1 (1/n2 ) and
> δ · 1/δn + δ = δ/δ(n + 1) = 1/(n + 1) ,
s(δn + 1, δn + δ)
6 δ · 1/δn + 1 6 δ/δn = 1/n ,
together with 0 6 1/n − 1/(n + 1) = (n + 1) − n/n(n + 1) = 1/n(n + 1) 6 1/n2 yields
log(n + 1)δ − log(n)δ
= 1/n − |O 1 |(1/n2 ) + O 1 (1/n2 ) = 1/n + O 2 (1/n2 ) ,
and our last claim is proved, too.
As a sort of a test case, let us try to evaluate our δ-logarithm at the huge
number n! (as done with e p in Lemma 2.4), and then also let us introduce a
handy tool, if we want to take our δ-logarithm on both sides of an inequality.
13
ELEMENTARY METHODS FOR COUNTING PRIME NUMBERS
Example
For δ > n3 , we are now able to evaluate
log(n!)δ = n · log(n)δ − n + 1 + O 2 (s(1, n))
by partial summation (without using integration), and then
s(1, n!) = n · s(1, n) + O 3 (n + s(1, n) + 1)
is able to follow, choosing δ > max{n3 , 2s(1, n!)}.
Proof: By expanding log(n!)δ neatly into shifted parts, we get
log(n!)δ = log(
Y
16a6n
=
X
X
a)δ =
1 · log(a)δ
16a6n
a · log(a)δ −
16a6n
X
(a − 1) · log(a)δ
16a6n
= n · log(n)δ +
= n · log(n)δ −
X
a · log(a)δ −
16a6n−1
X
where, for δ >
X
X
a · log(a + 1)δ
06a6n−1
Ä
a · log(a + 1)δ − log(a)δ
16a6n−1
n3 ,
ä
,
our Theorem 3.2 can estimate the sum as
16a6n−1
a · 1/a + O 2 (1/a2 ) =
Ä
= (n − 1) + O 2
ä
X
X
16a6n−1
Ä
ä
1 + O 2 (1/a)
1/a = n − 1 + O 2 (s(1, n)) ,
16a6n−1
and if we choose δ > max{n3 , 2s(1, n!)}, the other part of our Theorem 3.2 is
enabled to even replace both δ-logarithms for us in the requested way.
Corollary 3.3.
. . . for applying our δ-logarithm on inequalities of the form a 6 b (a, b ∈ N)
Let 2 6 a 6 b be natural numbers, such that in particular, after being
shrinked into our (shifted) harmonic numbers, we have s(2, a) 6 s(2, b),
for which our Theorem 3.2 is enabled to deliver
s(2, a) = log(a)δ + O 1 (1) and s(2, b) = log(b)δ + O 1 (1) ,
whenever we are able to ensure δ > max{o 2 (a), o 2 (b)} = o 2 (b), in turn.
If we can do, then combining both approximations (in their respective
extreme cases for O 1 (1)) leads to log(a)δ − 1 6 log(b)δ + 1, which now
also holds true for a = 1 (and b = 1), since always log(1)δ = 0.
14
ELEMENTARY METHODS FOR COUNTING PRIME NUMBERS
4. Some formulas counting prime numbers
Equipped with a couple of nice tools, and feeling our prime numbers just
around the corner more than ever, here comes our main result.
Theorem 4.1.
For n > 64 and δ > n3 , we have
Ç
4
log(2)δ −
n
å
n
·
6 π(n) 6
log(n)δ
Ç
å
4
n
2 log(4)δ + + 1 ·
.
n
log(n)δ
Proof: On one hand, our Proposition 2.7 allows us to build
2n − 1 6 ℓ(n) =
Y
po p (n) 6
p6n
Y
n = nπ(n) ,
p6n
where at each of the π(n) prime numbers p 6 n, we filled up its highest power
po p (n) 6 n to n itself. Now, we may take our δ-logarithm on both sides via
log(2n − 1 )δ − 1 6 log(nπ(n) )δ + 1
in the spirit of our Corollary 3.3, whenever we are able to ensure
δ > max{o 2 (2n − 1 ), o 2 (nπ(n) )} = o 2 (nπ(n) )
in turn, and indeed we easily verify o 2 (nπ(n) ) 6 o 2 (nn ) 6 n · (o 2 (n) + 1) 6 n3 .
Simplifying a bit more with help of our δ-logarithm, we first reach
(n − 1) · log(2)δ − 2 6 π(n) · log(n)δ ,
and then suddenly our lower bound
n
(n − 1) · log(2)δ − 2
=
·
π(n) >
log(n)δ
log(n)δ
Ç
log(2)δ + 2
log(2)δ −
n
å
,
noting log(2)δ = s(2, 2) + O 1 (1) 6 1/2 + 1 = 3/2, for δ > o 2 (2) = 1.
In the other direction, our Proposition 2.6 first seems a trifle harder to be
uncoupled from our prime numbers, but what we can do, for any x > 1, is
4n > p(n) =
Y
p6n
>
Y
x<p6n
x=
p>
Y
p
x<p6n
Y
p6n
x
¿ Y
x = xπ(n) − π(x) ,
p6x
where each small prime number p 6 x felt asleep, and we could estimate each
larger prime number by x itself. As before, we here are again able to provide
max{o 2 (4n ), o 2 (xπ(n) − π(x) )} = o 2 (4n ) = o 2 (22n ) = 2n 6 n3 6 δ, such that our
Corollary 3.3 can supply us with the inequality
log(4n )δ + 1 > log(xπ(n) − π(x) )δ − 1 ,
ELEMENTARY METHODS FOR COUNTING PRIME NUMBERS
15
which transforms itself into
n · log(4)δ + 2 > (π(n) − π(x)) · log(x)δ ,
and so, after reordering, we arrive at
n · log(4)δ + 2
n · log(4)δ + 2
π(n) 6
+ π(x) 6
+ x.
log(x)δ
log(x)δ
With our dream upper bound in mind, let us now choose
x = n/([log(n)δ ] + 1) ,
such that for sure x 6 n/ log(n)δ , and at the same time we also may write
log(x)δ = log(n/([log(n)δ ] + 1))δ
= log(n)δ − log([log(n)δ ] + 1)δ > log(n)δ /2 ,
where the last step follows by log([log(n)δ ] + 1)δ 6 log(n)δ /2 or, equivalently,
log(([log(n)δ ] + 1)2 )δ 6 log(n)δ . To see this, we first prove (s(1, n) + 1)2 6 n.
Starting at n = 64 with
(s(1, 64) + 1)2 6 ((o 2 (26 ) + 1) + 1)2 = ((6 + 1) + 1)2 = 82 = 64 ,
due to the general bound
s(1, n) 6 s(1, 2o 2 (n) + 1 − 1) =
X
s(2r , 2r + 1 − 1)
0 6 r 6 o 2 (n)
6
r+1
− 1) − 2r + 1) · 1/2r
X
((2
X
2r · 1/2r =
0 6 r 6 o 2 (n)
=
0 6 r 6 o 2 (n)
X
1 = o 2 (n) + 1 ,
0 6 r 6 o 2 (n)
our inequality can be deduced for all remaining n > 64 by induction, since if
we are given (s(1, n) + 1)2 6 n, then the rough estimate
s(1, n) = s(1, 2) + s(3, n)
6 1 + 1/2 + 1/3 · (n − 3 + 1) = 3/2 + n/3 − 2/3 6 n/2 − 1 ,
can help us establishing also
(s(1, n + 1) + 1)2 = (s(1, n) + 1/(n + 1) + 1)2
= (s(1, n) + 1)2 + 2 · (s(1, n) + 1) · 1/(n + 1) + (1/(n + 1))2
6 n + 2 · ((n/2 − 1) + 1) · 1/(n + 1) + 1/(n + 1)2
6 n + n/(n + 1) + 1/(n + 1) = n + (n + 1)/(n + 1) = n + 1 .
In view of Theorem 3.2 we may now apply our δ-logarithm to
([log(n)δ ] + 1)2 6 (log(n)δ + 1)2
6 ((s(2, n) + O 1 (1)) + 1)2 6 (s(1, n) + 1)2 6 n ,
16
ELEMENTARY METHODS FOR COUNTING PRIME NUMBERS
because δ > n3 . Inserting the just proved inequality log(x)δ > log(n)δ /2 into
our last upper bound for π(n), we finally obtain
Ç
å
n · log(4)δ + 2
n
n
4
π(n) 6
+
=
· 2 log(4)δ + + 1 ,
log(n)δ /2
log(n)δ
log(n)δ
n
and so both desired inequalities are ready.
Similarly, as one can sharpen Chebyshev’s classical inequalities [7] for the
prime counting function,
. n
0.92129 6 π(x)
6 1.10550 ,
log(n)
one can improve our lower and upper bounds slightly, but for Selberg’s proof
of Dirichlet’s theorem, however, we only need its rough order of growth, and
no explicit (upper) bounds. The same applies to the final ingredient, Selberg
is refering to, and which we consider now in the following form.
Theorem 4.2.
For n > 2 and δ > 8n3 , we have
X log(p)δ
= log(n)δ + O 17 (1) .
p
p6n
Proof: On the one side, due to our Example we have
(∗)
log(n!)δ = n · log(n)δ − n + 1 + O 2 (s(1, n)) ,
while on the other site, the unique prime factorization of n! tells us
log(n!)δ = log(
Y
pe p (n!) )δ =
p6n
X
log(pe p (n!) )δ =
p6n
X
e p (n!) · log(p)δ ,
p6n
and now both old bounds n/p − 1 6 e p (n!) 6 n/p + n/p(p − 1) in our Lemma 2.4
can become active, to present us the lower bound
log(n!)δ >
X
(n/p − 1) · log(p)δ
p6n
= n·
X log(p)δ
p
p6n
−
X
log(p)δ ,
p6n
as well as the upper bound
log(n!)δ 6
X
(n/p + n/p(p − 1)) · log(p)δ
p6n
=n·
X log(p)δ
p6n
p
+n·
X log(p)δ
p(p − 1)
p6n
,
ELEMENTARY METHODS FOR COUNTING PRIME NUMBERS
17
where the last both sums in each of these inequalities should behave like error
terms with respect to (∗). In fact, our Proposition 2.6 is able to bound
X
log(p)δ = log(
p6n
Y
p)δ = log(p(n))δ 6 log(4n )δ + 2 = n · log(4)δ + 2
p6n
supported by our Corollary 3.3 since o 2 (4n ) = 2n 6 8n3 , and hence compared
with (∗), after dividing by n and reordering terms, we reach
X log(p)δ
p
p6n
6 log(n)δ − 1 + 1/n + O 2 (s(1, n))/n + log(4)δ + 2/n
Ä
ä
= log(n)δ − 1 + O 2 (n)/n + s(2, 4) + O 1 (1) + 3/n
6 log(n)δ − 1 + 2 + (2 + 1) + 3/n 6 log(n)δ + 5 .
Moreover also in the other direction our error term stays bounded, because
X log(p)δ
X log(a)δ
X
X
log(a)δ 6
6
p(p − 1) 2 6 a 6 n a(a − 1) 1 6 r 6 o (n) r
a(a − 1)
r +1
p6n
2
X
6
1 6 r 6 o 2 (n)
X
=
1 6 r 6 o2
X
2r 6 a < 2r +1
2 6a<2
X
log(2r + 1 )δ =
2r (2r − 1)
16r6o
2r ·
2 (n)
(r + 1) · log(2)δ
6 2 log(2)δ ·
r −1
2
16r6o
(n)
X
2
log(2r + 1 )δ
2r (2r − 1)
r+1
,
r
2
(n)
where our Theorem 3.2 could provide the monotonicity for our δ-logarithm
whenever δ > (2n)3 = 8n3 , and together with the cute bounds
X 1
1
1
1
= 1 + 2 + 2 + ... + 2
2
r
2
3
n
16r6n
1
1
1
61+
+
+ ... +
1·2 2·3
(n − 1) · n
1
1
1
1 1 1
+
+ ... +
= 2 − 6 2,
−
−
=1+ 1−
2
2 3
n−1 n
n
r
3
as well as 2 > r for r > 16 (which can be easily proved by induction starting
from 163 = (24 )3 = 212 6 216 ), we can estimate the last sum further by
X r+1
X r
X 1
=
+
r
r
2
2
2r
16r6n
16r6n
16r6n
=
X
r
r
+
+ g n (2)
2r 16 6 r 6 n 2r
1 6 r < 16
X
6 1·
6
1
2
X
r
2
4
8
1
1
+
2
·
+
4
·
+
8
·
+
+
1
2
4
8
3
2
2
2
2
r
2−1
16 6 r 6 n
+1+1+
X
1
1
1
+
+
1
=
3
+
2
−
+ 1 = 5.
4 16 6 r 6 n r 2
12
18
ELEMENTARY METHODS FOR COUNTING PRIME NUMBERS
Combining everything in conjunction with (∗) as before, we finally get
X log(p)δ
p6n
p
6 log(n)δ − 1 + 1/n + O 2 (s(1, n))/n + 2 log(2)δ · 5
Ä
ä
6 log(n)δ − 1 + 1 + 2 + 10 · s(2, 2) + O 1 (1)
6 log(n)δ + 2 + 10 · (1/2 + 1) = log(n)δ + 17 ,
and this concludes proof of our entire formula.
5. Prime twins and future work
Taking our latter results into account, we arrive at a possible variation of
Selberg’s elementary proof of Dirichlet’s theorem about primes in arithmetic
progressions, with the only yet non elementary ingredient, the real logarithm
replaced by our δ-logarithm. Furthermore it seems reasonable that, following
Erdős and Selberg, one could also use our approach to achieve a completely
elementary proof of the prime number theorem, which shows once more that
the primes do have logarithmic weight within the set of our natural numbers.
As implied by our Theorem 3.2, it is well known that the harmonic numbers
grow asymptotically as the logarithm. If we replace this sum of reciprocals of
the first natural numbers with the sum of reciprocals of the first primes, the
iterated logarithm provides us the asymptotics, a connection Euler denoted in
a suggestive manner by the formula
1/2
+ 1/3 + 1/5 + 1/7 + 1/11 + 1/13 + . . . = log log ∞ ,
of course with the real logarithm here. Using our δ-logarithm we can transfer
his result into the following bound, whose proof will also be very close to the
idea of Euler, how to prepare our Theorem 2.3 for analytic number theory.
Preview
and Exercise
For n > 2 and δ > . . . , we have
X 1
> log(log(n)δ )δ − 2 .
p
p6n
In this context, it is even more remarkable, that the corresponding sum of
the reciprocals of the first prime twins only converges in turn. This has been
observed first by Brun using his pure combinatorial sieve and shows that the
set of prime twins forms a sparse subset within the set of all prime numbers.
Varying Brun’s approach, we can derive this very convergence by completely
elementary means, where all necessary information about our prime numbers
is encoded in the above preview, and this bound together with some modified
(upper bound) sieve will be realized in future work soon.
ELEMENTARY METHODS FOR COUNTING PRIME NUMBERS
19
But as our final application here, let us return to the last question of the
introduction concerning the number of pairwise distinct elements in the n × n
multiplication table. Forgetting about our composite numbers for a moment,
we can build such a table from the first π(n) primes. In view of unique prime
factorization, all π(n) × π(n) resulting products are distinct upto permutation
of both factors, and so our Theorem 4.1 shows that their number is at least
a constant times n2 · 1/ log(n)2δ which is getting closer and closer to n2 in the
exponent, as n is increasing. On one hand, this demonstrates how useful our
prime numbers are in view of to the conjecture of Erdős and Szemerédi, but
not only: first memorizing and now even understanding a bit more how much
work they made us learning multiplication tables and ever since providing a
bit deeper insight into their pretty mysteries, which I never want to miss.
Acknowledgements. I would like to thank Miriam, Prof. Jörn Steuding
and my parents for always motivating me not to give up.
References
[1] P. Erdős, E. Szemerédi, On sums and products of integers.
Studies in pure mathematics, Birkhäuser (1983), 213 – 218
[2] J. Solymosi, Bounding multiplicative energy by the sumset.
Advances in Mathematics 222 (2009), 402 – 408
[3] A. Selberg, An elementary proof of Dirichlet’s theorem about primes
in an arithmetic progression. Annals of Mathematics (2) 50 (1949), 297 – 304
[4] V. Brun, Le crible d’Eratosthène et le théorème de Goldbach.
Christiania Vidensk. Selsk. Skr. 3 (1920), 1 – 36
[5] M. Nair, On Chebyshev-type inequalities for primes.
American Mathematical Monthly 89 (1982), 126 – 129
[6] M. Agrawal, N. Kayal, N. Saxena, PRIMES is in P.
Annals of Mathematics (2) 160 (2004), 781 – 793
[7] P. L. Chebyshev, Mémoire sur nombres premiers.
Mémoires des savants étrangers de l’Acad. Sci. St. Pétersbourg 7 (1850), 17 – 33
[8] P. Erdős, J. Surányi, Topics in the theory of numbers.
Undergraduate Texts in Mathematics, Springer (2003)
[9] G. Tenenbaum, Introduction to analytic and probabilistic number theory.
Graduate Studies in Mathematics, American Mathematical Society (2015)
Erklärung. Hiermit versichere ich, dass ich diese Arbeit eigenständig und
nur unter Verwendung der angegebenen Hilfsmittel und Quellen verfasst habe.
. . . . . . . . . . . . . . . . . . . . . . . . .
(Pascal Stumpf)
Würzburg, den 29.03.2016
© Copyright 2026 Paperzz