solution to euler #7