Created
July 14, 2012 10:44
-
-
Save yedi/3110511 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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