Abundant, deficient and perfect number classifications: Difference between revisions
Abundant, deficient and perfect number classifications (view source)
Revision as of 16:16, 8 July 2023
, 10 months ago→{{header|Lua}}: The factors are summed not counted - doh!
(→{{header|Wren}}: Added alternative version using a table of divisor sums) |
m (→{{header|Lua}}: The factors are summed not counted - doh!) |
||
Line 3,205:
=={{header|Lua}}==
===
<syntaxhighlight lang="lua">function sumDivs (n)
if n < 2 then return 0 end
Line 3,233:
Perfect: 4</pre>
===
{{Trans|ALGOL 68}}
<syntaxhighlight lang="lua">
|