## Re: Nth Index of a Prime

Expand Messages
• Hi, If by Nth index you mean pi(x) then: pi(123571113171923) = 3933667972530 pi(231917131175321) = 7237459689186 pi(1235711131175321) = 36647548937934
Message 1 of 6 , Jun 30, 2010
Hi,

If by Nth index you mean pi(x) then:

pi(123571113171923) = 3933667972530
pi(231917131175321) = 7237459689186
pi(1235711131175321) = 36647548937934
pi(1357911131197531) = 40159216312772

The next one is too big for my implementation and I do not think anyone knows pi(R23) for sure. I could provide good approximations.

- David

>
> Peace to all,
>
> Can someone please tell me what is the best way to find the Nth index of the following not so large prime numbers?
>
> 12345678910987654321 (from 1 to 10 and back)
>
> 1357911131197531 (odds from 1 to 13 and back)
>
> 1235711131175321 (primes from 1 to 13 and back)
>
> 123571113171923 (primes from 1 to 23)
>
> 231917131175321 (primes from 23 to 1)
>
> and
>
> 11111111111111111111111 (23 ones)
>
> Thank you all.
>
> God > infinity
> www.heliwave.com
>
>
>
>
>
>
>
> [Non-text portions of this message have been removed]
>
• ... How did you compute pi(x) with x 10^15, please, David? Andrew Booker s programme hosted at http://primes.utm.edu/nthprime/ is restricted to pi(x) with x
Message 2 of 6 , Jul 13, 2010
David Baugh <PbtoAu@...> wrote:

> pi(1357911131197531) = 40159216312772
> The next one is too big for my implementation

How did you compute pi(x) with x > 10^15, please, David?

Andrew Booker's programme hosted at
http://primes.utm.edu/nthprime/
is restricted to pi(x) with x < 3*10^13.

For those with dollars to burn, Mma seems
able to compute pi(x) with x < 8*10^13:
http://mathworld.wolfram.com/PrimeCountingFunction.html

It seems that you have an implementation that
comfortably copes with x > 10^15.

Might you consider making your code available to
Chris Caldwell, for on-line use at the Prime Pages,
as Andrew generously did with his? If the data tables
are too big or the CPUtime too onerous for such on-line use,
might you kindly provide a source that others may compile?

Best regards

• ... I don t know what David Baugh uses but there is something better. At http://mersenneforum.org/showthread.php?t=13210 I wrote: Two years ago I searched for
Message 3 of 6 , Jul 13, 2010
> David Baugh <PbtoAu@...> wrote:
>
>> pi(1357911131197531) = 40159216312772
>> The next one is too big for my implementation
>
> How did you compute pi(x) with x > 10^15, please, David?

I don't know what David Baugh uses but there is something better.

"Two years ago I searched for a good pi(x) program, found an old mention
of Christian Bau and dug up a link to http://www.cbau.freeserve.co.uk
The link was and still is dead but the Wayback Machine has archived
versions up to 2005 at
http://web.archive.org/web/*/http://www.cbau.freeserve.co.uk.

There is C++ source by Christian Bau for the Extended Meissel-Lehmer
algorithm. It works to 2^64 and my test runs agree with published counts
by Tomás Oliveira e Silva. I have used the program for a few projects
such as http://primes.utm.edu/curios/includes/puzzio.php. The archive has
Version 0.92, 25/Sep/2003. The site speaks of unfinished work in
progress and mentions future improved versions but I have not found that."

It takes 1 minute for the program to compute pi(1357911131197531) on
one core of a 2.4 GHz Core 2 Duo. The value agrees with David Baugh.

--
Jens Kruse Andersen
• ... Thanks, Jens! web.archive.org/web/20040125140056/http://www.cbau.freeserve.co.uk/ ... which seems to permit personal use. David
Message 4 of 6 , Jul 13, 2010
"Jens Kruse Andersen" <jens.k.a@...> wrote:

> Two years ago I searched for a good pi(x) program,
> found an old mention of Christian Bau and dug up a link to
> http://www.cbau.freeserve.co.uk [broken URL]

Thanks, Jens!

web.archive.org/web/20040125140056/http://www.cbau.freeserve.co.uk/

seems to be an appropriate archived URL. "PrimeCount.cp" says:

> This code is unfinished work in progress. For this reason,
> you may download this code and use it on the computer that
> strictly prohibited.

which seems to permit personal use.

David
• Looks like Bau s code goes twice as high as Baugh s code and I don t have source code. The code the community needs is that developed by Tomás Oliveira e
Message 5 of 6 , Jul 14, 2010
Looks like Bau's code goes twice as high as Baugh's code and I don't have source code. The code the community needs is that developed by Tomás Oliveira e Silva. His can go to at least 10^23. I have asked, but I guess not nicely enough.

- David

>
>
>
> David Baugh <PbtoAu@> wrote:
>
> > pi(1357911131197531) = 40159216312772
> > The next one is too big for my implementation
>
> How did you compute pi(x) with x > 10^15, please, David?
>
> Andrew Booker's programme hosted at
> http://primes.utm.edu/nthprime/
> is restricted to pi(x) with x < 3*10^13.
>
> For those with dollars to burn, Mma seems
> able to compute pi(x) with x < 8*10^13:
> http://mathworld.wolfram.com/PrimeCountingFunction.html
>
> It seems that you have an implementation that
> comfortably copes with x > 10^15.
>
> Might you consider making your code available to
> Chris Caldwell, for on-line use at the Prime Pages,
> as Andrew generously did with his? If the data tables
> are too big or the CPUtime too onerous for such on-line use,
> might you kindly provide a source that others may compile?
>
> Best regards
>