There is the following one-liner but you can't write it as polynomial (Sage 
polynomials always evaluate the coefficients)

sage: R.<x> = ZZ[]
sage: map(factor, (x^2+9).coefficients())
[3^2, 1]



On Thursday, August 13, 2015 at 8:48:08 PM UTC+2, Ursula Whitcher wrote:
>
> Is there a quick way to factor the coefficients of a polynomial over the 
> integers in Sage? 
>
> For example, given x^2+9, I would like to rewrite it as x^2+3^2. 
>
> I can see a slow way to do this (iterate over poly.factor_list(), extract 
> coefficients, factor, rebuild the polynomial).  But perhaps there is a 
> shortcut built into Sage?
>
> --Ursula.
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.

Reply via email to