RosettaCodeData/Task/Perfect-numbers/Common-Lisp/perfect-numbers.lisp
2023-07-01 13:44:08 -04:00

2 lines
84 B
Common Lisp

(defun perfectp (n)
(= n (loop for i from 1 below n when (= 0 (mod n i)) sum i)))