Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
(defn get-prime-factors [n-arg]
;(def n n-arg)
(def prime-factors (list))
(loop [p 2 n n-arg :while (> n 1)]
(println (str "p=" p " n=" n))
;(while (> n 1)
(println n)
(println (class n))
(if (= 0 (mod n p))
(
(println prime-factors)
(def prime-factors (merge prime-factors p))
(println prime-factors)
(def n (/ n p))
(println (str "n=" n))
)
(
(println "not multiple")
(def p (+ 1 p))
)
;)
)
)
prime-factors)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.