solution to euler 56.