Catalan numbers/Pascal's triangle: Difference between revisions

no edit summary
(Easylang)
imported>Maxima enthusiast
No edit summary
Line 1,391:
2674440
9694845</pre>
 
=={{header|Maxima}}==
<syntaxhighlight lang="maxima">
/* The Catalan triangle can be generated using genmatrix */
genmatrix(lambda([n,k],if n>=k then binomial(n+k-1,k-1)-2*binomial(n+k-2,k-2) else 0),15,15)$
 
/* The Catalan numbers are in the main diagonal */
makelist(%[i,i],i,1,15);
</syntaxhighlight>
{{out}}
<pre>
[1,1,2,5,14,42,132,429,1430,4862,16796,58786,208012,742900,2674440]
</pre>
 
=={{header|Nim}}==
{{trans|Python}}