First version incomplete
Different approach
Sieve of Atkin for prime numbers