ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Fri, 23 Jul 2021 20:18:08 +0200Coefficient of a single variable polynomial over a modular ringhttps://ask.sagemath.org/question/58104/coefficient-of-a-single-variable-polynomial-over-a-modular-ring/ I want to find coefficent of a polynomial ring. How to do this?
R.<x>=IntegerModRing(15)[]
f=1+x^2+4*x^6
So coefficient of x is 0, x^2 is 1, x^6 is 4 etc.
How to get these?
Fri, 23 Jul 2021 20:08:14 +0200https://ask.sagemath.org/question/58104/coefficient-of-a-single-variable-polynomial-over-a-modular-ring/Answer by tolga for <p>I want to find coefficent of a polynomial ring. How to do this?</p>
<p>R.<x>=IntegerModRing(15)[]
f=1+x^2+4*x^6</p>
<p>So coefficient of x is 0, x^2 is 1, x^6 is 4 etc.
How to get these? </p>
https://ask.sagemath.org/question/58104/coefficient-of-a-single-variable-polynomial-over-a-modular-ring/?answer=58105#post-id-58105Does this solve your problem?:
R.<x>=IntegerModRing(15)[]
f=1+x^2+4*x^6
coeffs=(f.coefficients(sparse=False))
show(coeffs)Fri, 23 Jul 2021 20:18:08 +0200https://ask.sagemath.org/question/58104/coefficient-of-a-single-variable-polynomial-over-a-modular-ring/?answer=58105#post-id-58105