(define (fibcalc1 x)
( if ( = x 1 )
(cons 1 ())
( if ( = x 2 ) (list 1 1)
( let ((temp ( fibcalc1( - x 1 )) ))
( cons ( + ( car temp) (cadr temp)) temp ))
)))
(define (fibcalc2 x)
( if ( = x 1 )
(cons 1 ())
( if ( = x 2 )
(cons 1 1)
( let ((temp ( fibcalc2( - x 1 )) ))
( cons ( + ( car temp) (cdr temp)) ( car temp))
))))
(define (fibcalc3 x)
( if ( = x 1 )
(list 1 )
( if ( = x 2 )
(list 1 1)
( let ((temp ( fibcalc3( - x 1 )) ))
( list ( + ( car temp) (cadr temp)) ( car temp))
))))(define (fib x)
(define (fibseries x)
(cond
((= x 1) '(1))
((= x 2) '(1 1))
(else (let ((temp (fibseries (- x 1)))) (cons (+ (car temp) (cadr temp)) temp)))))
(if (or (not (integer? x)) (< x 1))
(error "fib: argument must be a positive integer, given" x)
(car (fibseries x))))
(define (fibcalc1 x)
(cond ((= x 1) (cons 1 '()))
((= x 2) (list 1 1))
(else
(let ((temp (fibcalc1 (- x 1))))
(cons (+ (car temp) (cadr temp)) temp)))))
(define (fibcalc2 x)
(cond ((= x 1) (cons 1 '()))
((= x 2) (cons 1 1))
(else
(let ((temp (fibcalc2 (- x 1))))
(cons (+ (car temp) (cdr temp)) (car temp))))))
(define (fibcalc3 x)
(cond ((= x 1) (list 1))
((= x 2) (list 1 1))
(else
(let ((temp (fibcalc3 (- x 1))))
(list (+ (car temp) (cadr temp)) (car temp))))))