Catalan numbers: Difference between revisions

no edit summary
m (→‎version 1: mention the number of methods shown in the task's preamble.)
No edit summary
Line 3,209:
20 6564120420 6564120420 6564120420
n c1.n c2.n c3.n</pre>
 
=={{header|Ring}}==
<lang ring>
for n = 1 to 15
see catalan(n) + nl
next
func catalan n
if n = 0 return 1 ok
cat = 2 * (2 * n - 1) * catalan(n - 1) / (n + 1)
return cat
</lang>
Output:
<pre>
1
2
5
14
42
132
429
1430
4862
16796
58786
208012
742900
2674440
9694845
</pre>
 
=={{header|Ruby}}==
2,468

edits