re: Project Euler #5 - Finding the Smallest Multiple VIEW POST

FULL DISCUSSION
 

Clojure

(defn euler-5 [x]
  (let [gcd (fn [x y] (if (zero? y) x (recur y (mod x y))))
        lcm (fn [x y] (/ (* x y) (gcd x y)))]
    (reduce lcm (range 1 (inc x)))))
code of conduct - report abuse