- --- In primenumbers@yahoogroups.com,

"Cino Hilliard" <hillcino368@...> wrote:

> I want to examine

f(x,lx) = x/lx - 1/lx + a/lx^2 - b/lx^3; \\ modify at will

> sm(m,n)=sum(x=m,n,x/log(x)-1/log(x)+a/log(x)^2-b/log(x)^3)

> a=1,b=1,m=2

a=1; b=1; m=2; \\ chosen values

\p50

terms=10;trunc=10^4;g=f(x,lx);d=[];bv=bernvec(terms+1);

{for(n=1,2*terms-1, \\ store odd derivatives

g=deriv(g,x)+1/x*deriv(g,lx);if(n%2,d=concat(d,g)));}

fx(x)=f(x,log(x));

dx(y)=subst(subst(d,x,y),lx,log(y));

{emac(m,n)=local(dm,dn);

dm=dx(m);dn=dx(n);intnum(x=m,n,fx(x))+(fx(n)+fx(m))/2

+sum(k=1,terms,bv[k+1]/((2*k)!)*(dn[k]-dm[k]));}

s=sum(k=2,trunc-1,fx(k));

{sm(m,n) = \\ as requested

if(n>trunc&&trunc>m&&m>1,s-sum(k=2,m-1,fx(k))+emac(trunc,n));}

for(k=10,22,print([k,sm(m,sqrtint(10^k))]))

realprecision = 57 significant digits (50 digits displayed)

[10, 455051173.78013348859945302791104662093667330309988]

[11, 4118034570.4638268343263084222227560024582402009128]

[12, 37607913583.517014991610186636613681414323919745603]

[13, 346065399465.03248684994266161913298076743032790216]

[14, 3204941752475.7266213978929589359007763992788467339]

[15, 29844569450368.625194208305114011697818820369920647]

[16, 279238341514801.87986838501363369093160129071417051]

[17, 2623557157209703.2566630532132281009952796686474077]

[18, 24739954285430064.167128134429584525396645626800130]

[19, 234057667279245072.15948934429135642246573100181670]

[20, 2220819602565566257.9962162533153260118661266449421]

[21, 21127269485065195786.472528704950924409440892097567]

[22, 201467286689267167012.50527750985870920146256019519]

Comment: This is an inefficient method of fiddling with Li(x).

Cino is trying to avoid integration. Yet it is needed for

Euler-Maclaurin summation.

David - Hi David,

You did a lot of work here to develop emac(m,n).I appreciate

it as it saved me a lot of time and possibly money.

Thank you.

David Broadhurst wrote:> Comment: This is an inefficient method of fiddling with Li(x).

Maybe. Anyway I don't mind inefficiencies as I have to use them

everyday like the QWERTY keyboard and all the right handed stuff

around for this lefty.

Surprizingly, the most efficient combination in the real world for moving a mass from point A to point B with the least expenditure

of energy, is a human riding a bicycle on a flat surface. Then

there is the hummingbird which is one of the the least efficient systems that has been around for a while.

Nevertheless, Your emac(m,n) gets good mileage and is more

accurate than Li(x) =-eint1(log(1/x)) and

li(x,n) = lg=log(x);x*sum(k=1,n,(k-1)!/lg^k)

gp > p23=1925320391606818006727

gp > em23=emac(2,sqrt(10^23))

%116 = 1925320391608063705941.14436225628

gp > Li23=Li(10^23)

%117 = 1925320391614054155138.78012956636

gp > R23=R(10^23)

%118 = 1925320391607837268776.09905063742

gp > 1-em23/p23

%122 = -6.4700878855011600657703221947361 E-13

gp > 1-Li23/p23

%123 = -3.7584125963269129092185767109212 E-12

gp > 1-R23/p23

%124 = -5.2939866712178918250597351383218 E-13

For 10^22, emac is better than R(x).

The actual sum of the primes < sqrt(n) ~ Pi(n) is not as

accurate as emac but it is quite good wit RE below.

For sum of primes < 10^n, See the b-file at

http://www.research.att.com/~njas/sequences/A046731

sump11 = 201467077743744681014

gp > p22 = 201467286689315906290

%137 = 201467286689315906290

gp > 1. - sump11/p22

%139 = 0.00000103711..

This is magnitudes better than RE of 10^22/log(10^22)-1) =

0.000423348356239

I find this sum of primes <= sqrt(n) ~ primes <= n to be an

amazing property of prime numbers and the integers.

Bottomline, thanks to David, we have an eulermac function in

Pari.

Cheers and Roebuck,

Cino - --- In primenumbers@yahoogroups.com,

"Cino Hilliard" <hillcino368@...> wrote:

> Hi David,

Glad to help.

> You did a lot of work here to develop emac(m,n).

> I appreciate it as it saved me a lot of time and

> possibly money. Thank you.

> I find this sum of primes <= sqrt(n) ~ primes <= n to be

Not so amazing when you realize that the integrals

> an amazing property of prime numbers and the integers.

I1(N) = intnum(x=2, sqrt(N), x/log(x))

I2(N) = intnum(y=2, N , 1/log(y))

differ only by a constant, no matter what the value of N.

Proof: Transform the latter by setting y = x^2. Then

I2(N) - I1(N) = - I1(2) = 1.92242131492155809316615998937951547...

David