Jump to content

Perfect numbers: Difference between revisions

m
imported>Arakov
Line 1,556:
 
=={{header|EasyLang}}==
<syntaxhighlight lang=easylang>
funcfastfunc perf n .
for i = 1 to n - 1
while i < n
if n mod i = 0
sum += i
.
i += 1
.
return if sum = n
return 1
.
return 0
.
for i = 2 to 10000
if perf i = 1
printwrite i & " "
.
.
</syntaxhighlight>
{{out}}
<pre>
6 28 496 8128
</pre>
 
=={{header|Eiffel}}==
2,069

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.