Brilliant numbers: Difference between revisions
Content deleted Content added
Thundergnat (talk | contribs) m →{{header|Raku}}: better grammar |
Thundergnat (talk | contribs) m →{{header|Raku}}: Formatting / layout tweaks |
||
Line 42: | Line 42: | ||
}; |
}; |
||
# The task |
|||
# Testing |
|||
put "First 100 brilliant numbers:\n" ~ @brilliant[^100].batch(10)».fmt("%4d").join("\n") ~ "\n" ; |
put "First 100 brilliant numbers:\n" ~ @brilliant[^100].batch(10)».fmt("%4d").join("\n") ~ "\n" ; |
||
for 1 .. 7 -> $ |
for 1 .. 7 -> $oom { |
||
my $threshold = exp $ |
my $threshold = exp $oom, 10; |
||
my $key = @brilliant.first: :k, * >= |
my $key = @brilliant.first: :k, * >= $threshold; |
||
printf "First >= %13s is %9s in the series: %13s\n", comma($threshold), ordinal-digit(1 + $key, :u), comma @brilliant[$key]; |
|||
}</lang> |
}</lang> |
||
{{out}} |
{{out}} |
||
Line 63: | Line 63: | ||
1247 1261 1271 1273 1333 1343 1349 1357 1363 1369 |
1247 1261 1271 1273 1333 1343 1349 1357 1363 1369 |
||
First |
First >= 10 is 4ᵗʰ in the series: 10 |
||
First |
First >= 100 is 11ᵗʰ in the series: 121 |
||
First |
First >= 1,000 is 74ᵗʰ in the series: 1,003 |
||
First |
First >= 10,000 is 242ⁿᵈ in the series: 10,201 |
||
First |
First >= 100,000 is 2505ᵗʰ in the series: 100,013 |
||
First |
First >= 1,000,000 is 10538ᵗʰ in the series: 1,018,081 |
||
First |
First >= 10,000,000 is 124364ᵗʰ in the series: 10,000,043 |
||
First |
First >= 100,000,000 is 573929ᵗʰ in the series: 100,140,049 |
||
First |
First >= 1,000,000,000 is 7407841ˢᵗ in the series: 1,000,000,081</pre> |