Let $B:\Bbb{Z}^n\times\Bbb{Z}^n\to\Bbb{Z}$ be a positive-definite bilinear form. If $x:=(x_1,...,x_n)$, we define $q(x):=B(x,x)$.
I'm interested in the following question:
Is there a value $L$ (depending only on $q$) such that for every $m\in \Bbb{N}$ there is some $x\in \Bbb{Z}^n$ with $q(x)\in[m-L,m+L]$?
I know that when $n=1$ such $L$ cannot exist: Let's say $q(x)=x_1^2$. Since consecutive squares $n^2$ and $(n+1)^2$ can get indefinitely further apart, we can choose some $m$ right between them, so that moving $m$ left or right by $L$ units is not enough to reach either $n^2$ or $(n+1)^2$.
For $n\geq 2$ I've tested some cases and the existence of $L$ looked very convincing. For example, if $q(x)=x_1^2+x_2^2$, the first possible values of $q(x)$ are $$5,10,13,17,20,25,26,29,34,37,40,...$$
So it looks like $5$ is a good guess for $L$. Now if $q(x)=x_1^2+x_2^2+x_3^2$, the first values are $$7, 15, 23, 28, 31, 39, 47, 55, 60, 63, 71...$$
In this case $L=8$ looks good enough.
The case $q(x)=x_1^2+x_2^2+x_3^2+x_4^2$ can be solved by Lagrange's theorem, and we even have $L=0$.
Is this something already well-known?
From the Chinese Remainder Theorem, for any positive integer $k$ there exists an integer $n$ such that
$$n \equiv 3 \bmod 9,$$ $$n+1 \equiv 7 \bmod 49,$$ $$n+2 \equiv 11 \bmod 121,$$ up to $$n+k-1 \equiv p_k \bmod p^2_k,$$ where $p_k$ is the $k$th prime which is $3 \bmod 4$. But then none of the $k$ numbers $[n,n+1,\ldots,n+k-1]$ can be represented as a sum of two squares, since any prime factor $3 \bmod 4$ of a sum of two squares has to occur to even exponent. So there is no $L$ in this case.
The result is true for $n \ge 3$, however. This is related to Hilbert's 11th problem; associated to $q$ is a modular form of weight $n/2$ and for $n/2 \ge 3/2$ the main term is given by an Eisenstein series, whose coefficients depend only on congruence conditions at a finite number of primes.
For the case $x^2_1+x^2_2+x^3_2$, for example, it was already shown (by Gauss?) that an integer has such a representation as long as $n \ne 4^m (8k+7)$, so the there are at most two consecutive terms not of this form (you computations seemed to leave out $x_i=0$ for some reason).