Given that, with integers $t \geq 1$ and $q \geq 3,$ there are solutions to $$ x^2 - q x y + y^2 = - t q $$ 
with integers $x,y \geq 1,$ I was able to show that
$$ q \leq 1 + \frac{324}{25} t^2. $$


If there is any solution $(x,y),$ there are infinitely many, as this is an indefinite quadratic form in $(x,y).$ Hurwitz, and others, emphasized finding solutions that minimized $x+y.$ This has some tendency to shrink $xy$ as well; 
in particular, if there is any solution, there is at least one with
$$ t < xy < 4 t. $$ 


For any $t,$ there is always a solution $x = t + 1, y = 1, q = t^2 + 2 t + 2.$ I found enough inequalities to find all solutions with $t \leq 8192,$ in that range all $q$ values satisfied $$ q \leq t^2 + 2 t + 2 = (t+1)^2 + 1. $$


That's the question, for any $t,$ is it always the case that $ q <= t^2 + 2 t + 2?$



```
     x     2     y     1    t      1    q      5  +++  

     x     2     y     2    t      2    q      4
     x     3     y     1    t      2    q     10  +++  

     x     2     y     2    t      3    q      8
     x     3     y     3    t      3    q      3
     x     4     y     1    t      3    q     17  +++  
     x     4     y     2    t      3    q      4
     x     5     y     1    t      3    q     13

     x     4     y     2    t      4    q      5
     x     5     y     1    t      4    q     26  +++  

     x     3     y     2    t      5    q     13
     x     6     y     1    t      5    q     37  +++  
     x     7     y     1    t      5    q     25

     x     3     y     3    t      6    q      6
     x     4     y     2    t      6    q     10
     x     7     y     1    t      6    q     50  +++  


=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=



     x    96     y    96    t   8192    q     18
     x   100     y    84    t   8192    q     82
     x   108     y    76    t   8192    q   1090
     x   128     y   128    t   8192    q      4
     x   152     y    56    t   8192    q     82
     x   158     y    54    t   8192    q     82
     x   176     y    48    t   8192    q    130
     x   188     y    44    t   8192    q    466
     x   192     y    64    t   8192    q     10
     x   228     y    36    t   8192    q   3330
     x   240     y    48    t   8192    q     18
     x   241     y    37    t   8192    q     82
     x   267     y    31    t   8192    q    850
     x   277     y    33    t   8192    q     82
     x   288     y    32    t   8192    q     82
     x   344     y    24    t   8192    q   1858
     x   397     y    21    t   8192    q   1090
     x   416     y    32    t   8192    q     34
     x   420     y    20    t   8192    q    850
     x   440     y    24    t   8192    q     82
     x   526     y    22    t   8192    q     82
     x   528     y    16    t   8192    q   1090
     x   551     y    15    t   8192    q   4162
     x   590     y    14    t   8192    q   5122
     x   592     y    16    t   8192    q    274
     x   633     y    13    t   8192    q  10834
     x   661     y    13    t   8192    q   1090
     x   684     y    12    t   8192    q  29250
     x   716     y    12    t   8192    q   1282
     x   796     y    12    t   8192    q    466
     x   804     y    20    t   8192    q     82
     x   912     y    16    t   8192    q    130
     x   913     y     9    t   8192    q  33346
     x  1032     y     8    t   8192    q  16642
     x  1064     y     8    t   8192    q   3538
     x  1171     y     7    t   8192    q  274258
     x  1251     y     7    t   8192    q   2770
     x  1256     y     8    t   8192    q    850
     x  1366     y     6    t   8192    q  466498
     x  1374     y     6    t   8192    q  36306
     x  1614     y     6    t   8192    q   1746
     x  1928     y     8    t   8192    q    514
     x  1942     y     6    t   8192    q   1090
     x  2052     y     4    t   8192    q  263170
     x  2068     y     4    t   8192    q  53458
     x  2100     y     4    t   8192    q  21202
     x  2196     y     4    t   8192    q   8146
     x  2308     y     4    t   8192    q   5122
     x  2484     y     4    t   8192    q   3538
     x  2759     y     3    t   8192    q  89554
     x  2788     y     4    t   8192    q   2626
     x  2899     y     3    t   8192    q  16642
     x  3303     y     3    t   8192    q   6354
     x  3972     y     4    t   8192    q   2050
     x  4098     y     2    t   8192    q  4198402
     x  4890     y     2    t   8192    q  15058
     x  8066     y     2    t   8192    q   8194
     x  8193     y     1    t   8192    q  67125250  +++  
     x  8245     y     1    t   8192    q  1282642
     x  8977     y     1    t   8192    q  102658
     x  9805     y     1    t   8192    q  59602
     x 16257     y     1    t   8192    q  32770

```

See
<https://math.stackexchange.com/questions/829228/is-it-true-that-fx-y-dfracx2y2xy-t-has-only-finitely-many-distinct-i/1469246#1469246>



optimal bound in diophantine representation question
$x^2+y^2=kq$ for some positive integer $k$. Since $x\ge1$ and $y\ge1$, this implies $xy\ge\sqrt{kq-1}$. Then $$-tq=x^2-qxy+y^2\le kq-q\sqrt{kq-1}$$ which says $-t\le k-\sqrt{kq-1}$, $\sqrt{kq-1}\le t+k$, $kq-1\le t^2+2kt+k^2$, $$q\le{t^2\over k}+2t+k+{1\over k}$$ If $k=1$, this gives $q\le t^2+2t+2$, as desired. In general, we want to show $${t^2\over k}+2t+k+{1\over k}\le t^2+2t+2$$ This works out to be equivalent to $t^2\ge k-1$, so let's prove that. 


We have $kq-qxy=-tq$, so $k-xy=-t$, so $$t^2=x^2y^2-2kxy+k^2\ge(kq-1)-kq+k^2=k^2-1\ge k-1$$ where we have used $xy\le q/2$, which follows from $x^2+y^2\ge q$, which follows from $q\mid(x^2+y^2)$. 


There's probably an easier way. 


