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.
All perfect squares are congruent to either $0$ or $1$ modulo $4$.
So $3-4\lambda$ is not a perfect square for any integer $\lambda$.