14 lines
324 B
Text
14 lines
324 B
Text
catalan = iter (amount: int) yields (int)
|
|
c: int := 1
|
|
for n: int in int$from_to(1, amount) do
|
|
yield(c)
|
|
c := (4*n-2)*c/(n+1)
|
|
end
|
|
end catalan
|
|
|
|
start_up = proc ()
|
|
po: stream := stream$primary_output()
|
|
for n: int in catalan(15) do
|
|
stream$putl(po, int$unparse(n))
|
|
end
|
|
end start_up
|