Jump to content

Catalan numbers: Difference between revisions

(Added iterative solution)
Line 1,940:
 
=={{header|Perl 6}}==
<lang perl6>myconstant @catalanCatalan := 1, {[\*] (state2, $n)++;6 ... 2*(2*$n-1) Z/($n+1) *2 $_ } ... *;
 
.say for @catalanCatalan[^15];</lang>
{{out}}
<pre>1
1,934

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.