I'm quite new to Sage. Does it have any functionality that will easily compute the Nth prime and it's fast enough that it will work for N of the order 10^9 or 10^10 reasonable quickly (say, under 10 seconds)?
pari.nth_prime(1000000000) takes a very long time.
Are there alternatives?
Szabolcs
There has been some effort to include the open source libraries primesieve and primecount in Sage which would provide a much faster Primes iterator, prime_range, prime_pi, and nth_prime, however so far these haven't made it in.
However, both of these libraries do have a command line interface, and depending on the platform you are using there might be a precompiled binary. See primesieve.org and github.com/kimwalisch/primecount. The primecount library is much newer (about a year old), and a lot of performance improvements are still being made to it, but currently its nth_prime functionality takes around half a second for input around 10^10.
Hello,I'm quite new to Sage. Does it have any functionality that will easily compute the Nth prime and it's fast enough that it will work for N of the order 10^9 or 10^10 reasonable quickly (say, under 10 seconds)?
pari.nth_prime(1000000000) takes a very long time.