# Gap principle for a diophantine inequality

Let $d$ be a positive, non-square integer, and let $B > 1$ be a real number. Consider the inequality

$$|x^2 - dy^2| \leq B.$$

This inequality has infinitely many solutions in integers $x$ and $y$ (for example, there are already infinitely many solutions to the Pell equation $x^2 - dy^2 = 1$). Let $T > 1$ be a positive number, and consider the subset of solutions to the above inequality satisfying

$$\displaystyle |x - y\sqrt{d}| < B^{1/2} T^{-1}$$ and $$\displaystyle |x + y \sqrt{d}| > B^{1/2} T.$$

Suppose there exists $k > 1$ such that $1/2k < B^{1/2}T^{-1} < 1/k$. Are distinct integral solutions $(x,y), (u,v)$ satisfying the above inequalities necessarily bounded away from each other? If so, what are the best general bounds in terms of $B,T,k$ and $d$? One can assume that there exists $0 < \alpha \leq 1$ such that $d \leq B^\alpha$.

Any help would be appreciated.

• What do you mean when you ask for two pairs of integers to bounded away from each other? Are you looking for $|x-y\sqrt{d}-(u-v\sqrt{d})|>z$, for all $u,v,x,y$ for some $z$ depending only on $B, T, k,$ and $d$? Is $k$ only here so you can increase $B$ and $T$ together within some uniform bounds, or are you using it for something else? Should the $B$ in the definition of $k$ also have a squareroot? – Zack Wolske Apr 8 '17 at 14:55
• Yes, there should be a square root there. Your interpretation of $z$ is in line with what I am thinking. The $k$ is present because I am emphasizing that $B^{1/2} T^{-1}$ is bounded away from 1. – Stanley Yao Xiao Apr 8 '17 at 15:03
• Maybe I'm missing an important assumption, but tell me why this doesn't work: Fix $d$ and $B$. The unit group in the real quadratic field you mention is generated by say $a+b\sqrt{d}>1$, so for a given $T$, we can find solutions $(a+b\sqrt{d})^{-n}<B^{1/2}T^{-1}$ for every large enough $n$. These converge to $0$, so the difference of two can be arbitrarily small, while $z$ should be constant since we've fixed everything it depends on. Do you want $|x^2-dy^2|\neq|u^2-dv^2|$, or even more, in different square classes? – Zack Wolske Apr 8 '17 at 16:44
• @ZackWolske In a problem of this sort, one measures the distance between solutions using the $(x,y)$ coordinates in $\mathbb Z^2$, not the absolute value of $x+\sqrt d y$. So for distinct solutions $(x_1,y_1)$ and $(x_2,y_2)$, one is looking for a lower bound for $\max\{ |x_1-x_2|,|y_1-y_2| \}$. – Joe Silverman Apr 8 '17 at 16:55
• @Joe thanks, that's what I was asking for in my first comment. – Zack Wolske Apr 8 '17 at 17:02

Conjecture If $(s,t)$ and $(u,v)=(s+i,t+j)$ are in $\{{(x,y) \mid |x^2-dy^2| \le B\}}$ then, under the right conditions, $$i \ge \frac{s}{2B}-\frac{s}{8B^2}.$$ (Near) equality occurs when $s^2-dt^2=\mp B,$ $u^2-dv^2=\pm B$ and $i^2-dj^2=\pm 1.$

By the right conditions I mean something vaguely like $d\sqrt{d} \lt B$ and $B\sqrt{B}<s.$ Also, $i \gt \frac{s}{2B}$ is probably accurate enough except, perhaps, for small $B.$ This is based on rough calculations combined with limited numerical data. I'd suggest clarifying the question, gathering more numerical data and improving the conjecture before attempting a more careful justification. However I think the following observations will help clarify the reasoning. I'll also attempt to relate it to the question as asked in terms of $T$ and $k.$. I don't really understand those conditions but I mainly looked at them before $B$ was corrected to $\sqrt{B}.$

If $x^2-dy^2=C$ (so here $-B \le C \le B$) then $x-y\sqrt{d} \approx \frac{C}{2x}$ and $x+y\sqrt{d}\approx 2x-\frac{C}{2x}.$ I'll assume that $x,y \ge 0$ so we are looking at the set $$S_{d,B}=\{{(x,y) \in \mathbb{N}^2\mid |x^2-dy^2|\le B\}}$$ of lattice points (in the positive quadrant) between the two assymptotes $y=\frac{x}{\sqrt{d}}\pm \frac1{2\sqrt{d}x}$ to the line $y=\frac{x}{\sqrt{d}}.$ Specifically the minimum gap between points $(s,t)$ and $(u,v)=(s+i,t+j)$ in that set. I'll measure the gap as simply $u-s=i$ since $v-t=\frac{i}{\sqrt{d}}+O({\frac{1}{s^3}}).$

So when $s^2-dt^2=-B,$ $u^2-dv^2=B$ and $i^2-dj^2=-1$ we can take the equations

• $t\sqrt{d}=s+\frac{B}{2s}$

• $v\sqrt{d}=u-\frac{B}{2s}$

• $j\sqrt{d}=i-\frac{1}{2i}$

• $(s,t)+(i,j)=(u,v)$

Combining these leads to $$B-{\frac {s}{i}}-{\frac {{B}^{2}}{4{s}^{2}}}+{\frac {B\,i}{s}}-1-\frac{1}{4{i}^{2}} =-B.$$ Dropping the very small terms leaves $$2B-{\frac {s}{i}}+{\frac {B\,i}{s}}-1=0.$$ Solving this quadratic equation for $i$ (and using $\sqrt{4B^2+1} \approx 2B+\frac{1}{4B}$) yields

$$i=\frac{s}{2B}-\frac{s}{8B^2}.$$

DATA: For $d=2$ and $B=500$ there are $245$ points in $S_{2,500}$ with $10^6 \lt x \lt 2\cdot 10^6.$ The differences $(i,j)$ between successive points come out to $$[[47321, 33461], 139], [[66922, 47321], 62], [[114243, 80782], 27], [[19601, 13860], 16]$$ Here $i^2-2j^2$ is $1,2,-1,1$ respectively. Also, $1.028\frac{s}{2B} \lt i \lt 5.54\frac{s}{2B}$ The lower bound on $i$ is achieved for the points $$(s,t)=(19061766, 13478704),(u,v)=(19081367, 13492564)$$ with $$(i,j)=(19601, 13860).$$ Note that $s^2-2t^2=-476,$ $u^2-2v^2=497$ and $i^2-2j^2=1.$

Since we have two points very close to the line, It seems reasonable to expect $|i^2-dj^2|<B.$ Perhaps even $|i^2-dj^2|<d$ (provided things are appropriately sized.) The best case for a (relatively) small gap would seem to be if $$s^2-dt^2=\mp B,\ i^2-dj^2=\pm 1,\ u^2-dv^2=\pm B.$$ This leads to the computations above.

Aside: I'm not sure if it is needed, but it would be reasonable to conjecture that the number of points in $S_{B,d}$ with $a\lt x \lt b$ is roughly $$\int_a^b\frac{B}{x\sqrt{d}}=\frac{B}{\sqrt{d}}\ln(\frac{b}{a}).$$ That is indeed quite accurate, where I looked, but it fails badly for $B=1$ where we know that the solutions to $x^2-dy^2=\pm1$ are given by $x+y\sqrt{d}=(x_0+y_0\sqrt{d})^i$ for $(x_0,y_0)$ the smallest positive solution. For $d=61$ that is $29718+3805\sqrt{61}$ while it is $8+1\sqrt{63}$ for $d=63.$ In both cases it fails badly. However the estimate was quite accurate in both cases (and also for $d=2$) for $B=500.$

Of course the $x$ values which occur are from a few geometric progressions (with gentle rounding) all with ratio $x_0+y_0\sqrt{d}$ coming from specific values of $x^2-dy^2$ however they appear to blend together well if $B$ is not too small.

For example $|x^2-2y^2|$ can take the values $50,56,62$ but none in between. So $B=50$ and $B=55$ are exactly the same and $B=62$ may not be that different from $B=50.$

Let me now turn to the question as asked. Something looks wrong here but perhaps someone else will want to fix it.

Rather than starting with $T,$ first pick an integer $k$ and then pick $T$ with $k\sqrt{B} \lt T \lt 2k\sqrt{B}.$ Using only the lower bound, the condition $s+t\sqrt{d} \gt T\sqrt{B}$ essentially becomes $$s \gt \frac{Bk+\sqrt{B^2k^2 + 4C}}{4}$$ Where $C=s^2-dt^2$ so $-B \le C \le B.$

It seems pretty safe to use $\sqrt{B^2k^2 + 4C} \approx Bk+\frac{2C}{kB}$ if $k$ is not too small,but maybe not when $k=1,|C|=B.$

Forging ahead, $$s \gt \frac{Bk}{2}+\frac{C}{2kB}.$$ The other condition $|s-t\sqrt{d}| \lt \sqrt{B}T^{-1}$ becomes $\frac{|C|}{2s} \lt \frac1{k}$ so $$\frac{|C|k}{2} \lt s \lt |C|k.$$

If that seems reasonable, then the bound above of $i \ge \frac{s}{2B}$ becomes $$i \gt \frac{k}{4}+\frac{C}{4B^2k}.$$ That does not seem too promising since $i$ is an integer. Is that really the correct bound for what you want?

• I think your conjecture is quite close to being true, at least when $X$ is very large compared to $\sqrt{d}$. If you mod out by the action of the unit group, then you can always shrink the interval $[a,b]$ in the conjecture to one that has length $\log \varepsilon_d$, the regulator of the corresponding quadratic order, and when $X$ is large that is exactly the asymptotic. – Stanley Yao Xiao Oct 23 '17 at 12:51