Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use strict;
- my @a = (2);
- my ($simple, $a);
- for (my $i = 3; $i <= 200000; $i += 2) {
- $simple = 1;
- foreach $a (@a) {
- if ($i % $a == 0) { $simple = 0; last; }
- }
- if ($simple) { push(@a, $i) }
- }
- $, = ', ';
- print @a;
RAW Paste Data