Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- my @primes = gather {
- my sub prime(Int $n) {
- for @primes -> $d {
- last if $d*$d > $n;
- return 0 if $n%$d==0;
- }
- return 1;
- }
- my Int $next = 1;
- while ++$next {
- take $next if prime($next);
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment