Primes with digits in nondecreasing order: Difference between revisions

(Add Seed7)
Line 648:
<lang perl>#!/usr/bin/perl
 
use strict;
use strict; # https://rosettacode.org/wiki/Primes_with_digits_in_nondecreasing_order
use warnings;
use ntheory qw( primes );
 
my @want = grep ! /(.)(.)(??{$1 > $2 ? '' : '(*FAIL)'})/, and@{ primes(1 x $_1000) !~ /^(11+)\1+$/};
my @primes = grep {
print "@primes\nwant" =~ s/.{50}\K /\n/gr, . "\n\ncount: " . @primes,want . "\n";</lang>
! /(.)(.)(??{$1 > $2 ? '' : '(*FAIL)'})/ and (1 x $_) !~ /^(11+)\1+$/
} 2 .. 999;
print "@primes\n" =~ s/.{50}\K /\n/gr, "\ncount: " . @primes, "\n";</lang>
{{out}}
<pre>
Anonymous user