Determine all polynomials $P(x)$ with real coefficients that satisfy the following two conditions:

(a) $P(2017)=2016$ and

(b) $(P(x)+1)^{2}=P\left(x^{2}+1\right)$ for all real numbers $x$.

(Walther Janous)
With $Q(x):=P(x)+1$ we obtain $Q(2017)=2017$ and $(Q(x))^{2}=Q\left(x^{2}+1\right)-1$ for all $x \in \mathbb{R}$, which can be rewritten as $Q\left(x^{2}+1\right)=Q(x)^{2}+1$ for all $x \in \mathbb{R}$.

We define the sequence $\left(x_{n}\right)_{n>0}$ recursively by $x_{0}=2017$ and $x_{n+1}=x_{n}^{2}+1$ for all $n \geq 0$. By induction, we can show that $Q\left(x_{n}\right)=x_{n}$ for all $n \geq 0$, since $Q\left(x_{n+1}\right)=Q\left(x_{n}^{2}+1\right)=$ $Q\left(x_{n}\right)^{2}+1=x_{n}^{2}+1=x_{n+1}$.

Since $x_{0}<x_{1}<x_{2}<\cdots$, the polynomial $Q(x)$ agrees with the polynomial $\operatorname{id}(x)=x$ at infinitely many points. Therefore, $Q(x)=x$ and thus $P(x)=x-1$. Since $x-1$ clearly satisfies the two conditions, it is the only solution.

(Walther Janous)