in reply to Re: Prime list
in thread Prime list
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: <%-(-(-(-<
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Prime list
by LanX (Saint) on Feb 08, 2015 at 22:49 UTC | |
by AnomalousMonk (Archbishop) on Feb 08, 2015 at 23:05 UTC | |
|
Re^3: Prime list
by QM (Parson) on Feb 09, 2015 at 11:04 UTC |