What can we say about growth of smallest gap $g(a)$ which is the smallest $|x-y|$ where $0\leq x,y\leq\Big\lfloor\frac a2\Big\rfloor$ and $\sqrt{x(a-x)},\sqrt{y(a-y)}\in\Bbb Z$?
Is $g(a)=1\iff a=b^2+1$ (corresponding to $x=0$ and $a-x=b^2+1$ or $x=1$ and $a-x=b^2$)?