solution to euler 004