1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
(define (sumsquare a b) (if (> a b) 0 (+ (* a a) (sumsquare (+ a 1) b)) )) (define (sumcube a b) (if (> a b) 0 (+ (* a a a) (sumcube (+ a 1) b)) )) (define (sum fn a b) (if (> a b) 0 (+ (fn a) (sum fn (+ a 1) b)))) (define (square x) (* x x)) (define (cube x) (* x x x))