Is it possible to find the position of a prime number online?

2 is the first prime number. 3 is the second.

If I give a prime number such as 1151024046313875220631 is there any software/website which can give the position of the prime number.

I know there are resources to find Nth prime. But I am having a hard time finding the reverse.

-
You can always use binary search. –  Aryabhata Aug 17 '10 at 16:09
Sieving is more or less what Mathematica does, using the logarithmic integral as an (over)estimate. –  Ｊ. Ｍ. Aug 17 '10 at 16:23
Your number (~10^21) is probably too big for that. –  starblue Aug 17 '10 at 19:21
I don't think there is online resource to find the ($2.4\times10^{19}$)th prime. –  KennyTM Aug 18 '10 at 7:57

6 Answers

If you have access to Mathematica, PrimePi[x] will give you the number of primes less than x. Combined with PrimeQ, which verifies that x is indeed prime, will give you which prime number x is.

EDIT: I have no idea how long Mathematica would take (or if it could in fact compute it) for a number that high.

-
Mathematica has a built-in ceiling for both Prime[] and PrimePi[]; see the documentation for the error message PrimePi::largp. This is probably both version and machine dependent. –  Ｊ. Ｍ. Aug 17 '10 at 16:20
thanks for the tip –  Karthik Aug 23 '10 at 18:48
That number is too big for even the 64-bit version of Mathematica 7. –  Charles Sep 8 '10 at 20:30

You can use the function prime_pi in Sage (http://sagemath.org), which is also available for free online at http://sagenb.org. For example,

   sage: prime_pi(2011)
305


Like Mathematica, Sage's prime_pi function is too slow to solve your problem above. It's also somewhat slower than Mathematica's still.

-

What you are looking for is the "Prime Counting Function". The closest thing to it you will find online is Wolfram Alpha:

http://www.wolframalpha.com/examples/PrimeNumbers.html

-

If an approximation suffices, you could use the offset logarithmic integral function.

-

Andrew Booker's Nth prime page is excellent... but it can't handle your example number.

I have custom code that can calculate values up to about 2^64, but your number is larger than that.

Thanks to Dusart [1], we can say that its rank is somewhere between 24244547260299402427 and 24247918127257270377.

If the Riemann Hypothesis is true, then we know by Schoenfeld [2] that its rank is somewhere between 24245911027060346607 and 24245911157987206331.

[1] Pierre Dusart, 'Estimates of Some Functions Over Primes without R.H.', preprint (2010), arXiv:1002.0442

[2] Lowell Schoenfeld, 'Sharper Bounds for the Chebyshev Functions theta(x) and psi(x). II'. Mathematics of Computation, Vol 30, No 134 (Apr 1976), pp. 337-360.

-

For primes smaller than your example you can use Wolfram|Alpha, as Adam S pointed out. Wolfram|Alpha has the prime Pi function:

-