A polynomial $P(x)$ is called nice if $P(0) = 1$ and the nonzero coefficients of $P(x)$ alternate between $1$ and $-1$ when written in order. Suppose that $P(x)$ is nice, and let $m$ and $n$ be two relatively prime positive integers. Show that \[Q(x) = P(x^n) \cdot \frac{(x^{mn} - 1)(x-1)}{(x^m-1)(x^n-1)}\] is nice as well.
Problem
Source: USA TST 2011 P6
Tags: algebra, polynomial, number theory, relatively prime, number theory unsolved
27.07.2011 09:19
A polynomial will be called completely monic, if all it's nonzero coefficients are equal to $1$ Lemma 1: Let $R(x)$ be a completely monic polynomial, and let $m$ and $n$ be two relatively prime positive integers. Then $S(x) = R(x^n)(1+x^m+...+x^{(n-1)m})$ is completely monic. Proof: Let $k\in\mathbb{N}_0$. There exists a unique $a\in\{0, 1, 2, ..., n-1\}$ such that $k\equiv am \mod n$ because $m$ and $n$ are coprime. If $k<am$ then the coefficient of $x^k$ in $S(x)$ is zero. Otherwise, the coefficient of $x^k$ in $S(x)$ is equal to the coefficient of $x^{\frac{k-am}{n}}$ in $R(x)$, which is $0$ or $1$. Lemma 2: Let $R(x)$ be a completely monic polynomial. Then $R(x)(1-x)$ is nice. Proof: Define the sequences $\{a_n\}$ and $\{b_n\}$ in the following way. In the sequence of coefficients of $R(x)$, let $a_0$ be the index of the first $1$ (then $a_0 = 0$), let $b_0$ be the index of the first $0$ after that, let $a_1$ be the index of the first $1$ after that, let $b_1$ be the index of the first $0$ after that, and so on. Then $R(x) = (x^{0}+...+x^{b_0-1})+(x^{a_1}+...+x^{b_1-1})+...+(x^{a_t}+...+x^{b_t-1})$ where $b_t-1$ is the degree of $R(x)$; every term inside the parenthesis has coefficient $1$; and we have $0=a_0<b_0<a_1<b_1<...<a_t<b_t$. Then $\displaystyle{R(x)(1-x) = (x^{0}+...+x^{b_0-1})(1-x)+(x^{a_1}+...+x^{b_1-1})(1-x)+...+(x^{a_t}+...+x^{b_t-1})(1-x)}\displaystyle$ Then $R(x)(1-x) = x^{0}-x^{b_0} + x^{a_1} - x^{b_1} + x^{a_2} - x^{b_2} + ... + x^{a_t} - x^{b_t}$, which is nice. Back to the problem: Let $P(x) = \sum_{k\ge 0}{a_kx^k}$. Then $\frac{P(x)}{1-x} = \sum_{k\ge 0}{(a_0+...+a_k)x^k}$ The sequence $a_0, a_1, a_2, ... $ starts with $1$, the it has zero or more $0$s, then it has a $-1$, then zero or more $0$s, then a $1$, and so on. Then the partial sums $a_0+...+a_k$ are equal to $0$ or $1$. Then $\frac{P(x)}{1-x}$ is completely monic. Then $P(x^n)\frac{1-x^{mn}}{(1-x^m)(1-x^n)} = \frac{P(x^n)}{1-x^n}(1+x^m+...+x^{(n-1)m})$ is completely monic by Lemma 1. Then $P(x^n)\frac{(1-x^{mn})(1-x)}{(1-x^m)(1-x^n)}$ is nice by Lemma 2.
25.11.2013 01:35
13.01.2020 17:35
Here is a direct but much less elegant solution. This is not quite detailed as I don't know how to explain this more clearly. Call a positive integer tasty if and only if it can be expressed in form $am+bn$ where $a,b$ are nonnegative integers. A positive integer $k$ is called good iff $k$ is tasty but $k-1$ is not, bad iff $k$ is not tasty but $k-1$ is, and neutral otherwise. First, we expand the polynomial $T(x) = \tfrac{(x^{mn}-1)(x-1)}{(x^m-1)(x^n-1)}$. We claim that Claim: The coefficient of $x^k$ in $T(x)$ is $-1$ iff $k$ is bad. $+1$ iff $k$ is good. $0$ iff $k$ is neutral. Proof: Let $f(k)$ denote the number of ways to represent $k$ in form $am+bn$ where $a,b\geq 0$. Then it's not hard to show that $f(k+mn) = f(k)+1$. Thus $$\frac{1-x^{mn}}{(1-x^m)(1-x^n)} = (1-x^{mn})\sum_{k=0}^{\infty}f(k)x^k = \sum_{k\text{ tasty}} x^k$$multiplying by $(1-x)$ gives the conclusion. $\blacksquare$ For each $0\leq r\leq n-1$, let $t_r$ denote the smallest integer which $nt_r+r$ is tasty. Observe that $nk+r$ is tasty if and only if $k\geq t_r$. Define functions $f$ and $g$ by $f(k)$ is the sum of coefficients from $x^0$ to $x^{k-1}$ in $P$ and similarly, $g(k)$ is the sum of coefficients from $x^0$ to $x^{k-1}$ in $Q$. The main structural claim (which will imply the problem as $P$ is nice if and only if $f(k)\in\{0,1\}$ for all $k$ and similarly for $Q$.) is Claim: $g(nk+r) = f(k-t_r)$ for any $k\geq 0$ and $0\leq r\leq n-1$. Proof: Induct on $nk+r$. The base case $k=r=0$ is clear. We split into two cases. Case 1: $r=0$ By induction hypothesis, it suffices to show that the $x^{nk}$-coefficient of $Q$ is $f(k-t_0) - f(k-1-t_{n-1})$. Through multiplying, that coefficient is $$\sum_{nt\text{ good}}[x^{k-t}]P - \sum_{nt\text{ bad}}[x^{k-t}]P$$Observe that $nt$ is good if and only if $t_0\leq t< t_{n-1}+1$. $nt$ is bad if and only if $t_{n-1}+1\leq t<t_0$. Thus that quantity reduces to $f(k-t_0) - f(k-1-t_{n-1})$ as desired. Case 2: $1\leq r\leq n-1$ Really similar to Case 1. By induction hypothesis, it suffices to show that the $x^{nk+r}$-coefficient of $Q$ is $f(k-t_r) - f(k-t_{r-1})$. Through multiplying, that coefficient is $$\sum_{nt+r\text{ good}}[x^{k-t}]P - \sum_{nt+r\text{ bad}}[x^{k-t}]P$$Observe that $nt+r$ is good if and only if $t_r\leq t< t_{r-1}$. $nt+r$ is bad if and only if $t_{r-1}+1\leq t<t_r$. Thus that quantity reduces to $f(k-t_r) - f(k-t_{r-1})$ as desired. Having exhausted two cases, we are done. $\blacksquare$
22.03.2021 07:42
@3above, 2above the case $P(1)=1$ is the actual hard case. Missing it is a fatal flaw rather than a silly mistake. Case 1: $P(1)=0$. Let $P(x)=(x-1)R(x)$. Since $P(0)=1, R$'s coefficients are all $-1$ or $0$ as we can pair $P$'s coefficients; the rightmost is $1$ and the one to the left is $-x^k$ and this would become $\sum\limits_{i=0}^{k-1} -x^i$, and we can repeat this process. Call a polynomial boring if all of its nonzero coefficients are the same, and are $1$ or $-1$. Then $P(x^n)\cdot \frac{(x^{mn}-1)(x-1)}{(x^m-1)(x^n-1)} = R(x^n) \cdot \sum\limits_{i=0}^{n-1} x^{im} \cdot (x-1)$. I claim $R(x^n) \cdot \sum\limits_{i=0}^{n-1} x^{im}$ is boring. Consider the $x^k$ coefficient. Since $(m,n)=1$, there exists a unique $0\le k'<n$ such that $k\equiv mk'(\bmod\; n)$. If $k-mk'<0$, then the $x^k$ coefficient is 0. Otherwise, it is equal to the $x^{\frac{k-mk'}{n}}$ of $R(x)$, which is also either $0$ or $-1$. Finally, we can group chunks of coefficients of $-1$ to see that the product of a boring polynomial and $x-1$ is a nice polynomial. Case 2: $P(1)=1$. Let $P(x)=1+(x-1)R(x)$. We know that $(x^n-1)R(x^n) \cdot \frac{(x^{mn}-1)(x-1)}{(x^m-1)(x^n-1)}$ is nice. Lemma: $\frac{(x^{mn}-1)(x-1)}{(x^m-1)(x^n-1)}$ is nice. Let $0\le k<n, 0\le l<m$ such that $mk=nl+1$. Then this polynomial becomes $$\frac{\sum\limits_{i=0}^{n-1} x^{mi+1}-x^{mi}}{x^n-1}$$We then notice the numerator is simply $$\sum\limits_{t=0}^{n-k-1} (x^{mt+1}-x^{m(t+k)}) + \sum\limits_{t=n-k}^{n-1} (x^{mt+1}-x^{m(t+k-n)})$$ Dividing by $x^n-1$, this becomes $$-\sum\limits_{t=0}^{n-k-1} x^{mt+1} \sum\limits_{i=0}^{l-1} x^{ni} + \sum\limits_{t=n-k}^{n-1} x^{m(t+k-n)} \sum\limits_{i=0}^{m-l-1} x^{ni}$$ Claim: Let $f(e)$ be the number of ways to write $e=ma+nb, a,b\ge 0$, where $e\le (m-1)(n-1)$, then this sum is $$\sum\limits_{e=0}^{(m-1)(n-1)} (f(e)-f(e-1))x^e$$ Proof. If $e$ can be written as $ma+nb$, but $e-1$ can't, then note $e-1=ma+nb+ln-km=m(a-k)+n(l+b)$, where $a<k$, then note $e$ is not added once on the subtracted polynomial. However, if $a>k$, note $a<n$, so we are good. The other cases can be treated similarly. We are almost done. Note $0$ is the smallest number, and the constant coefficient is 1. We consider this process. Call a number $e$ good if $f(e)-f(e-1)=1,$ and bad if $f(e)-f(e-1)=-1$, and insignificant otherwise. If a number is good or bad it is important. Suppose $x$ is good and we haven't processed all the monomials with nonzero coefficients. Then if $x+1$ is bad, we are good. Otherwise, $f(x+1)=1$, so we look at $x+2$. Repeat this process until we find a bad number. After this, suppose the next important number we hit, $y$, is bad. Therefore, $f(y)=0$ and $f(y-1)=1$. Notice all the numbers in the middle are insignificant, so they have constant $f$, but the bad number has $f(z)=0$, contradiction. Finally, we combine the two parts. Our polynomial is now $$(x-1)(\sum\limits_{i\in S} x^{in})(\sum\limits_{i=0}^{n-1} x^{im})+\sum\limits_{e\ge 0}(f(e)-f(e-1))x^e=\sum\limits_{e\ge 0}(g(e)-g(e-1))x^e$$ Let our first property of a number be that it can be written as $ma+nb$ and is at most $(m-1)(n-1)$, and the second property be that it can be written as $ma+nb, 0\le a<n, b\notin S$. Note the first property gives a $+1$ and the second one gives a $-1$ to $g$. Consider the same process. Observe if $x>(m-1)(n-1), g(x)$ can have output $0,-1$ and if $x\le (m-1)(n-1)$, $g(x)$ has output $0,1$. If $x>(m-1)(n-1)$, we repeat the argument before since the first property is meaningless. Otherwise, we can see the second property is a stronger form of the first property and the same argument still works.