Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Timking's original elegant attempt at finding primes.
sub primes-any (Int $max) {
my Int @primes;
@primes.push($_) unless $_ %% any(@primes) for 2 .. $max;
return @primes;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment