Skip to content

Instantly share code, notes, and snippets.

@pietromenna
Last active August 29, 2015 14:18
Show Gist options
  • Save pietromenna/39439f00e9e071f409bb to your computer and use it in GitHub Desktop.
Save pietromenna/39439f00e9e071f409bb to your computer and use it in GitHub Desktop.
Fibonacci in Clojure
(fn [x] (map
(fn fb [n] (if (= n 0)
0
(if (= n 1) 1 (+ (fb (- n 1)) (fb (- n 2)))))) (range 1 (inc x))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment