Colorful numbers: Difference between revisions
m
→{{header|Raku}}: use 'hyper' not 'race'
Alextretyak (talk | contribs) (Added 11l) |
SqrtNegInf (talk | contribs) m (→{{header|Raku}}: use 'hyper' not 'race') |
||
Line 1,136:
}
put "Colorful numbers less than 100:\n" ~ (^100).
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}).
" - {($c / (exp($_,10) - exp($_-1,10) ) * 100).round(.001)}%";
$total += $c;
|