Skip to content

Instantly share code, notes, and snippets.

@speedcell4
Last active August 29, 2015 14:07
Show Gist options
  • Save speedcell4/8911d850b33800e646c7 to your computer and use it in GitHub Desktop.
Save speedcell4/8911d850b33800e646c7 to your computer and use it in GitHub Desktop.
(def prime-seq
((fn prime [seq]
(lazy-cat [(first seq)] (prime (filter #(not= 0 (rem % (first seq))) (rest seq)))))
(iterate inc 2)))
(take 10 prime-seq)
;; (2 3 5 7 11 13 17 19 23 29)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment