Question 149460
Look on Google for methods. The Sieve of Erastothenes is the most common.