Friday, October 8, 2010

Abundant numbers

Rem Abundant numbers are smaller than the sum of their factors
for n = 5 to 100000
sum = 0
for factor = 1 to int(n/2)
if n/factor = int(n/factor) then sum = sum + factor
next factor
if sum > n then print n
next n

No comments:

Post a Comment