Last active
December 15, 2015 21:39
-
-
Save bitdewy/5327062 to your computer and use it in GitHub Desktop.
Project Euler #1 in Common Lisp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;;; | |
;;;; 1.lisp | |
;;;; ProjectEuler | |
;;;; | |
;;;; Created by bitdewy on 4/7/13. | |
;;;; Copyright (c) 2013 bitdewy. All rights reserved. | |
;;;; | |
;; Project Euler #1 | |
(defun sum_of_values_multiples (max values) | |
"evaluate sum of values multiples less than max" | |
(do ((sum 0) (i 1 (1+ i))) | |
((eq i max) sum) | |
(dolist (v values) | |
(if (and (zerop (mod i v)) (incf sum i)) | |
(return))))) | |
(sum_of_values_multiples 1000 '(3 5)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment