Riordan numbers: Difference between revisions
m
→{{header|Raku}}: typos, extend stretch
Thundergnat (talk | contribs) (New draft task and Raku entry) |
Thundergnat (talk | contribs) m (→{{header|Raku}}: typos, extend stretch) |
||
Line 15:
;Stretch
* Find and display the '''digit count''' of the
* Find and display the '''digit count''' of the 10,000th Riordan number.
Line 30 ⟶ 31:
my $upto = 32;
say "First {$upto.&cardinal} Riordan numbers:\n" ~ @riordan[^$upto]».&comma».fmt("%17s").batch(4).join("\n") ~ "\n";
sub abr ($_) { .chars < 41 ?? $_ !! .substr(0,20) ~ '..' ~ .substr(*-20) ~ " ({.chars} digits)" }
say "The {.Int.&ordinal}: " ~ abr @riordan[$_ - 1] for 1e3, 1e4</lang>
{{out}}
<pre>First thirty-two Riordan numbers:
Line 43 ⟶ 46:
54,022,715,451 154,000,562,758 439,742,222,071 1,257,643,249,140
The one thousandth: 51077756867821111314..79942013897484633052 (472 digits)
The ten thousandth: 19927418577260688844..71395322020211157137 (4765 digits)</pre>
|