A089896 Logarithmic integral approximation to number of primes less than 10^x.
6, 30, 177, 1246, 9629, 78627, 664918, 5762209, 50849234, 455055614, 4118066400, 37607950280, 346065645810, 3204942065691, 29844571475287, 279238344248556, 2623557165610821, 24739954309690415, 234057667376222382
Offset: 1
Keywords
Links
- Xavier Gourdon, Collection of approximations for pi
Programs
-
Mathematica
Table[Floor[LogIntegral[10^n]], {n, 19}] (* Arkadiusz Wesolowski, Dec 23 2011 *)
-
PARI
Li(n,m) = { y2 = log(n); y = 1; z=1; s=log(y2)+ Euler(); for(x=1,floor(2*log(n)+m),y=y2^x/x/gamma(x+1); s+=y; ); return(s) } pw2pix(n,m) = { for(x=1,n, y=10^x; print1(floor(Li(y,m))",") ) }
Formula
The logarithmic Integral can be computed by Li(x) = log(log(x)) + log(x) + log(x)^2/2/2! + log(x)^3/3/3! + ... + 1 - log(3/2) - sum(k=1, prec, (zeta(2k+1)-1)/(2k+1)/4^k). This last expression is a fast converging series taken from the link for the Euler-Mascheroni constant 0.57721.. where prec is the precision level you are using. PARI has an Euler() function built in so that was used in this calculation.
Comments