| 1 | initial version |
f=function('f')
def T(f,n,x):
ans=0
for v in range(n+1):
ans=ans+binomial(n,v)*f(v+1)*(x)^v
return ans
print T(f,4,x)
gives:
x^4*f(5) + 4*x^3*f(4) + 6*x^2*f(3) + 4*x*f(2) + f(1)
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.