sub Eratosthenes_Sieve($){ for(@a=(1)x($_[0]+1),$p=2; $p**2<=$_[0];){for($j=2*$p ;$j<=$_[0];$j+=$p){$a[$j]= 0}for($a[++$p]){}}grep {$a [$_]}(2..$#a)}
Ira,
"So... What do all these little arrows mean?"
~unknown
In reply to Re: Eratosthenes Sieve
by IraTarball
in thread Eratosthenes Sieve
by frankus
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |