Skip to content

Instantly share code, notes, and snippets.

@niksudan
Last active January 7, 2016 20:11
Show Gist options
  • Select an option

  • Save niksudan/6460fca8656d2a157593 to your computer and use it in GitHub Desktop.

Select an option

Save niksudan/6460fca8656d2a157593 to your computer and use it in GitHub Desktop.
Prime number checker [Clojure]
(defn prime? [n]
(loop [i 2]
(if (< i n)
(if (not (integer? (/ n i)))
(recur (+ i 1))
false
)
true
)
)
)
@niksudan

niksudan commented Jan 7, 2016

Copy link
Copy Markdown
Author

Obviously not the most efficient, but it's what I could come up with first that worked

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment