Calculates the upper bound of the integer range containing the nth prime.
Useful for knowing how large of a sieve to prepare if you want to collect a certain number of prime numbers, for example.
assert(nthPrimeUpperBound(4) == 11); assert(nthPrimeUpperBound(7) == 18); assert(nthPrimeUpperBound(50) == 263);
See Implementation
Calculates the upper bound of the integer range containing the nth prime.
Useful for knowing how large of a sieve to prepare if you want to collect a certain number of prime numbers, for example.