;; Common Lisp version
;; Manoel Vilela


(defun div (x d)
  (= (mod x d) 0))

(defun special-sum (n)
  (reduce '+ (loop for x from 1 to n when (or (div x 5) (div x 3)) collect x)))

(format t "~d" (special-sum 1000))

;; Common Lisp version
;; Manoel Vilela


(defun div (x d)
  (= (mod x d) 0))

(defun special-sum (n)
  (reduce '+ (loop for x from 1 to n when (or (div x 5) (div x 3)) collect x)))

(format t "~d" (special-sum 999))

Fix a little error on CommonLisp solution at P001
Fix a little error on CommonLisp solution at P001

The loop-for macro using ~from-to~ had a interval closed [a, b]
differs common range functions like Python and Clojure, whose
the range is [a, b).

DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler