Pedrinho wrote two positive integers on a piece of paper and showed them to Joãozinho. After that, Pedrinho calculated double the product of these two numbers. Joãozinho added 21 to double the first number and then added the result to the second number. To their surprise, the result was the same. What are the possible numbers that Pedrinho wrote on the piece of paper?

#
Solution

Let $x$ and $y$ be the numbers written by Pedrinho. Then the number that Pedrinho calculated was $2 x y$, while Joãozinho calculated $21+2 x+y$. Since they found the same result, it follows that:

$$
2 x y=2 x+y+21
$$

Let's now manipulate the equation above:

$$
\begin{aligned}
2 x y-2 x & =y+21 \\
2 x(y-1) & =y+21
\end{aligned}
$$

In the second step, we factor out $2 x$. The idea now is to make a $y-1$ appear on the right side. For this, we just need to add and subtract 1.

$$
\begin{aligned}
2 x(y-1) & =y-1+1+21 \\
2 x(y-1) & =(y-1)+22 \\
2 x(y-1)-(y-1) & =22 \\
(2 x-1)(y-1) & =22
\end{aligned}
$$

In the last step, we factor out $(y-1)$. Using that $x$ and $y$ are positive integers, we have that $2 x-1$ and $y-1$ are integers that cannot be negative. Therefore, we have two integers that, when multiplied, give 22. Thus, we have that

$$
\begin{aligned}
& 2 x-1=1 \quad \text { and } \quad y-1=22 \quad \text { or } \\
& 2 x-1=2 \quad \text { and } \quad y-1=11 \quad \text { or } \\
& 2 x-1=11 \quad \text { and } \quad y-1=2 \quad \text { or } \\
& 2 x-1=22 \quad \text { and } \quad y-1=1
\end{aligned}
$$

But since $2 x-1$ is always an odd number, the second and fourth cases above cannot happen. Therefore, the numbers written by Pedrinho are 1 and 23 or 6 and 3.