Sieve of Atkin & Bernstein.