And, of course, the classic regex approach:
c:\@Work\Perl\monks>perl -wMstrict -le "my @primes; ;; for (my $i = 2; @primes < 10; ++$i) { push @primes, $i if ('x' x $i) !~ m{ \A (..+) \1+ \z }xms; } ;; print qq{@primes}; " 2 3 5 7 11 13 17 19 23 29
Give a man a fish: <%-(-(-(-<
In reply to Re^2: Prime list
by AnomalousMonk
in thread Prime list
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |