Solve Euler 049