Skip to content

Commit

Permalink
pulling out a candidate
Browse files Browse the repository at this point in the history
  • Loading branch information
adammartin committed Mar 4, 2012
1 parent 05bb989 commit 91ffe88
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/primefactors/core.clj
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
(ns primefactors.core)

(defn primefactors [n]
(cond (<= n 1) (list)
(= 0 (rem n 2)) (conj (primefactors (/ n 2)) 2)
:else (list n)
(defn primefactors
([n] (primefactors n 2))
([n candidate]
(cond (<= n 1) (list)
(= 0 (rem n 2)) (conj (primefactors (/ n 2)) 2)
:else (list n)
)
)
)

0 comments on commit 91ffe88

Please sign in to comment.