TITLE: representability of consecutive integers by a binary quadratic form
QUESTION [14 upvotes]: I have two related questions on the representability of integers 
by quadratic forms in two variables :
(1) Let $f: {\mathbb Z} \times {\mathbb Z} \to {\mathbb Z}  $ be such a quadratic
form, i.e. we have $f(x,y)=ax^2+bxy+cy^2+dx+ey+g$ for some integer constants
$a,b,c,d,e,g$. Suppose that $f$ is not surjective, i.e. some integer is not represented
by $f$. Is it true that there is an integer constant $C$ such that in any block of
$C$ consecutive integers, at least one of them is not represented by $f$ ?
(2) If the answer to (1) is yes, is there a uniform bound ? In other words,
is there a uniform constant $C$ such that for any non-surjective $f$, in any block of
$C$ consecutive integers, at least one of them is not represented by $f$ ?
Update : Good answers to my original questions appeared quickly. It seems the only
interesting subquestion left is the one asked by fedja : 
(2') is there a universal $C$ such that for any $f$ with positive definite  quadratic part, in any block of
$C$ consecutive integers, at least one of them is not represented by $f$ ?
One may also ask, 
(3)  is there a universal $C$ such that for any non-surjective and irreducible $f$,  in any block of
$C$ consecutive integers, at least one of them is not represented by $f$ ?

REPLY [4 votes]: Seems worth recording my thoughts so far. I am sticking with positive forms, which means homogeneous. My guess of $C=31$ was probably larger than necessary, but we will see. Certainly I think there is a finite uniform $C$ and it can be taken quite small. 
It turns out to be quite difficult to have a positive binary represent any string of 7 consecutive positive integers. I finally managed it, $x^2 + x y + 18 y^2$ represents the numbers from 1,953,139 to 1,953,145. Of course, even for this form, most intervals of length 7 contain a nonrepresented number. 
If the discriminant is even there is a congruence obstruction on represented numbers mod 4 or mod 8, of a nature that prevents strings longer than 5. The form $x^2 + 2 y^2$ does well, many strings of length 5 as high as I could check.
If the discriminant is 5 mod 8 no numbers 2 mod 4 are represented. 
So we have explicit bounds of length no more than 5 unless $ \Delta \equiv 1 \pmod 8.$ Even here, for composite discriminant, say $ 3 | \Delta $ any form of that discriminant is restricted to all quadratic residues or all quadratic nonresidues $ \pmod 3 ,$ maximum length 3. Similar for  $ 5 | \Delta $ or  $ 7 | \Delta .$
The way to get big lengths is prime discriminants with either a long set of consecutive residues or a long set of consecutive nonresidues. Residues seem a better bet, as if 2,3,5 are residues then so are 1,2,3,4,5,6. And, indeed we have $ 1953139 \equiv 0 \pmod {71}, \ldots, \;  1953145 \equiv 6 \pmod {71} .$ Note that 7 is a nonresidue mod 71, the first nonresidue is always prime (for a prime modulus). 
Note that Fedja's argument also concerns the first nonresidue $q.$ Whatever else may or may not matter, the maximum length is $2 q - 1,$ for a possible interval from $ k q^2 - q + 1$ through to $ k q^2 + q - 1.$