Task 3. Find all positive integers $k$ for which the equation

$$
\operatorname{lcm}(m, n)-\operatorname{gcd}(m, n)=k(m-n)
$$

has no positive integer solutions $(m, n)$ with $m \neq n$.
Solution. Let $d=\operatorname{gcd}(m, n)$ and write $m=d a$ and $n=d b$. It holds that $\operatorname{lcm}(m, n) \cdot \operatorname{gcd}(m, n)=m n$, so we can write the given equation as

$$
\frac{d a \cdot d b}{d}-d=k(d a-d b)
$$

or equivalently

$$
a b-1=k(a-b) .
$$

From now on, we will look at the equivalent problem: find all positive integers $k$ for which this new equation has no positive integer solutions $(a, b)$ with $a \neq b$ and $\operatorname{gcd}(a, b)=1$. Note that if a pair $(a, b)$ satisfies this equation, it automatically follows that $\operatorname{gcd}(a, b)=1$. Suppose that $t \mid a$ and $t \mid b$, then $t \mid a b$ and $t \mid a-b$, so $t \mid 1$, so $a$ and $b$ have no common divisor greater than 1.

First, assume that $k \geq 3$. We claim that $(a, b)=\left(k^{2}-k-1, k-1\right)$ is a solution. Indeed, we have

$a b-1=a(k-1)-1=k a-a-1=k a-k^{2}+k+1-1=k a-k^{2}+k=k(a-k+1)=k(a-b)$.

We have already seen that this immediately implies that $\operatorname{gcd}(a, b)=1$. We still need to check that $a$ and $b$ are positive and that they are not equal. Since $k \geq 3$, we have $b=k-1 \geq 2$ and $a=k^{2}-k-1 \geq 2 k-k-1=k-1 \geq 2$, so they are both positive. Suppose that $a=b$, then $k^{2}-k-1=k-1$, or $k^{2}=2 k$, or $k=2$, a contradiction. Thus, our pair $(a, b)$ satisfies all the conditions. For every $k \geq 3$, the equation has at least one solution $(a, b)$ with $a \neq b$ and $\operatorname{gcd}(a, b)=1$.

Now assume that $k=1$. We claim that $(a, b)=(2,1)$ is a solution. Clearly, $a$ and $b$ are positive and not equal. Furthermore, we have

$$
a b-1=2-1=1=1 \cdot(2-1)=k(a-b) .
$$

So for $k=1$, the equation also has at least one solution $(a, b)$ with $a \neq b$ and $\operatorname{gcd}(a, b)=1$.

Finally, assume that $k=2$. The equation becomes

$$
a b-1=2(a-b) .
$$

The right-hand side is at most $2 a-2$ because $b$ is positive and an integer, so $a b-1 \leq 2 a-2$, hence $a b<2 a$, so $b<2$. Therefore, we must have $b=1$. The equation then becomes $a-1=2(a-1)$, which implies $a-1=0$. We then have $a=1$ and $b=1$, so $a=b$. We conclude that there are no solutions $(a, b)$ with $a \neq b$.

Thus, the only $k$ for which the original equation has no positive integer solutions $(m, n)$ with $m \neq n$ is $k=2$.