Solve SICP exercise 1.34