Re: Working with polynomials in Z/23

*To*: mathgroup at smc.vnet.net*Subject*: [mg106619] Re: Working with polynomials in Z/23*From*: dh <dh at metrohm.com>*Date*: Mon, 18 Jan 2010 05:40:23 -0500 (EST)*References*: <his6ug$l6a$1@smc.vnet.net>

Hi Bob, simple follow PolynomialMod by a corresponding rule. E.g.: PolynomialMod[poly] /. x^n_ -> x^Mod[n, 23] Also note that you made a small mistake: Mod[25,23]->2 not 3 Daniel me13013 wrote: > I'm exploring polynomials over integer values modulo 23 (i.e. 'x' in > the polynomial can only take integer values, and my polynomials only > have integer coefficients). I know that I can reduce the polynomial > coefficients mod 23 using PolynomialMod. However, I also want to > reduce the exponents for the identity x^23 = x. Is there an easy way > to do that? > > For example, if I have the polynomial P(x) = x^5 + 2x. Then > P(P(x)) = x^25 + 10x^21 + 40x^17 + 80x^13 + 80x^9 + 34x^5 + 4x. > PolynomialMod will reduce this to > P(P(x)) = x^25 + 10x^21 + 17x^17 + 11x^13 + 11x^9 + 11x^5 + 4x. > But since x^25 = x^3, the answer I want is > P(P(x)) = 10x^21 + 17x^17 + 11x^13 + 11x^9 + 11x^5 + x^3 + 4x. > > I tried to figure out a way to do this using CoefficientList, but I'm > not proficient enough as an occasional Mathematica user to figure out > how to sort of "fold" the list onto itsefl and sum the columns. > > Any help would be appreciated, > Bob H >