solution to euler 182