Project Euler work (potential spoiler alert!)