## Task A-2.3.

Determine all natural numbers $n$ for which the quadratic equation

$$
x^{2}-3 n x+n+3=0
$$

has integer solutions.
## First Solution.

Let $x_{1}$ and $x_{2}$ be the solutions of the given quadratic equation. According to Viète's formulas, we have

$$
x_{1} x_{2}=n+3 \quad \text{and} \quad x_{1}+x_{2}=3 n.
$$

First, observe that from the first equation, $x_{1}$ and $x_{2}$ have the same sign, and from the second equation, they are positive.

From $x_{1} x_{2}=n+3$, we see that both roots are less than or equal to $n+3$.

Furthermore, the smaller root must be less than or equal to $\sqrt{n+3}$, i.e., (without loss of generality) $x_{1} \leqslant \sqrt{n+3}$.

Since $n+3 \geqslant 4$, we can also use $\sqrt{n+3} \leqslant \frac{1}{2}(n+3)$.

Now, from $x_{1} \leqslant \frac{1}{2}(n+3)$ and $x_{2} \leqslant n+3$, it follows that $x_{1}+x_{2} \leqslant \frac{3}{2}(n+3)$, i.e., $3 n \leqslant \frac{3}{2}(n+3)$. Simplifying this inequality, we get the condition $n \leqslant 3$.

It remains to check if the equation has integer solutions for $n=1,2,3$. By substitution and direct verification, we find that the initial equation has integer solutions only for $n=2$.