Problem 3. For each natural number $n \geq 2$, we denote by $s(n)$ the number of pairs $(x, y)$ of natural numbers, chosen from $1,2, \ldots, n$, with $x>y$, such that $x$ and $y$ have exactly $x-y$ common divisors.

a) Does there exist $n$ such that $s(n)=2019$?

b) Does there exist $n$ such that $s(n)=2020$?

Justify your answers.
Solution and grading. We observe that if $d \mid y$ and $d \mid x$ then $d \mid x-y \ldots \ldots \ldots \ldots \ldots \ldots 1 p$

Therefore, if $(x, y), x>y$, is a pair with the property from the statement, then $x-y$ has exactly $x-y$ divisors, so all the numbers $1,2, \ldots x-y$. If $x-y=1$ then $x$ and $y$ have only one divisor, which is 1 ....

Otherwise $x-y \geq 2$, so $x-y-1 \geq 1$, and $x-y-1 \mid x-y$ implies $x-y-1=1$, i.e., $x-y=2$. Therefore, $x$ and $y$ have the same parity. For $x$ and $y$ to have exactly 2 common divisors, they cannot both be odd, so they must both be even. Thus, pairs of this type are of the form $(y+1, y)$ and $(2 y+2,2 y)$, with $y$ a non-zero natural number...

It follows that for $n=2 k, k$ a natural number, we have $s(n)=(2 k-1)+(k-1)=3 k-2$, and if $n=2 k+1, k \geq 1$ we have $s(n)=2 k+(k-1)=3 k-1$. Since $s(n)$ cannot be a multiple of 3, the answer to a) is no............................................................

Since $2020=3 \cdot 674-2$ we get that $s(1348)=3 \cdot 674-2=2020$, so the answer to b) is yes.