Provide faster and lazily evaluating solutions to problem 1.