1.3|

$ cd ~

SICP Exercise 1.30

The sum procedure is given as:

(define (sum term a next b)
  (if (> ab)
      0
      (+ (term a)
         (sum term (next a) next b))))

It can be changed to act iteratively as:

(define (sum term a next b)
  (define (iter a result)
    (if (> a b)
        result
        (iter (next a) (+ result (term a)))))
  (iter a 0))