Let P be the 30th prime number greater than 300. What is P ?
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
The answer is 479 .
One solution is to iterate through the integers starting at 300, checking if each one is prime. Keep a counter of how many primes have been encountered. Once the counter reaches 30, you have reached the answer.
There are many ways to determine if a number n is prime. The below solution uses the sieve of Eratosthenes as its approach.