Guest User

Untitled

a guest
Jun 23rd, 2011
1,308
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/usr/bin/perl
  2.  
  3. @a = (2);
  4.  
  5. for ($i = 3; $i <= 200000; $i += 2) {
  6.     $simple = 1;
  7.     foreach $a (@a) {
  8.         if ($i % $a == 0) { $simple = 0; break }
  9.     }
  10.     if ($simple) { push(@a, $i) }
  11. }
  12.  
  13. print join(', ', @a);
RAW Paste Data