solution to euler 57.