Problem

Source: European Mathematical Cup 2017 Problem 4

Tags: algebra, polynomial



Find all polynomials $P$ with integer coefficients such that $P (0)\ne 0$ and $$P^n(m)\cdot P^m(n)$$is a square of an integer for all nonnegative integers $n, m$. Remark: For a nonnegative integer $k$ and an integer $n$, $P^k(n)$ is defined as follows: $P^k(n) = n$ if $k = 0$ and $P^k(n)=P(P(^{k-1}(n))$ if $k >0$. Proposed by Adrian Beker.