Find all polynomials such that $P (x) = (x-P (0))(x-P (1))...(x-P (n-1))$

1. If $n=1$, it's easy to see that the only solution is $P(x)=x$.

2. If $n \geq 2$, set $x=0$:

$$P(0)=(-1)^n\cdot P(0)\cdot P(1)\cdot \ldots \cdot P(n-1)$$

If $P(0)$ is non-zero, we have

$$ P(1)\cdot P(2) \cdot \ldots \cdot P(n-1)=(-1)^{n+1}$$

This means that all the values $P(1), P(2), \ldots, P(n)$ are $\pm 1$. However, none of this values can be $1$, because by setting $x = 1$, we would have $P(1)=0$. This means they are all $-1$, so

$$P(x)=[x-P(0)]\cdot (x+1)^{n-1}$$

Now setting $x=1$ we get

$$-1=P(1)=2^{n-1}\cdot [1-P(0)]$$

which is false. This means we must have $P(0) = 0$. Therefore the given relation writes as

$$P(x)=x(x-P(1))(x-P(2))\cdot\ldots \cdot(x-P(n-1))$$

Now setting $x=1$ gives

$$(1-P(1))(1-P(2))\cdot \ldots \cdot(1-P(n-1))=P(1) $$

However, since $\gcd(P(1),1-P(1))=1$, we must have either $P(1)=0$ or $P(1)=2$.

If $P(1) = 0$, we have $P(i)=1$ for some $2\leq i \leq n-1$, but setting $x=i$ gives

$$1=i^2(i-1)(i-P(2))\cdot \ldots \cdot(i-P(n-1))$$

which is false again.

If $P(1) = 2$ we get

$$(1-P(2))\cdot \ldots \cdot(1-P(n-1))=-2$$

None of these factors can be $1$ (similar reasoning as previously), so $P(i)=3$ for some $i$ and $P(j)=0$, for $2\leq j \leq n,\ j\neq i$. We get $P(x)=x^{n-2}(x-2)(x-3)$, which is not a solution.

In conclusion, the only solution is $P(x) = x$.


I realize this answer does not answer the problem as stated. I am ignoring the restriction that the coefficients must be integers, and the result is actually really interesting, so I am leaving it as a response, as it does show there are no solutions with integer coefficients possible for $n=2,n=3$

Consider $n=1$: $P(x) = x-P(0)$ and $P(0) = -P(0) \Longrightarrow P(0) = 0$ shows that $P(x) = x$.

Consider $n=2$: $P(x) = (x-P(0))(x-P(1))$. Plug in $x=0$:

$$P(0) = P(0)P(1) \Longrightarrow P(0)(P(1)-1) = 0 \Longrightarrow P(0) = 0 \text{ or } P(1) = 1$$

From my comment above, $P(1) \neq 1$. Therefore $P(0) = 0$. This gives $P(1) = \dfrac{1}{2}$.

The only possible polynomial of degree 2 is $$P(x) = x\left(x-\dfrac{1}{2}\right)$$

Consider $n=3$: $P(x) = (x-P(0))(x-P(1))(x-P(2))$. Plug in $x=0$:

$$P(0) = -P(0)P(1)P(2) \Longrightarrow P(0)(1+P(1)P(2)) = 0 \Longrightarrow P(0) = 0\text{ or } P(1)P(2) = -1$$

Suppose $P(0) = 0$. Then $P(x) = x(x-P(1))(x-P(2))$. Plug in $x=1$: $$P(1) = 1-P(1)-P(2)+P(1)P(2) \Longrightarrow P(2)-1 = P(1)(P(2)-2)$$

Since $P(2) \neq 2$, we have $P(1) = \dfrac{P(2)-1}{P(2)-2}$

Plugging in $x=2$ gives $$P(2) = 2\left(2-\dfrac{P(2)-1}{P(2)-2}\right)(2-P(2)) = 6-2P(2) \Longrightarrow P(2) = 2$$

This is, of course, a contradiction.

Next, suppose $P(1)P(2) = -1$

At $x=0$, $P(0) = -P(0)P(1)P(2) = P(0)$ is true for any $P(0)$.

At $x=1$:

$$\begin{align*}P(1) & = (1-P(0))(1-P(1))(1-P(2)) \\ & = 1-P(0)-P(1)-P(2)+P(0)P(1)+P(0)P(2)+P(1)P(2)-P(0)P(1)P(2) \\ & = -P(1)-P(2)+P(0)P(1)+P(0)P(2)\end{align*}$$

At $x=2$: $$\begin{align*}P(2) & = (2-P(0))(2-P(1))(2-P(2)) \\ & = 8-4P(0)-4P(1)-4P(2)+2P(0)P(1)+2P(0)P(2)+2P(1)P(2)-P(0)P(1)P(2) \\ & = 6-3P(0)-4P(1)-4P(2)+2P(0)P(1)+2P(0)P(2)\end{align*}$$

Rearranging, we have:

$$\begin{align*}P(1)P(2) & = -1 \\ 2P(1)+P(2) & = P(0)(P(1)+P(2)) \\ 5P(2)+4P(1)+3P(0) & = 6+2P(0)(P(1)+P(2))\end{align*}$$

Solving gives:

$$P(0) = \dfrac{3+\sqrt{5}}{2}, P(1) = \dfrac{1+\sqrt{5}}{2}, P(2) = \dfrac{1-\sqrt{5}}{2} \\ P(0) = \dfrac{3-\sqrt{5}}{2}, P(1) = \dfrac{1-\sqrt{5}}{2}, P(2) = \dfrac{1+\sqrt{5}}{2}$$

This gives two solutions for $n=3$:

$$P(x) = \left(x-\dfrac{3+\sqrt{5}}{2}\right)\left(x-\dfrac{1+\sqrt{5}}{2}\right)\left(x-\dfrac{1-\sqrt{5}}{2}\right) \\ P(x) = \left(x-\dfrac{3-\sqrt{5}}{2}\right)\left(x-\dfrac{1-\sqrt{5}}{2}\right)\left(x-\dfrac{1+\sqrt{5}}{2}\right)$$

This does not look to have a general solution.