Abundant, deficient and perfect number classifications: Difference between revisions

m (→‎{{header|PicoLisp}}: add comment)
Line 877:
Key )
(de factor-sum (N)
(letif (=1 N)
(R NIL0
D 2(let
L (1 2 2 . (4 2 4 2 4 6 2 6R .))NIL
M (sqrt N) D 2
N1 N L (1 2 2 . (4 2 4 2 4 6 2 6 .))
S 1 M (sqrt N)
(while (>= M D) N1 N
(if (=0 (% N1S 1 D))
(while (setq>= M D)
(sqrtif (setq N1=0 (/% N1 (accud 'R D)))) )
(inc 'D (pop 'L)) )setq )M
(sqrt (setq N1 (/ N1 (accud 'R N1D)))) )
(if # my dirty hack against N = 1 (inc 'D (pop 'L)) ) )
(andaccud 'R N1)
(not (cdr R))
(= 1 (caar R)) )
0
(for I R
(one D)
298

edits