Brand new to Sage here and trying to define a family of polynomials indexed by natural numbers. In particular, I'd like to be able to generate then perform symbolic calculations with the family of polynomials defined for all n∈N and all k=0,…,2n by pk={0if k=0∑kj=1xkif k≤n∑2n−k+1j=1xjif k>n
So far the attempts that I've had are of the form:
h = lambda k:sum([var('d_%d' %(i+1)) for i in range(k)])
but I don't seem to easily perform calculations with these. Another method I was trying is by defining Q[x0,…,xn] then trying to defining these polynomials using conditional statements but keep getting errors that my variables don't exist.
Would love some help or a hint.