Every substituted power
x,x3,x5,x7,x9 is odd, so
Q(−x) =P(−x)P(−x3)P(−x5) ⋅P(−x7)P(−x9). Since
P(−x)=1+31x+61x2 has only nonnegative coefficients, so does each factor
P(−xk), and hence so does the product
Q(−x). The coefficient of
xi in
Q(−x) is
(−1)iai, so
∣ai∣=(−1)iai.
Therefore
i=0∑50∣ai∣=Q(−1)=P(−1)5=(1+31+61)5=(23)5=32243, and
m+n=243+32=275.