What would be a more correct functional way to write the following code which checks if a number is prime or not:
(defn prime? [n]
(loop [k 2]
(cond
(< k n) (if (not= 0 (mod n k))
(recur (inc k))
(println n "is not prim"))
:else (println n "is prim"))))