Sieve of Eratosthenes: Difference between revisions
Content deleted Content added
faster variant |
|||
Line 5,706: | Line 5,706: | ||
=={{header|EasyLang}}== |
=={{header|EasyLang}}== |
||
<syntaxhighlight lang="text"> |
<syntaxhighlight lang="text"> |
||
len divisible[] 100 |
|||
max = sqrt len |
max = sqrt len divisible[] |
||
tst = 2 |
|||
for tst = 2 to max |
|||
if |
if divisible[tst] = 0 |
||
i = tst * tst |
i = tst * tst |
||
while i < len |
while i <= len divisible[] |
||
divisible[i] = 1 |
|||
i += tst |
i += tst |
||
. |
. |
||
. |
. |
||
tst += 1 |
|||
. |
. |
||
for i = 2 to len divisible[] |
|||
i = 2 |
|||
⚫ | |||
while i < len prims[] |
|||
⚫ | |||
print i |
print i |
||
. |
. |
||
. |
|||
i += 1 |
|||
</syntaxhighlight> |
|||
=={{header|eC}}== |
=={{header|eC}}== |