Minilisp.pm/examples/euler1.lisp

5 lines
198 B
Common Lisp
Raw Normal View History

(defun range (start end)
(do ((lst (list) (cons i lst)) (i start (+ 1 i))) ((= i end) lst)))
2021-04-05 04:04:23 +02:00
(write-line (reduce + (filter (lambda (x) (or (zerop (mod x 3)) (zerop (mod x 5)))) (range 1 1000))))