Sketch. Let $n=k^2+i$ for $0\le i\le 2k$ (that is $\lfloor \sqrt{n}\rfloor =k$). With this, we get $k-1\mid k^2+i+1$ and $k+2\mid k^2+i+4$. As $k\equiv 1\pmod{k-1}$ we get that $k^2+i+1\equiv i+2\pmod{k-1}$, yielding $k-1\mid i+2$. Likewise, $k+2\mid k^2+i+4$ implies $k+2\mid i+8$. Now if $i+2\ge 3(k-1)$ then $2k+2\ge i+2\ge 3k-3\implies 5\ge k$, a finite casework that is easily handled. Otherwise $i+2=k-1$ or $i+2=2(k-1)$. If $i=k-3$ then $k+2\mid i+8\implies k+2\mid k+5$, namely $k+2\mid 3$ forcing $k=1$. The case $i+2=2(k-1)$ is handled analogously.