Anonymous user
Sieve of Eratosthenes: Difference between revisions
→{{header|Julia}}: More concise findall + boolean array based implementation
imported>Tecosaur (→{{header|Julia}}: More concise findall + boolean array based implementation) |
|||
Line 10,560:
Alternate version using <code>findall</code> to get all primes at once in the end
<syntaxhighlight lang="julia">function sieve(n
for p in 2:n
primes[p .* (2:n÷p)]
end
findall(primes)
end</syntaxhighlight>
|