Project Euler Problem 7: Solution using generators!