Skip to content

Instantly share code, notes, and snippets.

@knjname
Created December 10, 2013 18:01
Show Gist options
  • Select an option

  • Save knjname/7895111 to your computer and use it in GitHub Desktop.

Select an option

Save knjname/7895111 to your computer and use it in GitHub Desktop.
(defun dividable (n m)
(= (mod n m) 0))
(dividable 6 3) ; => t
(dividable 6 4) ; => nil
(defun euler-1 (begin end)
(loop for i from begin to (1- end)
sum (if (or (dividable i 3) (dividable i 5))
i
0)))
(euler-1 0 10) ; => 23
(euler-1 0 1000) ; => 233168
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment