Proper divisors: Difference between revisions
m
→{{header|EasyLang}}
Langurmonkey (talk | contribs) |
|||
Line 2,245:
=={{header|EasyLang}}==
<syntaxhighlight>
divs[] = [ ]▼
if n < 2
return [ ]
.
divs[] &= 1
Line 2,260 ⟶ 2,259:
.
.
.
for i to 10
print i & ":" & propdivs i
.
for i to 20000
d[] = propdivs i
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}}==
|