http://www.perlmonks.org?node_id=146582


in reply to Prime Number Finder

I had made the post above ragrading half the iterations, but I just thought of a better way to calculate primes. Its not as fast, but its a one liner: while($num <= $max) { push @dynamic, $num if (1 x $num) !~ /^(11+)\1+$/; $num ++; } I hope you find this helpful