use strict; my $max = 100; # obergrenze bis wohin wir berechnen my @sieb = $max; # sieb des erestothenes for my $i (2..($max/2)){ next if $sieb[$i]; $sieb[$i*$_] = 1 for 2..int $max/$i; } # ausgabe for my $i (2..$max) { print "$i " unless $sieb[$i] }