Le dimanche 23 octobre 2011 à 01:01 +0530, Hector a écrit : > Hi, > > I want to convert x**32 + x**15 + x**10 into x**2 + x**3 + x**4 i.e. > to convert power ``p`` into ``p % 6``. > How can I do it?
You can take the remainder modulo x**6 - 1. That's probably not very efficient algorithmically, bu it's simple: In [1]: Poly(x**32 + x**15 + x**10, x) % Poly(x**6 - 1, x) Out[1]: Poly(x**4 + x**3 + x**2, x, domain='ZZ') -- You received this message because you are subscribed to the Google Groups "sympy" group. 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/sympy?hl=en.
