Skip to content

Instantly share code, notes, and snippets.

@jrabbit
Created October 2, 2011 18:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jrabbit/1257722 to your computer and use it in GitHub Desktop.
Save jrabbit/1257722 to your computer and use it in GitHub Desktop.
(defn factors [n]
"Prints out all factors"
(filter integer?
(map #(/ n %)
(range 1 (inc n)))))
(defn prime? [n]
(= (count (factors n)) 2))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment