Solve SICP exercise 1.35