Plans regarding prime numbers.
More...
Go to the source code of this file.
Detailed Description
Plans regarding prime numbers.
 Todo:
 Connections
 Todo:
 Enumerating prime numbers
 Todo:
 count_primes

There is an enormous literature with estimations of count_primes.

We should implement such estimations.

DONE Most basic is approx_count_primes_0 and approx_count_primes_1.

Approximation via the logarithmic integral:

DONE Perhaps we should integrate starting from 0, not from 2?

DONE This yields +1.045, for the prime number 2.

DONE (works with the buildin function) However then the numerical evaluation does not work.

DONE The integral from 0 to x is given by expintegral_li(x).

DONE (likely corrected by Maxima community) The documentation for expintegral_li(x) says "expintegral_li (<n>,<z>)", however two arguments are not accepted? Ask the Maxima mailing list.

So currently the higher logarithmic integrals Lih(x,m) can not be evaluated using Maxima (and thus we integrate starting with 2).

It is actually questionable whether to start with 0 or 2: Apparently some call it "European" to start with "2", and "American" to start with 0.

And it's not so clear whether actually the indefinite integrals over the interval [0,2] exist for m>=2.

Hans Werner Borchers <hwborchers@googlemail.com> writes:
I had some time today to search, and after using Wolfram's Online
Integrator and the NIST Digital Library of Mathematical Functions, I
came up with the following solution,
\int 1/log(x)^m =  Em(log(x))/log(x)^{m1} ,
where Em is a generalized exponential integral, that is available in
the 'gsl' package as
expint_En(m, x)
And as 'En(.,x)' is available in R, so all the higher logarithmic
integrals can be computed as well. Of course, you have to be careful
to avoid all their singularities.
(see Buildsystem/ExternalSources/SpecialBuilds/plans/R.hpp).

So the Maxima functions would be
Lih_n(x,m) := expintegral_e(m,log(x))/log(x)^(m1)  (expintegral_e(m,log(2))/log(2)^(m1));
also integrating from 2.

This looks like a better computation.

Hans Werner Borchers also mentions formulas like
\int 1/\log(t)^2 dt = t/\log(t) + li(t)
\int 1/\log(t)^3 dt = 1/2 * ( t/\log(t)^2  t/\log(t) + li(t) )
which we need to check.
 Todo:
 product_primes

What is known about this function?
Definition in file PrimeNumbers.hpp.