%pylab inline
from IPython.core.display import display,HTML,Math,Latex
#%%capture Catal
def Catalan(n):
if n==0:
return (1)
else:
return int(Catalan(n-1)*(4*n-2)/(n+1))
for n in range(11):
display(Math("C_{"+str(n)+ "} = "+str(Catalan(n))))
y=""
for n in range(21):
y=y+"C_{"+str(n)+ "} = "+str(Catalan(n))+"\\\\"
Math(y)
#Catal()
%store y > tester.txt
print(y)