14 lines
274 B
Text
14 lines
274 B
Text
PRINT "Catalan Numbers from Pascal's Triangle"!PRINT
|
|
x = 15
|
|
DIM t(x+2)
|
|
t(1) = 1
|
|
FOR n = 1 TO x
|
|
FOR m = n TO 1 STEP -1
|
|
t(m) = t(m) + t(m-1)
|
|
NEXT m
|
|
t(n+1) = t(n)
|
|
FOR m = n+1 TO 1 STEP -1
|
|
t(m) = t(m) + t(m-1)
|
|
NEXT m
|
|
PRINT n,"#######":t(n+1) - t(n)
|
|
NEXT n
|