On Jan 3, 10:59 am, Michael Beeson <profbee...@gmail.com> wrote:
> I am just learning Sage.   I tried to define a polynomial and then
> find the polynomial remainder upon division by the
> cyclotomic_polynomial(18), which is 1-x^3+x^6.    This is easily
> accomplished in Mathematica using the PolynomialRemainder function.
> But I could not find the analog of that function in the Sage
> documentation.

> What is the right way to do this in Sage?

I think this is what you are trying to do:

sage: P.<x> = PolynomialRing(QQ)
sage: f = x^10+2*x^8+3*x+1
sage: f in P
True
sage: g = cyclotomic_polynomial(18); g
x^6 - x^3 + 1
sage: f.quo_rem(g)
(x^4 + 2*x^2 + x, 2*x^5 - 2*x^2 + 2*x + 1)

The first term is the quotient and the second is the remainder. See
sage: f.quo_rem?

for the description of the method.

Daniel Bump

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Reply via email to