Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

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.

share|improve this question
2  
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. –  J. M. Aug 17 '10 at 16:23
1  
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 6

up vote 2 down vote accepted

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.

share|improve this answer
3  
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. –  J. M. 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.

share|improve this answer

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

share|improve this answer

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

share|improve this answer

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.

share|improve this answer

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

http://www.wolframalpha.com/input/?i=pi(55252335667)

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.