## 1. Find all primes $p, q$ such that the equation $x^{2}+p x+q=0$ has at least one integer root.  (Patrik Bak)


Solution. Denote the integer root by $a$. Then $a^{2}+p a+q=0$, hence $a \mid q$ which implies $a \in\{ \pm 1, \pm q\}$. We distinguish those four cases.

$\triangleright$ If $a=-1$ then $p-q=1$, hence $(p, q)=(3,2)$.

$\triangleright$ If $a=1$ then $p+q+1=0$, which has no solution.

$\triangleright$ If $a=q$ then $q^{2}+p q+q=0$ and after dividing by (positive) $q$ we get $q+p+1=0$ which has already been covered.

$\triangleright$ If $a=-q$ then $q^{2}-p q+q=0$ and after dividing by $q$ we get $p-q=1$ which has already been covered.

The only candidate is $(p, q)=(3,2)$ and we easily check that it is indeed a valid solution.

Another solution. Let $x_{1}, x_{2}$ be the roots of the equation. By Viète relations we get $x_{1}+x_{2}=-p$ and $x_{1} x_{2}=q$. The first equation implies that if one root is an integer then so is the other one. The second equation then implies that the roots are either 1 and $q$ or -1 and $-q$. In the first case we don't get any solutions, in the second case we require $p-q=1$ which gives a unique solution $(p, q)=(3,2)$ among primes.
