Strong and weak primes: Difference between revisions
m
→{{header|Perl 6}}: add some commas
Thundergnat (talk | contribs) (→{{header|Perl 6}}: Add a Perl 6 example) |
Thundergnat (talk | contribs) m (→{{header|Perl 6}}: add some commas) |
||
Line 355:
for @strong, 'strong', 36, 1e6, 1e7,
@weak, 'weak', 37, 1e6, 1e7,
@balanced, 'balanced',
-> @pr, $type, $d, $c1, $c2 {
say "\nFirst $d $type primes:\n", @pr[^$d]».,
say "Count of $type primes <= {comma $c1}: ", comma +@pr[^(@pr.first: * > $c1,:k)];
say "Count of $type primes <= {comma $c2}: ", comma +@pr;
Line 372:
Count of weak primes <= 10,000,000: 321,750
First
(5 53 157 173 211 257 263 373 563 593 607 653 733 947 977
Count of balanced primes <= 1,000,000: 2,994
Count of balanced primes <= 10,000,000: 21,837</pre>
|