7 lines
142 B
Text
7 lines
142 B
Text
function is_perfect(integer n)
|
|
return sum(factors(n,-1))=n
|
|
end function
|
|
|
|
for i=2 to 100000 do
|
|
if is_perfect(i) then ?i end if
|
|
end for
|