5-0. A certain quadratic trinomial $x^{2}-p x+q$ has integer roots $x_{1}$ and $x_{2}$. It turns out that the numbers $x_{1}$, $x_{2}$, and $q$ form a decreasing arithmetic progression. Find the sum of all possible values of $x_{2}$.
Answer: -5

Solution. By Vieta's theorem $q=x_{1} x_{2}$. Then $2 x_{2}=x_{1}+x_{1} x_{2}$, from which $x_{1}=\frac{2 x_{2}}{1+x_{2}}$. Since the roots are integers, $2 x_{2}$ is divisible by $1+x_{2}$. But $2+2 x_{2}$ is divisible by $1+x_{2}$, which means 2 is also divisible by $1+x_{2}$. Therefore, $x_{2}=-3,-2,0$ or 1. In these cases, $x_{1}$ takes the values $3,4,0$ and 1. Since $x_{2}<x_{1}$, only the first two options are suitable, from which the sum of possible values of $x_{2}$ is -5.