reworked with numpy and Sieve of Eratosthenes