Brilliant numbers: Difference between revisions

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