sieve of erastothenes

Run Settings
LanguageRaku
Language Version
Run Command
sub prime-sieve($n) { my @sieve = False, False, |(True for 2..$n); for 2..sqrt($n) -> $i { if @sieve[$i] { loop (my $j = $i**2; $j <= $n; $j += $i) { @sieve[$j] = False; } } } (for @sieve.kv -> $i, $is-prime { $i if $is-prime; }); } say prime-sieve(100);
Editor Settings
Theme
Key bindings
Full width
Lines