13 lines
351 B
Text
13 lines
351 B
Text
100 cls
|
|
110 n = 15
|
|
120 dim t(n+2)
|
|
130 t(1) = 1
|
|
140 print "The first 15 Catalan numbers are: ";chr$(10)
|
|
150 for i = 1 to n
|
|
160 for j = i to 1 step -1 : t(j) = t(j)+t(j-1) : next j
|
|
170 t(i+1) = t(i)
|
|
180 for j = i+1 to 1 step -1 : t(j) = t(j)+t(j-1) : next j
|
|
190 print using "###";i;": ";
|
|
200 print using "#########";t(i+1)-t(i)
|
|
210 next i
|
|
220 end
|