Jump to content

Anti-primes: Difference between revisions

m
→‎{{header|Perl 6}}: Concurrency not really necessary, and causing races under load.
m (→‎{{header|Perl 6}}: Concurrency not really necessary, and causing races under load.)
Line 875:
}
 
my atomicint $last = 0;
 
my @anti-primes = lazy 1, |(|(2..59), 60, *+60 … *).hyper.grep: -> $c {
my \mx = +propdiv($c);
next if mx <= atomic-fetch($last);
atomic-assign($last, = mx);
$c
}
10,343

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.