diff --git a/fibonacci-goldener-schnitt.rkt b/fibonacci-goldener-schnitt.rkt new file mode 100644 index 0000000..553b780 --- /dev/null +++ b/fibonacci-goldener-schnitt.rkt @@ -0,0 +1,15 @@ +;; The first three lines of this file were inserted by DrRacket. They record metadata +;; about the language level of this file in a form that our tools can easily process. +#reader(lib "htdp-advanced-reader.ss" "lang")((modname fibonacci-goldener-schnitt) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor repeating-decimal #t #t none #f () #f))) +(define (fib n) (cond + [(= n 0) 1] + [(= n 1) 1] + [else (+ (fib (- n 1)) (fib (- n 2)))] + )) + +(define (make-numbers n) (cond + [(= n 0) (list 0)] + [else (append (make-numbers (- n 1)) (list n))] + )) + +(define (x n) (map (lambda (x) (/ (fib (+ x 1)) (fib x))) (make-numbers n))) \ No newline at end of file