## 184 Reputation

16 years, 167 days

## thanks...

Good to know, thanks again alec.

## Ah thanks alec, much...

Ah thanks alec, much appreciated.  It worked out nicely in Maple also.  I'll spare you the plots.

## Nevermind, seems as though...

Nevermind, seems as though Maple is happy with just defining the interval twice as long as the array.  But I also created a function 'fn:=x -> array[x/2]' and passed that as the function to plot.  I didn't think this would work but it has.

## Got it...

OK, with a lot of effort I think I have it.  I got the Hans Riesel book "prime numbers and computer methods for factorization" out of my university library and I found a function he uses to correct the error - http://mathbin.net/5986

where rho_k = 0.5 + i*alpha_k is the k-th non-trivial zero.

I just tried this in C using the GNU GSL library and it seems to do the trick.  Basically, I just did R_n(x) = R(x) + [sum, k=1..n] C_k(x) and plotted the values I got  (I'm not sure if I was supposed to use the trivial zeroes as well. I probably was. Ah well). It was nice and quick too.  If you plot it against pi(x) it gets better the higher n is.

Here is my program - http://pastebin.com/m6264640d .  Ugly code, but it does the trick. It calculates Rn(x) for 0<x<100 and just spits out the values.  I dumped these values alongside corresponding values for pi(x) in a datafile for gnuplot to do its work. Here are some graphs for  n=10 and n=100 respectively:

http://img15.imageshack.us/my.php?image=r10qk9.png

http://img252.imageshack.us/my.php?image=r100gh1.png

Cool huh? I'll try it in Maple on Thursday.

## May I ask how you arrived at...

May I ask how you arrived at that -0.5 + arctan()/pi formula? I can't find this anywhere, are you sure it is correct.  My C program is not going well either.  I have written what I think should do the trick but I am getting strange results. *sigh*

## Something is wrong...

Your suggestion to use add() instead of sum() was a good one as R_n(x) now is real, whereas I was getting some non-zero imaginary part before.  However, it is just far too slow and inprecise that it seems too fruitless to continue.  I am getting negative values for R_n(x) too, so something is going wrong.  For example, pi(50)=15, while R_n(50,10) = -2.238047486 10^22.

I like the idea of writing it in C. At home I run linux, no windows at all, so if I was just going to calculate values using a C program, then I could just give it to gnuplot, and discard Maple.  I downloaded the GNU scientific library last night - http://www.gnu.org/software/gsl/ and so I will try and see how that goes.

## Sorry it just dawned on me...

Sorry it just dawned on me you may have meant so that you could test it yourself. So here is 'Zeroes' if you care

.

Zeroes := [14.134725,21.022039,25.010857,30.424876,
32.935061,37.586178,40.918719,43.327073,48.005150,
49.773832,52.970321,56.446247,59.347044,60.831778,
65.112544,67.079810,69.546401,72.067157,75.704690,
77.144840,79.337375,82.910380,84.735492,87.425274,
88.809111,92.491899,94.651344,95.870634,98.831194,
101.317851,103.725538,105.446623,107.168611,
111.029535,111.874659,114.320220,116.226680,
118.790782,121.370125,122.946829,124.256818,
127.516683,129.578704,131.087688,133.497737,
134.756509,138.116042,139.736208,141.123707,
143.111845,146.000982,147.422765,150.053520,
150.925257,153.024693,156.112909,157.597591,
158.849988,161.188964,163.030709,165.537069,
167.184439,169.094515,169.911976,173.411536,
174.754191,176.441434,178.377407,179.916484,
182.207078,184.874467,185.598783,187.228922,
189.416158,192.026656,193.079726,195.265396,
196.876481,198.015309,201.264751,202.493594,
204.189671,205.394697,207.906258,209.576509,
211.690862,213.347919,214.547044,216.169538,
219.067596,220.714918,221.430705,224.007000,
224.983324,227.421444,229.337413,231.250188,
231.987235,233.693404,236.524229]:

Originally they were to 1000 decimal places, so I wrote a C program to chop them down to 6 and place them in a list like the above for me.

## Thanks...

Thanks for the replies, appreciated.

> It would be easier to help if you directly provided what you call "Zeroes".

'Zeroes' is a list of the imaginary part of the first 100 non-trivial zeroes.  So literally, a list with 100 elements in it.  I got these from some website.

> the sum to infinity has to be used. It is very slow in Maple though.

Precisely why I didn't use it.  I only want to produce a plot for small x anyway.  The point to all this is I am writing a paper on prime numbers and I need to show that I have produced my own plots.

I assumed I would have to use complexplot since we have the non-trivial zeroes in there which are complex?

> Rx := x -> evalf(add( ( ln(x) )^k / ( k * k! * evalf( Zeta( k+1 ) ) ) , k = 1..100 ));

I will try this tomorrow as I don't have access to Maple at the moment.  Thanks.

> The sum over trivial zeros is......

Are you sure?  Is it worth replacing this with sum( R( x^(-2*m) ), m=1..whatever )?

Anyway, thanks for your reponses, much appreciated.

## Thanks...

Thanks for that.  The question still stands though.

## When I say non-trivial...

When I say non-trivial zeroes, I mean zeroes of the Riemann zeta function which have real part 1/2.

## Aha, I have it.  ...

Aha, I have it.

complexplot(Zeta(0.5+t*I),t=0..50);

## I have tried the following...

I have tried the following but it gives me an empty graph

plot([Zeta(0.5 + I*t),t,t=0..50],coords=polar);

## I found a solution:  ...

I found a solution:

plot( pi(floor(x)), x=1..100, numpoints = 100, axesfont=[HELVETICA, SYMBOL,TIMES], thickness=2, axes=boxed );

 1 2 Page 1 of 2
﻿