Problem

Source: Moldova TST 2019

Tags: number theory



For any positive integer $k$ denote by $S(k)$ the number of solutions $(x,y)\in \mathbb{Z}_+ \times \mathbb{Z}_+$ of the system $$\begin{cases} \left\lceil\frac{x\cdot d}{y}\right\rceil\cdot \frac{x}{d}=\left\lceil\left(\sqrt{y}+1\right)^2\right\rceil \\ \mid x-y\mid =k , \end{cases}$$where $d$ is the greatest common divisor of positive integers $x$ and $y.$ Determine $S(k)$ as a function of $k$. (Here $\lceil z\rceil$ denotes the smalles integer number which is bigger or equal than $z.$)