I asked a question about converting a polynomial into a list.
Now I have a list of polynomials. For example,
r1={ p[1,2,4], p[1,2,5], p[1,3,4]*p[1,2,5], p[1,3,4]*p[1,2,5]-3*p[1,2,3]*p[2,3,4], p[1,3,4]*p[1,2,5]*p[3,6,9]-3*p[1,2,3]*p[2,3,4]*p[2,5,8], p[1,3,4]*p[1,2,5]*p[3,6,9]-3*p[1,2,3]*p[2,3,4]}
The polynomials in r1 have different degrees and a polynomial can be non-homogeneous. I would like to obtain:
r2={ {{1, {{1,2,4}}}}, {{1, {{1,2,5}}}}, {{1, {{1,3,4},{1,2,5}}}}, {{1,{{1,3,4},{1,2,5}}}, {-3, {{1,2,3},{2,3,4}}}}, { {1,{{1,3,4},{1,2,5},{3,6,9}}}, { -3, {{1,2,3},{2,3,4},{2,5,8}} } }, { {1,{{1,3,4},{1,2,5},{3,6,9}}}, { -3, {{1,2,3},{2,3,4}} } } }
How to obtain it? Thank you very much.
Map
with one of the methods from responses to the prior question. $\endgroup$