;; If we list all the natural numbers below 10 that
;; are multiples of 3 or 5, we get 3, 5, 6 and 9.
;; The sum of these multiples is 23.
;; Find the sum of all the multiples of 3 or 5 below 1000.
(defn multiple-of-3-or-5?
[n]
(if (or (zero? (rem n 3))
(zero? (rem n 5)))
n
0))
(defn euler-1-v0 [n]
"Sum of all the multiples of 3 and 5 below n"
(reduce + (map multiple-of-3-or-5? (range 0 n))))
(defn euler-1-v1 [n]
"Sum of all the multiples of 3 and 5 below n"
(reduce + (filter #(or (zero? (rem % 3))
(zero? (rem % 5))) (range 0 1000))))