4. Find all quadratic trinomials $P(x)=a x^{2}+b x+c$ with integer coefficients $a, b$, and $c$, for which $P(1)<P(2)<P(3)$ and $(P(1))^{2}+(P(2))^{2}+(P(3))^{2}=22$.
SOLUTION. Since $a, b, c$ are integers according to the problem, the values $P(1), P(2)$, and $P(3)$ are also integers. Their squares, i.e., the numbers $P(1)^{2}, P(2)^{2}$, and $P(3)^{2}$, are therefore squares of integers, i.e., three (not necessarily distinct) numbers from the set $\{0,1,4,9,16,25, \ldots\}$. Their sum is 22 according to the problem, so each of the three addends is less than the sixth possible number 25. In what ways can the number 22 be formed as a sum of three numbers chosen from the set $\{0,1,4,9,16\}$?

A systematic analysis quickly reveals that the number 22 can be decomposed into a sum of three squares in only one way (up to the order of the addends), namely $22=4+9+9$. Two of the numbers $P(1), P(2)$, and $P(3)$ therefore have an absolute value of 3 and the third 2, and since $P(1)<P(2)<P(3)$, it must necessarily be that $P(1)=-3, P(3)=3$ and $P(2) \in\{-2,2\}$. For each of the two suitable triples

$$
(P(1), P(2), P(3))=(-3,-2,3) \quad \text { and } \quad(P(1), P(2), P(3))=(-3,2,3)
$$

we determine the coefficients $a, b, c$ of the corresponding quadratic polynomial $P(x)$ by substituting the found values into the right-hand sides of the equations

$$
\begin{aligned}
a+b+c & =P(1) \\
4 a+2 b+c & =P(2) \\
9 a+3 b+c & =P(3)
\end{aligned}
$$

and solving the resulting system of three equations with unknowns $a, b, c$. We omit this straightforward calculation here, and in both cases, we write down the integer triples $(a, b, c)$ as the coefficients of the quadratics, which are the only two solutions to the given problem:

$$
P_{1}(x)=2 x^{2}-5 x \quad \text { and } \quad P_{2}(x)=-2 x^{2}+11 x-12 \text {. }
$$

GUIDING AND ADDITIONAL PROBLEMS:

N1. Determine all linear polynomials $P(x)=a x+b$ for which $P(2)=3$ and $P(3)=2$. [The only linear polynomial is $P(x)=5-x$, since the system of equations $2 a+b=P(2)=3,3 a+b=P(3)=2$ has the unique solution $a=-1$ and $b=5$.]

N2. Determine all quadratic polynomials $P(x)=a x^{2}+b x+c$ for which $P(1)=4, P(2)=9$ and $P(3)=18$. [The only quadratic polynomial is $P(x)=2 x^{2}-x+3$, since the system of equations $a+b+c=4$, $4 a+2 b+c=9,9 a+3 b+c=18$ has the unique solution $a=2, b=-1, c=3$.]

N3. Determine all linear polynomials $P(x)=a x+b$ with integer coefficients $a$ and $b$ for which $P(1)<P(2)$ and $P(1)^{2}+P(2)^{2}=5$. [Exactly four linear polynomials satisfy this: $x+0,3 x-4$, $x-3$ and $3 x-5$. The number 5 can be written in only one way as a sum of two squares of integers, disregarding the order of the addends, namely $5=( \pm 1)^{2}+( \pm 2)^{2}$. Therefore, the numbers $P(1)<P(2)$ form one of the pairs $(1,2),(-1,2),(-2,-1),(-2,1)$; for each of them, calculate the coefficients $a, b$ using the method from problem N1.]

D1. For which quadratic polynomials $P(x)=a x^{2}+b x+c$ does the equality $P(4)=P(1)-3 P(2)+3 P(3)$ hold? [For all. Verify by substitution that both sides of the given equation are equal to $16 a+4 b+c$.

D2. The coefficients $a, b, c$ of the quadratic polynomial $P(x)=a x^{2}+b x+c$ are real numbers, and each of the three values $P(1), P(2)$, and $P(3)$ is an integer. Does it follow that the numbers $a, b, c$ are integers, or is it necessary that at least one of them is an integer (which one)? [It does not follow; consider the example of the quadratic polynomial $P(x)=\frac{1}{2} x^{2}+\frac{1}{2} x+1: \mathrm{z}$ from the expression $P(x)=\frac{1}{2} x(x+1)+1$ it follows that $P(x)$ is an integer for every integer $x$, since the product $x(x+1)$ is then divisible by two. In the general case, only the coefficient $c$ is necessarily an integer; this follows from the expression $c=P(0)=3 P(1)-3 P(2)+P(3)$.]