Guest User

Perl

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