Proper divisors: Difference between revisions

m
Line 2,245:
=={{header|EasyLang}}==
<syntaxhighlight>
procfunc[] propdivs n . divs[] .
divs[] = [ ]
if n < 2
return [ ]
.
divs[] &= 1
Line 2,260 ⟶ 2,259:
.
.
return divs[] = [ ]
.
for i to 10
print i & ":" & propdivs i
propdivs i d[]
write i & ":"
print d[]
.
for i to 20000
d[] = propdivs i
propdivs i d[]
if len d[] > max
max = len d[]
Line 2,275 ⟶ 2,273:
print maxi & " has " & max & " proper divisors."
</syntaxhighlight>
{{out}}
<pre>
1:[ ]
2:[ 1 ]
3:[ 1 ]
4:[ 1 2 ]
5:[ 1 ]
6:[ 1 2 3 ]
7:[ 1 ]
8:[ 1 2 4 ]
9:[ 1 3 ]
10:[ 1 2 5 ]
15120 has 79 proper divisors.
</pre>
 
=={{header|EchoLisp}}==
2,069

edits