If the coefficients are non-negative then you can always do it with at most two integer evaluations.
That is, $P$ and $Q$ are equal if and only if
- $P(1)=Q(1)$, and
- $P(P(1)+1)=Q(Q(1)+1)$.
If the coefficients are non-negative then you can always do it with at most two integer evaluations.
That is, $P$ and $Q$ are equal if and only if