Skip to content

Instantly share code, notes, and snippets.

@yedi
Created July 14, 2012 10:44
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 yedi/3110511 to your computer and use it in GitHub Desktop.
Save yedi/3110511 to your computer and use it in GitHub Desktop.
(ns clojeuler.q1)
(defn sum-if-divisible [num1 num2]
(if (or (== (mod num2 3) 0) (== (mod num2 5) 0))
(+ num1 num2)
num1))
(println (reduce sum-if-divisible (range 1 1000)))
(println (reduce + (range 1 1000)))
---Output---
user>
233169^M
499500^M
How do I make it print out the actual number?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment