Find all polynomials $\sum_{k=0}^na_kx^k$, where $a_k=\pm2$ or $a_k=\pm1$, and $0\leq k\leq n,1\leq n<\infty$, such that they have only real zeroes

Solution 1:

Let $\alpha_1,\alpha_2...\alpha_n$ the real roots. We know:

$$\sum \alpha_i^2=( \sum \alpha_i )^2-2\sum \alpha_i\alpha_j= \left(\frac{a_{n-1}}{a_n}\right)^2-2\left(\frac{a_{n-2}}{a_n}\right)\le 8$$

On the other hand, by AM-GM inequality:

$$\sum \alpha_i^2\ge n \sqrt[n]{|\prod\alpha_i|^2}=n\sqrt[n]{\left|\frac{a_0}{a_n}\right|^2}\ge n\sqrt[n]{\frac{1}{4}}$$

So $8\ge n \sqrt[n]{\frac{1}{4}} \Rightarrow n\le9$. The rest is finite enough.