12 lines
271 B
Text
12 lines
271 B
Text
size = 18500
|
|
for n = 1 to size
|
|
m = amicable(n)
|
|
if m > n and amicable(m) = n then print n ; " and " ; m
|
|
next
|
|
|
|
function amicable(nr)
|
|
amicable = 1
|
|
for d = 2 to sqr(nr)
|
|
if nr mod d = 0 then amicable = amicable + d + nr / d
|
|
next
|
|
end function
|