On 5 jan, 09:37, Michael Beeson <[email protected]> wrote:
> Thanks, that's a start, but my polynomials have some parameters
> a,b,c,...
> in the coefficients. In Mathematica you say PolyomialRemainder[f,g,x]
> where the
> last 'x' names the polynomial variable, so all other variables are
> parameters. When
> I tried to modify your code by inserting a=var('a') and then
> f=a*x^10, it didn't work,
> because now f only belongs to sage.symbolic.expression.Expression, and
> not
> to P.
Is the following what you look for?
sage: R.<x>=PolynomialRing(SR)
sage: var('a')
a
sage: f = a*x^10+2*x^8+3*x+1
sage: g = cyclotomic_polynomial(18)(x)
sage: f.quo_rem(g)
(a*x^4 + 2*x^2 + a*x, 2*x^5 - 2*x^2 + (-a + 3)*x + 1)
Yann
--
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org