Skip to content

Instantly share code, notes, and snippets.

@thattommyhall
Created January 28, 2013 20:01
Show Gist options
  • Save thattommyhall/4658530 to your computer and use it in GitHub Desktop.
Save thattommyhall/4658530 to your computer and use it in GitHub Desktop.
(def fibs
(map first (iterate (fn [[a b]] [b (+ a b)]) [1 1])))
(defn fibs-from [n]
(drop-while #(< % n) fibs))
(take 5 fibs)
; (1 1 2 3 5)
(take 5 (fibs-from 1000000000000))
; (1548008755920 2504730781961 4052739537881 6557470319842 10610209857723)
(zipmap (range) (take 5 fibs))
; {4 5, 3 3, 2 2, 1 1, 0 1}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment