application/octet-stream
•
546 B
•
22 lines
#!/usr/bin/env nujel
; Multiples of 3 or 5
; https://projecteuler.net/problem=1
;
; Find the sum of all the multiples of 3 or 5 below 1000.
(defn multiple-of-3? (α)
(zero? (rem α 3)))
(defn multiple-of-5? (α)
(zero? (rem α 5)))
(defn multiple-of-3-or-5? (α)
(or (multiple-of-3? α)
(multiple-of-5? α)))
(def result (-> (range 1000)
(filter multiple-of-3-or-5?)
(sum)))
(when (not= result 233168)
(throw (list :wrong-result "Wrong result" result)))
(return :success)