How many solutions are there to $n\_1^2-n\_2^2-n\_3^2+n\_4^2=k$ where $n\_i\in [1,N]$ and $n\_i,k\in \mathbb Z$?


For $k=0$ by paucity we know it should be $\ll N^2 \log N$ but what about different $k$?



How many solutions are there to $n_1^2-n_2^2-n_3^2+n_4^2=k$?
Let us allow $n\_i\in[-N,N]$ for simplicity; this will not change the order of magnitude of the number of solutions. So let us consider
$$R(k,N):=\#\left\{(n\_1,n\_2,n\_3,n\_4)\in\{-N,\dotsc,N\}^4:n\_1^2-n\_2^2-n\_3^2+n\_4^2=k\right\}.$$
Let us also assume that $k$ is odd, and $N\gg\sqrt{k}$ with a sufficiently large implied constant.


If $r(n)$ denotes the number of ways $n$ can be written as a sum of two squares, then clearly
$$\sum\_{m\leq N^2-k}r(m)r(m+k)\leq R(k,N)\leq\sum\_{m\leq 2N^2}r(m)r(m+k).$$
Hence it follows from Theorem 12.5 in Iwaniec: Spectral methods of automorphic forms (2nd ed.) that
$$R(k,N)\asymp \Bigl(\sum\_{d\mid k}d^{-1}\Bigr)N^2.$$
The same result would also follow from Theorem 4 in Heath-Brown: A new form of the circle method, and its application to quadratic forms, J. reine angew. Math. 481 (1996), 149-206, upon calculating the singular series $\sigma(x\_1^2-x\_2^2-x\_3^2+x\_4^2,k)$ there.


Surely, with more work, an asymptotic formula can also be derived, and the result should be extendable to even $k$ as well.


