ASKSAGE: Sage Q&A Forum - Individual question feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sun, 03 Nov 2013 03:35:36 -0600How to factor polynomials in var('x') over the semi-ring of polynomials with non-negative integer coefficients ?https://ask.sagemath.org/question/10689/how-to-factor-polynomials-in-varx-over-the-semi-ring-of-polynomials-with-non-negative-integer-coefficients/Is there an easy way in sage to determine the factorization of a polynomial in the variable x ( having non-negative integer coefficients), over the semi-ring of polynomials in the variable x with non-negative integer coefficients. Sun, 03 Nov 2013 00:06:34 -0500https://ask.sagemath.org/question/10689/how-to-factor-polynomials-in-varx-over-the-semi-ring-of-polynomials-with-non-negative-integer-coefficients/Answer by tmonteil for <p>Is there an easy way in sage to determine the factorization of a polynomial in the variable x ( having non-negative integer coefficients), over the semi-ring of polynomials in the variable x with non-negative integer coefficients. </p>
https://ask.sagemath.org/question/10689/how-to-factor-polynomials-in-varx-over-the-semi-ring-of-polynomials-with-non-negative-integer-coefficients/?answer=15647#post-id-15647You can not (yet?) define polynomials over `NN` in Sage, because it is not a ring. What you can do is to define your polynomial over `ZZ`, find its factors (as elements of `ZZ[x]`), and then recombine them to find polynomials with non-negative entries.
Sun, 03 Nov 2013 03:35:36 -0600https://ask.sagemath.org/question/10689/how-to-factor-polynomials-in-varx-over-the-semi-ring-of-polynomials-with-non-negative-integer-coefficients/?answer=15647#post-id-15647