Skip to content

Commit

Permalink
Merge pull request #2 from limbo-lab/patch-1
Browse files Browse the repository at this point in the history
not that way clojure should be used.
  • Loading branch information
Liutos committed Dec 31, 2013
2 parents 2ea97a8 + ea605c9 commit 9c344ec
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions clojure/pro1.clj
@@ -1,10 +1,2 @@
(defn rec [n sum num]
(if (>= n num)
sum
(if (or (= 0 (mod n 3))
(= 0 (mod n 5)))
(rec (+ n 1) (+ sum n) num)
(rec (+ n 1) sum num))))

(defn pro1 [num]
(rec 1 0 num))
(defn p1 [n]
(apply + (filter #(or (= 0 (mod % 3)) (= 0 (mod % 5))) (range 1 n))))

0 comments on commit 9c344ec

Please sign in to comment.