diff options
| author | Mistivia <i@mistivia.com> | 2024-09-16 14:22:20 +0800 |
|---|---|---|
| committer | Mistivia <i@mistivia.com> | 2024-11-09 01:35:19 +0800 |
| commit | ab11ad9a8b6cf46131620a49486e91656b9d913b (patch) | |
| tree | 7fd5c51fc3dba7c47b06f0e3cf74bb1f4725fcf9 /0001 | |
1 Multiples of 3 or 5
Diffstat (limited to '0001')
| -rw-r--r-- | 0001/main.lisp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/0001/main.lisp b/0001/main.lisp new file mode 100644 index 0000000..c7ba165 --- /dev/null +++ b/0001/main.lisp @@ -0,0 +1,13 @@ +(defun genlist (n) + (defun impl (x lst) + (if (> x n) + (reverse lst) + (impl (+ 1 x) (cons x lst)))) + (impl 1 '())) + +(let ((sum 0)) + (loop for x in (genlist 999) + do (if (or (equal 0 (mod x 3)) + (equal 0 (mod x 5))) + (setf sum (+ sum x)))) + (print sum)) |
