Quad-power prime seeds: Difference between revisions

m
→‎{{header|Raku}}: extend out to 10 million
(→‎{{header|ALGOL 68}}: should have mentioned the primes library...)
m (→‎{{header|Raku}}: extend out to 10 million)
Line 203:
<lang perl6>use Lingua::EN::Numbers;
 
my @qpps = lazy (1..*).hyper(:2000batch5000batch).grep: -> \n { my \k = n + 1; (n+k).is-prime && (n²+k).is-prime && (n³+k).is-prime && (n⁴+k).is-prime }
 
say "First fifty quad-power prime seeds:\n" ~ @qpps[^50].batch(10)».&comma».fmt("%7s").join: "\n";
Line 209:
say "\nFirst quad-power prime seed greater than:";
 
for 1..510 {
my $threshold = Int(1e6 *× $_);
my $key = @qpps.first: * > $threshold, :k;
say "{$threshold.&cardinal.fmt: '%13s'} is the {ordinal-digit $key + 1}: {@qpps[$key].&comma}";
Line 227:
three million is the 319th: 3,005,316
four million is the 383rd: 4,004,726
five million is the 452nd: 5,023,880</pre>
six million is the 514th: 6,000,554
seven million is the 567th: 7,047,129
eight million is the 601st: 8,005,710
nine million is the 645th: 9,055,151
ten million is the 701st: 10,023,600</pre>
 
=={{header|Wren}}==
10,333

edits