Skip to content

Instantly share code, notes, and snippets.

@canweriotnow
Created November 4, 2011 19:41
Show Gist options
  • Save canweriotnow/1340293 to your computer and use it in GitHub Desktop.
Save canweriotnow/1340293 to your computer and use it in GitHub Desktop.
Finding Fibonacci w/ anonymous function in Clojure
;; solution to Fibonacci Sequence
;; https://4clojure.com/problem/26
(fn [n] (take n (map first (iterate (fn [[a b]] (vector b (+ a b))) [1 1])))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment