euler/lisp/euler005.lisp

10 lines
235 B
Common Lisp
Raw Normal View History

2016-10-22 19:36:28 +00:00
(load "euler.lisp")
(defun is-evenly-divisible-by-all-up-to (n int)
(eq 0 (sum (mapcar (partial #'mod n) (range 2 int))))
)
(defun solution ()
(loop for i from 2 by 2 when (is-evenly-divisible-by-all-up-to i 20) do (return i))
)