solution to euler2.