Strong and weak primes: Difference between revisions

m
→‎{{header|Perl 6}}: add some commas
(→‎{{header|Perl 6}}: Add a Perl 6 example)
m (→‎{{header|Perl 6}}: add some commas)
Line 355:
for @strong, 'strong', 36, 1e6, 1e7,
@weak, 'weak', 37, 1e6, 1e7,
@balanced, 'balanced', 3028, 1e6, 1e7
-> @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 3028 balanced primes:
(5 53 157 173 211 257 263 373 563 593 607 653 733 947 977 11031,103 11231,123 11871,187 12231,223 13671,367 15111,511 17471,747 17531,753 19071,907 22872,287 24172,417 26772,677 2903 2963 33072,903)
Count of balanced primes <= 1,000,000: 2,994
Count of balanced primes <= 10,000,000: 21,837</pre>
10,333

edits