| 1 | initial version |
As far as I understand this is what you want
def T(n):
x = polygen(ZZ) # or alternatively x = var("x")
a=1
b=x
if n==0:
return a
if n==1:
return b
else:
for i in [2..n]:
b=2*x*b-a
a=(a+b)/(2*x)
return b
Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.