sub f{ $x="\xff"x$_[0];for(2..$_[0]){$n=$_;vec($x,$n,1)=0 while($n+=$_)<$_[0];} } f( $ARGV[0]); vec$x,$_,1 and print $_ for 1..$ARGV[0];