Project Euler challenge #54