Given $y$, is $-\left(\dfrac{x - y}{2}\right)^2$ is a quadratic residue $\pmod x$?

43 Views Asked by At

I am trying to find a formula for some circle packings when the following arose. I am wondering if there is a nice way to find which $y$ yield $-\left(\dfrac{x - y}{2}\right)^2$ a quadratic residue $\pmod x$?

Obviously, $x, y \in \mathbb Z$, and $x > y$. I have tested lots of cases and I can't even find a slight pattern.

The question is equivalent to asking if there exists an $n \in \mathbb Z$ such that \begin{align*} n^2 &\equiv - \left(\dfrac{x - y}{2}\right)^2 \pmod x \\ -n^2 &\equiv \dfrac{x^2 - 2xy + y^2}{4} \pmod x \\ -4n^2 &\equiv x^2 - 2xy + y^2 \pmod x \end{align*}

Note that the expression on the RHS is a BQF.