Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
10
Task/Prime-decomposition/LFE/prime-decomposition.lfe
Normal file
10
Task/Prime-decomposition/LFE/prime-decomposition.lfe
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
(defun factors (n)
|
||||
(factors n 2 '()))
|
||||
|
||||
(defun factors
|
||||
((1 _ acc)
|
||||
acc)
|
||||
((n k acc) (when (== 0 (rem n k)))
|
||||
(factors (div n k) k (cons k acc)))
|
||||
((n k acc)
|
||||
(factors n (+ k 1) acc)))
|
||||
Loading…
Add table
Add a link
Reference in a new issue