Pan base non-primes: Difference between revisions
m
→{{header|Raku}}: make code match output
Thundergnat (talk | contribs) m (→{{header|Raku}}: make code match output) |
|||
Line 112:
my @np = 4,6,8,9, |lazy (11..*).hyper.grep( -> $n { ($n.substr(*-1) eq '0') || (1 < [gcd] $n.comb».Int) || none (2..$n).map: { try "$n".&from-base($_).is-prime } } );
put "First 50 pan-base
put "\nFirst 20 odd pan-base
my $threshold = 2500;
put "\nCount of pan-base
put "Percent odd up to and including $threshold: " ~ +@np.&upto($threshold).grep(* % 2) / +@np.&upto($threshold) × 100;
|