Some quick implementation.
It happens to be pretty slow
Way better version.

With a correct Sieve in an array instead of a list