Riordan numbers: Difference between revisions
Content added Content deleted
No edit summary |
(Added Quackery.) |
||
Line 1,073: | Line 1,073: | ||
The 10,000th Rirdan has 4765 digits. |
The 10,000th Rirdan has 4765 digits. |
||
</pre> |
</pre> |
||
=={{header|Quackery}}== |
|||
<syntaxhighlight lang="Quackery"> [ dup -1 peek 2 * |
|||
over -2 peek 3 * + |
|||
over size tuck 1 - * |
|||
swap 1+ / |
|||
join ] is nextterm ( [ --> [ ) |
|||
say "first 32 Riordan numbers: " |
|||
' [ 1 0 ] |
|||
30 times nextterm |
|||
witheach [ echo sp ] |
|||
cr cr |
|||
say "1000th Riordan number has " |
|||
' [ 1 0 ] |
|||
1000 2 - times nextterm |
|||
-1 peek number$ size echo |
|||
say " digits" |
|||
cr cr |
|||
say "10000th Riordan number has " |
|||
' [ 1 0 ] |
|||
10000 2 - times nextterm |
|||
-1 peek number$ size echo |
|||
say " digits" |
|||
</syntaxhighlight> |
|||
{{out}} |
|||
<pre>first 32 Riordan numbers: 1 0 1 1 3 6 15 36 91 232 603 1585 4213 11298 30537 83097 227475 625992 1730787 4805595 13393689 37458330 105089229 295673994 834086421 2358641376 6684761125 18985057351 54022715451 154000562758 439742222071 1257643249140 |
|||
1000th Riordan number has 472 digits |
|||
10000th Riordan number has 4765 digits</pre> |
|||
=={{header|Raku}}== |
=={{header|Raku}}== |