Abundant, deficient and perfect number classifications: Difference between revisions

Content added Content deleted
Line 441: Line 441:
The sign of the difference is negative for the abundant case - where the sum is greater than the number. And we rely on order being preserved in sequences (this happens to be a fundamental property of computer memory, also).
The sign of the difference is negative for the abundant case - where the sum is greater than the number. And we rely on order being preserved in sequences (this happens to be a fundamental property of computer memory, also).


=={{header|Javascript}}==
=={{header|JavaScript}}==
<lang Javascript>for (var dpa=[1,0,0], n=2; n<=20000; n+=1) {
<lang Javascript>for (var dpa=[1,0,0], n=2; n<=20000; n+=1) {
for (var ds=0, d=1, e=n/2+1; d<e; d+=1) if (n%d==0) ds+=d
for (var ds=0, d=1, e=n/2+1; d<e; d+=1) if (n%d==0) ds+=d