Colorful numbers: Difference between revisions

m
→‎{{header|Raku}}: use 'hyper' not 'race'
(Added 11l)
m (→‎{{header|Raku}}: use 'hyper' not 'race')
Line 1,136:
}
 
put "Colorful numbers less than 100:\n" ~ (^100).racehyper.grep( &is-colorful).batch(10)».fmt("%2d").join: "\n";
 
my ($start, $total) = 23456789, 10;
Line 1,149:
for 2..8 {
put "$_ digit colorful number count: ",
my $c = +(flat $start.comb.combinations($_).map: {.permutations».join».Int}).racehyper.grep( &is-colorful ),
" - {($c / (exp($_,10) - exp($_-1,10) ) * 100).round(.001)}%";
$total += $c;
2,392

edits