Project Euler Problem 18