# How to factor polynomials in var('x') 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.

edit retag close merge delete

Sort by » oldest newest most voted

You 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.

more