Advertisement
Guest User

Untitled

a guest
Dec 26th, 2011
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (defn three-or-five [num]
  2.   (if (== (mod num 5) 0)
  3.     num
  4.     (if (== (mod num 3) 0)
  5.       num
  6.       0)))
  7.  
  8. (defn produce-list [range]
  9.   (loop [total 0
  10.          current 0]
  11.     (do
  12.       (if (== current range)
  13.         total
  14.         (recur (+ total (three-or-five current))
  15.                  (+ current 1))))))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement