OK, with a coding improvement 

(defn factors-sqrt [n]
(filter #(= 0 (mod n %)) (range 1 (+ 1 (Math/sqrt n )))))

(defn num-of-factors [n] (* 2 (count (factors-sqrt n))))

it works for 499. (Idea being factors come in pairs, each factor >
sqrt(x) corresponds to one > sqrt(x))


Was it just running infinitely slow in Clojure relative to Java before??

John

Attachment: pgpNcI629uGa4.pgp
Description: PGP signature

Reply via email to