15 lines
No EOL
789 B
Racket
15 lines
No EOL
789 B
Racket
;; 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))) |