The following vague discussion is meant to motivate a precise way to
measure the number (or percentage) of primes. What percentage of
natural numbers are even? Answer: Half of them. What percentage of
natural numbers are of the form
? Answer: One fourth of them.
What percentage of natural numbers are perfect squares? Answer: Zero
percent of all natural numbers, in the sense that the limit of the
proportion of perfect squares to all natural numbers converges to 0
.
More precisely,
since the numerator is roughly
We are thus led to ask another question: How many positive integers
are perfect squares? Answer: roughly
. In the
context of primes, we ask,
Let
For example,
Some values of
sage: prime_pi(6) 3 sage: prime_pi(100) 25 sage: prime_pi(3000000) 216816We can also draw a plot of
sage.: show(plot(prime_pi, 1,1000, rgbcolor=(0,0,1)))
Gauss was an inveterate computer:
he wrote in an 1849 letter that there are
primes less than
(this is wrong but close;
the correct count is
).
Gauss conjectured the following asymptotic formula for
, which was
later proved independently by Hadamard and Vallée
Poussin in 1896 (but will not be proved in
this book):
We do nothing more here than motivate this deep theorem with a few further observations. The theorem implies that
so for any
Thus
![]() |
![]() |
![]() |
1000 | 168 | 169.2690290604408165186256278 |
2000 | 303 | 302.9888734545463878029800994 |
3000 | 430 | 428.1819317975237043747385740 |
4000 | 550 | 548.3922097278253264133400985 |
5000 | 669 | 665.1418784486502172369455815 |
6000 | 783 | 779.2698885854778626863677374 |
7000 | 900 | 891.3035657223339974352567759 |
8000 | 1007 | 1001.602962794770080754784281 |
9000 | 1117 | 1110.428422963188172310675011 |
10000 | 1229 | 1217.976301461550279200775705 |
As of 2004, the record for counting primes appears to be
The computation of
For the reader familiar with complex analysis, we mention a
connection between
and the Riemann Hypothesis. The
Riemann zeta function
is a complex analytic function on
that extends the function defined on a right
half plane by
. The Riemann
Hypothesis is the conjecture that the
zeros in
of
with positive real part lie on the line
. This conjecture is one of the Clay Math Institute
million dollar millennium prize problems [#!cmi!#].
According to [#!primenumbers!#, §1.4.1], the Riemann Hypothesis is equivalent to the conjecture that
is a ``good'' approximation to
If
![]() |
![]() |
|
![]() |
![]() |
|
![]() |
![]() |
|
![]() |
![]() |
|
![]() |
![]() |
sage: def Li(x): ... return integral_numerical(lambda t: 1/log(t), 2, x)[0] sage: P = plot(prime_pi, 2,10000, rgbcolor=(1,0,0),plot_points=30) sage: Q = plot(Li, 2,10000, rgbcolor=(0,0,1), plot_points=30) sage: R = plot(lambda x: sqrt(x)*log(x), 2, 10000) sage.: show(P+Q+R,xmin=0)
For more on the prime number theorem and the Riemann hypothesis see [#!zagier:primes50!#] and [#!mazur-stein:rh!#].
William 2007-06-01