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$)?



Elementary description to count of perfect squares - II
*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$)*


No. It may happen, that, say, $x,a-x$ are perfect squares and $x+1$, $a-x-1$ are twice perfect squares. These Pell type equations have infinitely many solutions, the smallest is $x=1,a-x=9$. 


