3. Determine all pairs $(p, q)$ of integers such that $p$ is an integer multiple of $q$ and the quadratic equation $x^{2} + p x + q = 0$ has at least one integer root.

The written part of the school round in category A takes place

## on Tuesday, December 9, 2014

so that it starts in the morning and the contestants have 4 hours of pure time to solve the problems. For each problem, a contestant can earn 6 points, and a successful solver is a student who scores 10 points or more. Allowed aids are writing and drawing supplies and school MF tables. Calculators, laptops, and any other electronic aids are not allowed. These details will be communicated to the students before the start of the competition.

## 64th Mathematical Olympiad

Solutions to the problems of the written part of the school round in category A
3. Throughout the solution, for simplicity, the term multiple will always mean an integer multiple.

Assume that the pair $(p, q)$ of integers satisfies the conditions of the problem. If the quadratic equation has one integer root, then the other root is also an integer, because according to Vièta's formulas, the roots $x_{1}, x_{2}$ and the coefficient $p$ of the quadratic equation satisfy the condition $x_{1}+x_{2}=-p$. For both integer roots $x_{1}, x_{2}$, it also holds that $x_{1} x_{2}=q$.

According to the problem statement, the sum $x_{1}+x_{2}$ is a multiple of the product $x_{1} x_{2}$, and thus a multiple of each of the roots $x_{1}, x_{2}$. The difference of two multiples of a given number is again a multiple of that number, so $\left(x_{1}+x_{2}\right)-x_{1}=x_{2}$ is a multiple of the number $x_{1}$. Similarly, $x_{1}$ is a multiple of the number $x_{2}$. For the roots to be multiples of each other, it must hold that either $x_{2}=-x_{1}$ or $x_{2}=x_{1}$. We will investigate both cases separately.

- If $x_{2}=-x_{1}$, then $p=-\left(x_{1}+x_{2}\right)=0$ and $q=-x_{1}^{2} \leqq 0$. Since 0 is a multiple of any integer, the value of $x_{1}$ can be any integer, and the pair $(p, q)=\left(0,-n^{2}\right)$, where $n$ is any integer (to generate all distinct solutions, it is sufficient to consider only non-negative values of $n$), satisfies the problem.
- If $x_{2}=x_{1}=x$, then $p=-2 x$ and $q=x^{2}$. For $2 x$ to be a multiple of $x^{2}$, it must hold that either $x=0$ or 2 is a multiple of $x$. The first case corresponds to the solution $(p, q)=(0,0)$, which we have already obtained in the previous case for $n=0$. In the second case, $x$ lies in the set $\{-2,-1,1,2\}$, which correspond to the pairs $(p, q) \in \{(-4,4),(-2,1),(2,1),(4,4)\}$. All four clearly satisfy the conditions of the problem.

Answer. The pairs $(-4,4),(-2,1),(2,1),(4,4)$, as well as all pairs $\left(0,-n^{2}\right)$, where $n$ is any non-negative integer, and no others, satisfy the problem.

Alternative solution. Assume that the pair $(p, q)$ satisfies the problem, and let $x_{1}$ be the integer root of the given equation and $k$ be an integer such that $p=k \cdot q$. Then it holds that

$$
x_{1}^{2}+k x_{1} q+q=0 \quad \text { or } \quad x_{1}^{2}=-q\left(k x_{1}+1\right) \text {. }
$$

In the case that $x_{1}=0$, we get $q=0$, and thus $p=0$.

If $x_{1} \neq 0$, then $x_{1}^{2}$ is a non-zero multiple of the number $k x_{1}+1$. Since the numbers $k x_{1}+1$ and $x_{1}$, and thus the numbers $k x_{1}+1$ and $x_{1}^{2}$, are coprime, ${ }^{3}$ this is only possible if $k x_{1}+1 \in \{1,-1\}$.

- If $k x_{1}+1=1$, then $k x_{1}=0$ and from the non-zero value of $x_{1}$ it follows that $k=0$. Therefore, $q=-x_{1}^{2}, p=0$ and similarly as in the first solution, we get the pairs $(p, q)=\left(0,-n^{2}\right)$, where $n$ is any integer (the value $n=0$ includes the case $x_{1}=0$, which we have already checked separately).
- If $k x_{1}+1=-1$, then $k x_{1}=-2$, so the pair $\left(k, x_{1}\right)$ is one of the pairs $(1,-2)$, $(2,-1),(-2,1),(-1,2)$. We can easily compute $p=k x_{1}^{2}=-2 x_{1}$ and $q=x_{1}^{2}$, and thus obtain the remaining solutions as in the first method.

Note. The analysis of the equation

$$
x_{1}^{2}+k x_{1} q+q=0
$$

from the previous solution can also be performed without considering coprimality. Indeed, from (1) it follows that $q \mid x_{1}^{2}$ and $x_{1} \mid q$, from which $x_{1}^{2} \mid x_{1} q$, and thus from (1) it follows that $x_{1}^{2} \mid q$, which together with $q \mid x_{1}^{2}$ leads to the conclusion that $q= \pm x_{1}^{2}$. Substituting $q=x_{1}^{2}$ into (1) transforms it into the form $x_{1}^{2}\left(2+k x_{1}\right)=0$, and substituting $q=-x_{1}^{2}$ into the form $k x_{1}^{3}=0$. The conclusion of the solution is then the same as in the original method.

For a complete solution, award 6 points. In the first method, award 2 points for stating Vièta's formulas along with the argument for the integrality of $x_{2}$, 2 points for deriving $x_{2}= \pm x_{1}$, and 1 point for completing each branch. In the second method, award 2 points for deriving the equation $x_{1}^{2}=-q\left(k x_{1}+1\right)$, 2 points for explaining why $k x_{1}+1 \in\{1,-1\}$, and 1 point for completing each case. If the student does not consider one of the branches and thus misses some solutions, award a maximum of 4 points. If the student does not solve the problem but guesses all solutions, award 2 points; for guessing one (complete) branch of the solution, award 1 point.[^2]

[^0]:    1 One implication easily follows from the congruence of the segments of the tangents from any vertex of a tangential quadrilateral to the inscribed circle.

[^1]:    2 A circle can also be circumscribed around them, so they are even bicentric in the given situation.

[^2]:    3 The numbers $k x_{1}+1$ and $x_{1}$ can also be negative, but coprimality is well-defined even then.