I’ve started learning Clojure a few days ago and I wrote this code that factorises numbers. How do I make it better? Is there any way to avoid doing it with a loop? Is that how I am supposed to code in Clojure?
(defn classify (n) (loop (n n i 2 f ()) (cond (= n i) (conj f i) (= (mod n i) 0) (recur (/ n i) 2 (conj f i)) :else (recur n (inc i) f))))