I just started playing around with Common Lisp and tried the first euler problem which states to sum all the divisors of 3 OR 5 under some given parameter x. I would like to use a recursive solution but I can figure out why this won't work
(defun my-sum (x)
(if (< x 1)
0
(if (or (equal (div-3 x) 0) (equal (div-5 x) 0))
(+ x (my-sum (- x 1)))
(my-sum (- x 1)))))
div-3anddiv-5do what you want? Please add their definitions so we can run the code.(my-sum 9) => 23x. So for the example at projecteuler.net for numbers under 10, you should call(my-sum 9). If you call(my-sum 10)you'll get 33 because 10 is a multiple of 5.