Find all the primes to 200. Straightforward sieve implementation. Lacking some elegance, but when I attempted to use :by(2)
it didn't work for me.
my @nonprime;
say 2; for 3..200 -> $x, $y { unless (@nonprime.exists($x)) { say $x; my $i; loop ($i = $x; $i < 200; $i += 2 * $x) { @nonprime[$i] = 1; } } }