Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/perl
- @a = (2);
- for ($i = 3; $i <= 200000; $i += 2) {
- $simple = 1;
- foreach $a (@a) {
- if ($i % $a == 0) { $simple = 0; break }
- }
- if ($simple) { push(@a, $i) }
- }
- print join(', ', @a);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement