## Fw: A mystery about the logarithmic integral function Li(x) ?

Expand Messages
• ... From: Tascino Hilliard To: Jean-Pierre Pratali Sent: Tuesday, February 15, 2005 7:26 AM Subject:
Message 1 of 1 , Feb 15, 2005
----- Original Message -----
From: "Tascino Hilliard" <hillcino368@...>
To: "Jean-Pierre Pratali" <jpierre.pratali@...>
Sent: Tuesday, February 15, 2005 7:26 AM
Subject: Re: A mystery about the logarithmic integral function Li(x) ?

>
> --- In primenumbers@yahoogroups.com, "Jean-Pierre Pratali"
> <jpierre.pratali@w...> wrote:
> >
> > n = ...;
> > L := N[LogIntegral[n], 100]; N1 := Floor[L];
> > S := 0;
> > p = N[n/Log[n], 100];
> > For [k = 0, k < Floor[Log[n]], k++, S = S + N[k!/Log[n]^k, 100]];
> > S = p*S; N2 := Floor[S];
> > Print[N1, " ", N2, " ", N2 - N1]
> >
> Hi Jean,
> interesting formula. I tried it in Pari.
>
> I had come up a formula before I discovered the "hidden" Li function
> in Pari -eint1(log(1/n)) = Li(x).
>
> My first rendition
> Lix(n) =
> {
> local(y2,y,z,s,x);
> y2 = log(n);
> y = 1;
> z=1;
> s=log(y2)+ Euler();
> for(x=1,floor(2*log(n)+300),y=y2^x/x/gamma(x+1);
> s+=y;
> );
> return(s)
> }
>
>
> PratLi(n) =
> {
> local(s=0,k=0,p,n1,n2);
> n1=floor(-eint1(log(1/n)));
> p=n/log(n);
> for(k = 0,floor(log(n)),s+=(k!/log(n)^k));
> s*=p;
> n2=floor(s);
> return(n2)
> }
>
> Some timings with prec = 100 digits
> gp > for(x=2,10000,y=Li(x))
> time = 3,578 ms.
> gp > for(x=2,10000,y=Lix(x))
> time = 3,719 ms.
> gp > for(x=2,10000,y=PratLi(x))
> time = 11,140 ms.
>
> Then there is
> R(x) = \\ Riemann's approx of Pi(x)
> {
> local(j);
> sum(j=1,5000,moebius(j)*Li(x^(1/j))/j)
> }
> much more accurate to Pi(x) but takes a while for the above loops.
>
> HF,
> Cino
>
>
>
>
Your message has been successfully submitted and would be delivered to recipients shortly.