Aliquot sequence classifications: Difference between revisions
m
→{{header|AppleScript}}: Minor improvements to handlers.
m (→{{header|Phix}}: class -> classification (for better syntax colouring more than anything else)) |
m (→{{header|AppleScript}}: Minor improvements to handlers.) |
||
Line 171:
<lang applescript>on aliquotSum(n)
repeat with i
if (n mod i is 0) then set sum to sum +
▲ if (n mod i is 0) then set sum to sum + i + n div i
▲ end repeat
return sum
Line 201 ⟶ 197:
if (sequenceLength is 1) then
set classification to "perfect"
else if (
set classification to "terminating"
else if (n = k) then
|