Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (defn three-or-five [num]
- (if (== (mod num 5) 0)
- 5
- (if (== (mod num 3) 0)
- 3
- 0)))
- (defn produce-list [range]
- (loop [current 0, total 0]
- (if (== current range)
- total
- (recur (+ current 1) (+ total (three-or-five current))))))
- (def num-total (produce-list 1000))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement