Abundant, deficient and perfect number classifications: Difference between revisions

m
→‎{{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}}==
===CountingSumming the factors using modulo/division===
<syntaxhighlight lang="lua">function sumDivs (n)
if n < 2 then return 0 end
Line 3,233:
Perfect: 4</pre>
 
===CountingSumming the factors using a table===
{{Trans|ALGOL 68}}
<syntaxhighlight lang="lua">
3,032

edits