Skip to content

Instantly share code, notes, and snippets.

@TheTomster
Created September 3, 2013 16:16
Show Gist options
  • Save TheTomster/6426047 to your computer and use it in GitHub Desktop.
Save TheTomster/6426047 to your computer and use it in GitHub Desktop.
; Euler 1
(defun divides (x y)
(zerop (mod y x)))
(defun sum (l)
(reduce #'+ l))
(defun range (a b)
(loop for i from a to b collecting i))
(defun e1 ()
(sum (remove-if (lambda (n) (not (or (divides 3 n)
(divides 5 n))))
(range 1 999))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment