Abundant, deficient and perfect number classifications: Difference between revisions

Added 11l
(Tidied up Go entry and moved it into correct alphabetical order.)
(Added 11l)
Line 25:
*   [[Amicable pairs]]
 
 
=={{header|11l}}==
{{trans|Kotlin}}
<lang 11l>F sum_proper_divisors(n)
R I n < 2 {0} E sum((1 .. n I/ 2).filter(it -> (@n % it) == 0))
 
A deficient = 0
A perfect = 0
A abundant = 0
 
L(n) 1..20000
A sp = sum_proper_divisors(n)
I sp < n
deficient++
E I sp == n
perfect++
E I sp > n
abundant++
 
print(‘Deficient = ’deficient)
print(‘Perfect = ’perfect)
print(‘Abundant = ’abundant)</lang>
 
=={{header|360 Assembly}}==
1,481

edits