Skip to content

Instantly share code, notes, and snippets.

@Eskatrem
Created August 14, 2011 18:55
Show Gist options
  • Save Eskatrem/1145173 to your computer and use it in GitHub Desktop.
Save Eskatrem/1145173 to your computer and use it in GitHub Desktop.
(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