We set $P (x) = a_nx^n +a_{n-1}x^{n-1} +..+a_0$ Then by comparing the coefficients we get $a_n = 1 and (a_0 + 1) ^ 2 = a_n + ... + a_0(1)$
Assume $k$ is the second degree after degree n of the polynomial $P(x)(k<n)$
Comparing the coefficients of $x^{n+k}$ on both sides we get $a_k=0$. From this we deduce $P(x)=x^n+a_0 $
Using (1) with $a_n = 1,a_i=0$ with $i=1->(n-1)$ we get $a_0 = 0$ or $a_0 = -1$
If $a_0 = 0$, then $P (x) = x ^ n$, then from $P(2017) = 2016$ we get $n = log_ {2017} {2016} $(Not satisfied)
If $a_0 = -1$ then $P(x) = x^n-1$ then from $P(2017) = 2016$ we get $n = 1 \Rightarrow:P(x) = x-1$