Solved problem 46, used a lot of stuff from problem 50, including the Atkin's Sieve