Solve #7 with previously written sieve