Catalan numbers: Difference between revisions
Content deleted Content added
No edit summary |
m Updated Julia |
||
Line 1,470:
=={{header|Julia}}==
From the Catalan package, returns the n-th Catalan number
<lang julia>function catalan(
binomial(2n,n)/(n+1)▼
if bn < 0
throw(DomainError())
else
n = BigInt(bn)
end
end</lang>
{{out}}
<
1
2
5
14
42
132
429
1430
4862
16796
58786
208012
742900
2674440
9694845</pre>
=={{header|K}}==
|