02-04-2013, 05:12 AM
Not sure about the fastest way but you can eliminate more numbers. based on The Sieve_of_Eratosthenes
http://en.wikipedia.org/wiki/Sieve_of_Eratosthenes
http://en.wikipedia.org/wiki/Sieve_of_Eratosthenes
