Erdős-Nicolas numbers: Difference between revisions

(added Arturo)
Line 705:
714240 == sum of its first 113 divisors
1571328 == sum of its first 115 divisors</pre>
 
=={{header|Ring}}==
<syntaxhighlight lang="ring">
see "works..." + nl
erdos = []
limit = 1600000
for n = 1 to limit
num = 0
sum = 0
erdos = []
for m = 1 to n/2
if n%m = 0
add(erdos,m)
ok
next
lenErdos = len(erdos)
for p = 1 to lenErdos
sum = sum + erdos[p]
if sum = n and p < lenErdos
num++
see "" + n + " equals the sum of its first " + p + " divisors" + nl
exit
ok
next
if num = 8
exit
ok
next
see "done..." + nl
</syntaxhighlight>
 
{{out}}
<pre>
24 equals the sum of its first 6 divisors
2016 equals the sum of its first 31 divisors
8190 equals the sum of its first 43 divisors
42336 equals the sum of its first 66 divisors
45864 equals the sum of its first 66 divisors
714240 equals the sum of its first 113 divisors
392448 equals the sum of its first 68 divisors
1571328 equals the sum of its first 115 divisors
</pre>
 
=={{header|Wren}}==
2,468

edits