Solve problem 10 with seive