Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Here is a first solution

sage: sum(c*x**i for i,c in enumerate(reversed(coeff)))
x^6 + x^4 + x^3 + x^2 + 1

And another, with "Horner's method":

sage: p = 0
sage: for i in coeff:
....:      p = p*x+i
sage: p
x^6 + x^4 + x^3 + x^2 + 1