If I have a pair of integers, $X$ and $Y$, I would like to find an integer $\lambda$ such that $$ X - \lambda Y = t^2 $$ where $t$ is any other integer. All these integers can be either positive or negative.
Just wondering whether there is an simple formula or algorithm for finding either one or all the solutions.