Solve Euler 050