Does anyone knows how exactly Prime works ?
For example how Prime[1000000000] is calculated ?
The only information I found was some inequalities in Wolfram's Function site.
Thank you.
Does anyone knows how exactly Prime works ?
For example how Prime[1000000000] is calculated ?
The only information I found was some inequalities in Wolfram's Function site.
Thank you.
PrimeandPrimePiuse sparse caching and sieving. For large n, the Lagarias-Miller-Odlyzko algorithm forPrimePiis used, based on asymptotic estimates of the density of primes, and is inverted to givePrime." – Mr.Wizard Dec 17 '13 at 12:06PrimePiworks. ThenPrimecould be implemented e.g. this way:prime[z_Integer] /; z >= 1 := x /. First @ Solve[PrimePi[x] == z && PrimePi[x - 1] == z - 1, x, Integers]– Artes Dec 17 '13 at 12:31