TITLE: Is there a known mathematical equation to find the nth prime?
QUESTION [70 upvotes]: I've solved for it making a computer program, but was wondering there was a mathematical equation that you could use to solve for the nth prime?

REPLY [34 votes]: Far better than sieving in the large range ShreevatsaR suggested (which, for the 10¹⁵th prime, has 10¹⁵ members and takes about 33 TB to store in compact form), take a good first guess like Riemann's R and use one of the advanced methods of computing pi(x) for that first guess.  (If this is far off for some reason—it shouldn't be—estimate the distance to the proper point and calculate a new guess from there.)  At this point, you can sieve the small distance, perhaps just 10⁸ or 10⁹, to the desired number.
This is about 100,000 times faster for numbers around the size I indicated.  Even for numbers as small as 10 to 12 digits, this is faster if you don't have a precomputed table large enough to contain your answer.