| 1 | initial version |
I do not know if this is the best answer but it works
sage: K = Zmod(543) # the ring Z/nZ
sage: R.<x> = PolynomialRing(K,'x')
sage: f = 3*x^5 + 2*x + 1
sage: g = 2*x + 1
sage: f.quo_rem(g)
(273*x^4 + 135*x^3 + 204*x^2 + 441*x + 52, 492)
The method quo_rem returns the 2-tuple made of the quotient and the remainder of the division.
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.