Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,2 @@
(DEFUN FIBONACCI (N)
(FLOOR (+ (/ (EXPT (/ (+ (SQRT 5) 1) 2) N) (SQRT 5)) 0.5)))

View file

@ -0,0 +1,5 @@
(DEFUN RANGE (X Y)
(IF (<= X Y)
(CONS X (RANGE (+ X 1) Y))))
(PRINT (MAPCAR FIBONACCI (RANGE 1 50)))

View file

@ -0,0 +1,8 @@
(defun fibonacci (x)
(defun fib (a b n)
(if (= n 2)
b
(fib b (+ a b) (- n 1)) ) )
(if (< x 2)
x
(fib 1 1 x) ) )