my $MAX=100; my(@comp,@prime); for my $i (2..$MAX) { next if $comp[$i]; $comp[$i*$_]++ for 1..$MAX/$i; push @prime, $i; }