# Non-pythagorean triples

Euclid's formula gives a recipe for generating all possible Pythagorean triples $a^2+b^2 = c^2$ exactly once; for set of positive integers $k$ and $m>n$ ($m$ relatively prime to $n$, exactly one of $m$ and $n$ odd), define

$$a=k(m^2-n^2)\qquad b= k(2mn)\qquad c=k(m^2+n^2).$$

I am wondering if we can derive a similar simple parameterized formula for enumerating a set of non-pythagorean triples of the form $$a^2 +Qab + b^2 = c^2$$

for all $a,b,c\in\mathbb{N}$ and $Q$ is an integer fixed in advance? I've tried applying various proofs of Euclid's formula to derive a similar result, with no success. (If relevant, the value $Q=14$ is especially salient for my current application, and the values $Q=\pm 2$ seem to have an especially straightforward solution.)

Consider the curve $C$ defined by the equation $x^{2}+Qxy+y^{2}=1$ and a line $y=k(x+1)$ with $k\in \mathbb{Q}$. If the graph of $C$ (ellipse or hyperbola, for $Q\neq \pm 2$) intersects with the second line at two points, those points are given by $$(-1, 0), \quad \left (\frac{1-k^{2}}{1+Qk+k^{2}}, \frac{2k+Qk^{2}}{1+Qk+k^{2}}\right)$$ and this gives a rational points on the curve $C$. Also, you can easily check that every rational points can be obtained by this way, except for $(-1, Q)$, which corresponds to $k=\infty$. Using this parametrization, we can prove that every solution of the Diophantine equation $a^{2}+Qab+b^{2}=c^{2}$ are given by $$(a, b, c) = (m^{2}-n^{2}, 2mn+Qn^{2}, m^{2}+Qmn+n^{2}).$$

As other people mentioned, it doesn't give all solutions, but it can give all primitive solutions. For example, if $(a, b, c)$ is a primitive solution of the equation, i.e. $\gcd(a, b, c)=1$, then $$k=\frac{b}{a+c}$$ gives the corresponding rational point $$\left(\frac{a}{c}, \frac{b}{c}\right)$$ on $C$, and the solution $$((a+c)^{2}-b^{2}, 2b(a+c)+Qb^{2}, (a+c)^{2}+Qb(a+c)+b^{2})$$ which is a (possibly) non-primitive solution parallel to the original solution $(a, b, c)$. Conversely, every primitive solution can be obtained by $$\frac{1}{d}(m^{2}-n^{2}, 2mn+Qn^{2}, m^{2}+Qmn+n^{2})$$ where $d$ is a gcd of each components. If you don't want this kind of treatment, I think Will Jagy's answer is more appropriate.

• This misses some solutions, e.g., for $Q=0$, you can't get $(9,12,15)$ this way. Apr 12, 2018 at 7:15
• @GerryMyerson Sorry, I missed $Q$ on the second term. Thanks! Apr 12, 2018 at 7:16
• Wow! Great answer. In Euclid's original formula, there was a restriction on $m > n$ such that they had to be coprime and exactly one had to be even. This property guaranteed that the mapping contains no duplicates (is injective). Can you help me understand if there's a similar restriction on this formulation? Apr 12, 2018 at 7:26
• I'm not sure but it may depends on $Q$. I'll think about it. Apr 12, 2018 at 7:39
• Trying to confirm the formula looking at $(4,10,16)$ for which $4^2 + 14\cdot 4\cdot 10 + 10^2 = 676 = 26^2$, but wondering what $m,n$ correspond to $(4,10,26)$. $a = m^2-n^2$ must be 10 and not 4, because the difference between two positive squares is (I think) never four. So $m=\pm 6, n=\pm 4$. But then $b\equiv 2mn+14n^2 \geq 14\cdot 16 - 2\cdot 24 = 176 > 4$, so we can't make $b=4$. Am I making a mistake somewhere? Aren't $m,n,a,b,c\in \mathbb{N}$ integers? Apr 12, 2018 at 8:21

$$a = u^2 - 4uv+3v^2, \; \; b = u^2 + 4uv+3v^2, \; \; c = 4 u^2 - 12 v^2 \; \; ,$$ $$a = 3u^2 - 14uv+16v^2, \; \; b = 2uv, \; \; c = 3 u^2 - 16 v^2 \; \; ,$$ $$a = u^2 - 14uv+48v^2, \; \; b = 2uv, \; \; c = u^2 - 48 v^2 \; \; .$$

  1      1      4   u v       1      0 : 4,0,-12
5      2    -13   u v       1      1 : 3,0,-16
6      1     11   u v       3      1 : 3,0,-16
10      3    -23   u v       5      1 : 1,0,-48
12      7    -37   u v       3      2 : 3,0,-16
21     10     59   u v       5      1 : 3,0,-16
21      5    -44   u v       1      2 : 4,0,-12
22     15     73   u v      11      1 : 1,0,-48
28     15     83   u v       7      2 : 3,0,-16
35      2    -47   u v       1      1 : 1,0,-48
35     26    121   u v      13      1 : 1,0,-48
35      3     52   u v       4      1 : 4,0,-12
39      4    -61   u v       1      2 : 3,0,-16
44      5    -71   u v      11      2 : 1,0,-48
45     28   -143   u v       7      2 : 1,0,-48
51     40   -181   u v       5      4 : 3,0,-16
55     36    179   u v       9      2 : 3,0,-16
55      7    -92   u v       2      3 : 4,0,-12
56     11   -109   u v       7      4 : 3,0,-16
65     14    131   u v       7      1 : 3,0,-16
65     33   -188   u v       1      4 : 4,0,-12
68      5     97   u v      17      2 : 1,0,-48
70     57   -253   u v       7      5 : 3,0,-16
76     21    169   u v      19      2 : 1,0,-48
77     20   -167   u v       5      2 : 1,0,-48
78     55   -263   u v      13      3 : 1,0,-48
88      3    107   u v      11      4 : 3,0,-16
90     13   -157   u v       9      5 : 3,0,-16
91     66   -311   u v      11      3 : 1,0,-48
92     77    337   u v      23      2 : 1,0,-48
99     34    241   u v      17      1 : 1,0,-48
99     35    244   u v       8      1 : 4,0,-12
102      7   -143   u v      17      3 : 1,0,-48
104     35    251   u v      13      4 : 3,0,-16
115     24   -229   u v       3      4 : 3,0,-16
117    100    433   u v      25      2 : 1,0,-48
117      5    148   u v       7      2 : 4,0,-12
119     39   -284   u v       2      5 : 4,0,-12
119     44    299   u v      11      2 : 3,0,-16
120     91    419   u v      15      4 : 3,0,-16
133     18    227   u v       9      1 : 3,0,-16
133     85   -428   u v       1      6 : 4,0,-12
136    105   -479   u v      17      4 : 1,0,-48
143     38    313   u v      19      1 : 1,0,-48
143     63    388   u v      10      1 : 4,0,-12
145    126   -541   u v       9      7 : 3,0,-16
150      7    193   u v      25      3 : 1,0,-48
152     65   -407   u v      19      4 : 1,0,-48
154     69   -421   u v      11      7 : 3,0,-16
165      4   -191   u v       1      2 : 1,0,-48
170     77    467   u v      17      5 : 3,0,-16
171     11   -236   u v       4      5 : 4,0,-12
171    136    611   u v      17      4 : 3,0,-16
174     55    409   u v      29      3 : 1,0,-48
176    155   -661   u v      11      8 : 3,0,-16
182     17   -277   u v      13      7 : 3,0,-16
184      9   -239   u v      23      4 : 1,0,-48
186     91    529   u v      31      3 : 1,0,-48
187     42   -383   u v       7      3 : 1,0,-48
190    153    683   u v      19      5 : 3,0,-16
203      8   -253   u v       1      4 : 3,0,-16
207     52    443   u v      13      2 : 3,0,-16
207     95   -572   u v       2      7 : 4,0,-12
208     75   -517   u v      13      8 : 3,0,-16
209    104   -599   u v      13      4 : 1,0,-48
210    187    793   u v      35      3 : 1,0,-48
217     30   -373   u v       3      5 : 3,0,-16
221    116    649   u v      29      2 : 1,0,-48
221     45    436   u v      11      2 : 4,0,-12
225    161   -764   u v       1      8 : 4,0,-12
225     22    347   u v      11      1 : 3,0,-16
230    119   -671   u v      23      5 : 1,0,-48
231    190   -839   u v      19      5 : 1,0,-48
240     19   -349   u v      15      8 : 3,0,-16
247    222    937   u v      37      3 : 1,0,-48
247     30   -407   u v       5      3 : 1,0,-48
247      7    292   u v      10      3 : 4,0,-12
253     13   -332   u v       5      6 : 4,0,-12
253    210    923   u v      21      5 : 3,0,-16
255    143    772   u v      14      1 : 4,0,-12
255     46    481   u v      23      1 : 1,0,-48
259    144   -781   u v       9      8 : 3,0,-16
266      5    299   u v      19      7 : 3,0,-16
273     88   -647   u v      11      4 : 1,0,-48
275    152    827   u v      19      4 : 3,0,-16
275     51   -524   u v       4      7 : 4,0,-12
280     33    457   u v      35      4 : 1,0,-48
285    124    769   u v      31      2 : 1,0,-48
285     77    628   u v      13      2 : 4,0,-12
287    260  -1093   u v      13     10 : 3,0,-16
290     11   -359   u v      29      5 : 1,0,-48
296     65    601   u v      37      4 : 1,0,-48
299    170   -911   u v      17      5 : 1,0,-48
300    253  -1103   u v      25      6 : 1,0,-48
319    175   -956   u v       2      9 : 4,0,-12
319     60    611   u v      15      2 : 3,0,-16
322    117    803   u v      23      7 : 3,0,-16
323    195   1012   u v      16      1 : 4,0,-12
323     50    577   u v      25      1 : 1,0,-48
325    276  -1199   u v      23      6 : 1,0,-48
328    153    913   u v      41      4 : 1,0,-48
330    301  -1261   u v      15     11 : 3,0,-16
333     10   -397   u v       1      5 : 3,0,-16
340     87   -733   u v      17     10 : 3,0,-16
341    261  -1196   u v       1     10 : 4,0,-12
341     26    491   u v      13      1 : 3,0,-16
344    209   1081   u v      43      4 : 1,0,-48
348    133   -887   u v      29      6 : 1,0,-48
350    209   1091   u v      25      7 : 3,0,-16
368     35    563   u v      23      8 : 3,0,-16
369     70   -709   u v       5      7 : 3,0,-16
372     85   -767   u v      31      6 : 1,0,-48
374    185  -1069   u v      17     11 : 3,0,-16
376    345   1441   u v      47      4 : 1,0,-48
377    230   1187   u v      23      5 : 3,0,-16
377     57   -668   u v       5      8 : 4,0,-12
378    325   1403   u v      27      7 : 3,0,-16
380     23   -517   u v      19     10 : 3,0,-16
387    112   -877   u v       7      8 : 3,0,-16
391    246   1249   u v      41      3 : 1,0,-48
391     55    676   u v      14      3 : 4,0,-12
391      6   -431   u v       1      3 : 1,0,-48
400     99    851   u v      25      8 : 3,0,-16
403    115   -908   u v       4      9 : 4,0,-12
403    168   1067   u v      21      4 : 3,0,-16
406    351  -1511   u v      29      7 : 1,0,-48
410     11    481   u v      41      5 : 1,0,-48
418     93   -853   u v      19     11 : 3,0,-16
420     13   -503   u v      35      6 : 1,0,-48
423    220  -1237   u v      11     10 : 3,0,-16
425    392   1633   u v      49      4 : 1,0,-48
425     56   -719   u v       7      4 : 1,0,-48
425      9    484   u v      13      4 : 4,0,-12
430     39    649   u v      43      5 : 1,0,-48
432    187   1163   u v      27      8 : 3,0,-16
434    275  -1391   u v      31      7 : 1,0,-48
437    140   1033   u v      35      2 : 1,0,-48
437    165   1108   u v      17      2 : 4,0,-12
441    286  -1429   u v      13     11 : 3,0,-16
455    279  -1436   u v       2     11 : 4,0,-12
455     68    803   u v      17      2 : 3,0,-16
459    130  -1031   u v      13      5 : 1,0,-48
462     25   -613   u v      21     11 : 3,0,-16
464    299   1499   u v      29      8 : 3,0,-16
465     17   -572   u v       7      8 : 4,0,-12
465    406   1739   u v      29      7 : 3,0,-16
470    119   1009   u v      47      5 : 1,0,-48
475    258   1417   u v      43      3 : 1,0,-48
475     91    916   u v      16      3 : 4,0,-12
477    442  -1837   u v      17     13 : 3,0,-16
481     30    659   u v      15      1 : 3,0,-16
481    385  -1724   u v       1     12 : 4,0,-12
483    323   1588   u v      20      1 : 4,0,-12
483     58    793   u v      29      1 : 1,0,-48
490    171   1201   u v      49      5 : 1,0,-48
493    228  -1367   u v      19      6 : 1,0,-48
494    329  -1621   u v      19     13 : 3,0,-16
496    435   1859   u v      31      8 : 3,0,-16
513     40   -743   u v       5      4 : 1,0,-48
517     42   -757   u v       3      7 : 3,0,-16
518     95   -983   u v      37      7 : 1,0,-48
525    148   1177   u v      37      2 : 1,0,-48
525    221   1396   u v      19      2 : 4,0,-12
527    350  -1727   u v      25      7 : 1,0,-48
530    299   1609   u v      53      5 : 1,0,-48
532    495  -2053   u v      19     14 : 3,0,-16
539     80   -949   u v       5      8 : 3,0,-16
540      7    587   u v      27     10 : 3,0,-16
546    205  -1381   u v      21     13 : 3,0,-16
551    110  -1079   u v      11      5 : 1,0,-48
555    184   1331   u v      23      4 : 3,0,-16
555    203  -1388   u v       4     11 : 4,0,-12
560    377  -1847   u v      35      8 : 1,0,-48
561    496  -2111   u v      31      8 : 1,0,-48
574     15   -671   u v      41      7 : 1,0,-48
575    399   1924   u v      22      1 : 4,0,-12
575     62    913   u v      31      1 : 1,0,-48
580     63    923   u v      29     10 : 3,0,-16
583    180  -1357   u v       9     10 : 3,0,-16
588     13    673   u v      49      6 : 1,0,-48
589    204  -1439   u v      17      6 : 1,0,-48
590    551   2281   u v      59      5 : 1,0,-48
592    297  -1703   u v      37      8 : 1,0,-48
595     19   -716   u v       8      9 : 4,0,-12
595    528   2243   u v      33      8 : 3,0,-16
598    105  -1117   u v      23     13 : 3,0,-16
609    424   2041   u v      53      4 : 1,0,-48
609     65    964   u v      17      4 : 4,0,-12
615    407  -2012   u v       2     13 : 4,0,-12
615     76   1019   u v      19      2 : 3,0,-16
620    143   1283   u v      31     10 : 3,0,-16
627    322  -1823   u v      23      7 : 1,0,-48
629    434   2099   u v      31      7 : 3,0,-16
629     69  -1004   u v       7     10 : 4,0,-12
636     85   1081   u v      53      6 : 1,0,-48
644    215  -1549   u v      23     14 : 3,0,-16
645     34    851   u v      17      1 : 3,0,-16
645    533  -2348   u v       1     14 : 4,0,-12
649    390  -2029   u v      15     13 : 3,0,-16
650     29   -829   u v      25     13 : 3,0,-16
651     11    724   u v      16      5 : 4,0,-12
651    610   2521   u v      61      5 : 1,0,-48
656    161  -1391   u v      41      8 : 1,0,-48
660    133   1297   u v      55      6 : 1,0,-48
660    247   1667   u v      33     10 : 3,0,-16
665    464  -2231   u v      29      8 : 1,0,-48
666    595  -2519   u v      37      9 : 1,0,-48
667    187   1492   u v      20      3 : 4,0,-12
667    282   1777   u v      47      3 : 1,0,-48
671    476  -2269   u v      17     14 : 3,0,-16
682     45    947   u v      31     11 : 3,0,-16
688    105  -1223   u v      43      8 : 1,0,-48
689     14   -781   u v       1      7 : 3,0,-16
697    217  -1628   u v       5     12 : 4,0,-12
697    270   1787   u v      27      5 : 3,0,-16
700    111  -1261   u v      25     14 : 3,0,-16
703    630  -2663   u v      35      9 : 1,0,-48
708    253   1753   u v      59      6 : 1,0,-48
713    105   1252   u v      19      4 : 4,0,-12
713    440   2257   u v      55      4 : 1,0,-48
713      8   -767   u v       1      4 : 1,0,-48
715     48   -997   u v       3      8 : 3,0,-16
715    672  -2773   u v      21     16 : 3,0,-16
725    164   1489   u v      41      2 : 1,0,-48
725    357   2068   u v      23      2 : 4,0,-12
731    200   1619   u v      25      4 : 3,0,-16
731    315  -1964   u v       4     13 : 4,0,-12
732    325   1993   u v      61      6 : 1,0,-48
736    531  -2509   u v      23     16 : 3,0,-16
738    403  -2207   u v      41      9 : 1,0,-48
740    527   2507   u v      37     10 : 3,0,-16
752     17   -863   u v      47      8 : 1,0,-48
756     31   -949   u v      27     14 : 3,0,-16
759     70  -1151   u v       7      5 : 1,0,-48
767    140  -1453   u v       7     10 : 3,0,-16
770    221   1739   u v      35     11 : 3,0,-16
774    319  -2039   u v      43      9 : 1,0,-48
775    247   1828   u v      22      3 : 4,0,-12
775    294   1969   u v      49      3 : 1,0,-48
779    560   2651   u v      35      8 : 3,0,-16
779     75  -1196   u v       8     11 : 4,0,-12
780    493   2497   u v      65      6 : 1,0,-48
780    703   2963   u v      39     10 : 3,0,-16
782    737  -3037   u v      23     17 : 3,0,-16
783    575   2692   u v      26      1 : 4,0,-12
783     70   1177   u v      35      1 : 1,0,-48
793    198  -1693   u v       9     11 : 3,0,-16
799    559  -2684   u v       2     15 : 4,0,-12
799     84   1259   u v      21      2 : 3,0,-16
800    371  -2221   u v      25     16 : 3,0,-16
804    589   2761   u v      67      6 : 1,0,-48
805    156  -1559   u v      13      6 : 1,0,-48
814    345   2171   u v      37     11 : 3,0,-16
817    145  -1532   u v       7     12 : 4,0,-12
817    462   2483   u v      33      7 : 3,0,-16
820    741  -3119   u v      41     10 : 1,0,-48
826     51   1129   u v      59      7 : 1,0,-48
833     38   1067   u v      19      1 : 3,0,-16
833    705  -3068   u v       1     16 : 4,0,-12
837    172   1657   u v      43      2 : 1,0,-48
837    437   2452   u v      25      2 : 4,0,-12
846    175  -1679   u v      47      9 : 1,0,-48
850    549  -2749   u v      25     17 : 3,0,-16
851    266  -1991   u v      19      7 : 1,0,-48
852    805   3313   u v      71      6 : 1,0,-48
854     95   1369   u v      61      7 : 1,0,-48
858    493   2627   u v      39     11 : 3,0,-16
860    629  -2951   u v      43     10 : 1,0,-48
864    235  -1909   u v      27     16 : 3,0,-16
871    420  -2461   u v      15     14 : 3,0,-16
882    115  -1487   u v      49      9 : 1,0,-48
893    290   2123   u v      29      5 : 3,0,-16
893    333  -2252   u v       5     14 : 4,0,-12
897    400  -2447   u v      25      8 : 1,0,-48
899    675   3124   u v      28      1 : 4,0,-12
899     74   1321   u v      37      1 : 1,0,-48
902    665   3107   u v      41     11 : 3,0,-16
903     23  -1052   u v      10     11 : 4,0,-12
903    820   3443   u v      41     10 : 3,0,-16
910    207   1873   u v      65      7 : 1,0,-48
910      9    971   u v      35     13 : 3,0,-16
915     16  -1021   u v       1      8 : 3,0,-16
918    385  -2437   u v      27     17 : 3,0,-16
923    608  -3013   u v      19     16 : 3,0,-16
925     13   1012   u v      19      6 : 4,0,-12
925    132  -1607   u v      11      6 : 1,0,-48
925    876   3601   u v      73      6 : 1,0,-48
928    123  -1573   u v      29     16 : 3,0,-16
931    216   1931   u v      27      4 : 3,0,-16
931    451  -2636   u v       4     15 : 4,0,-12
938    275   2137   u v      67      7 : 1,0,-48
940    429  -2591   u v      47     10 : 1,0,-48
943    558  -2927   u v      31      9 : 1,0,-48
945    209   1924   u v      23      4 : 4,0,-12
945    472   2713   u v      59      4 : 1,0,-48
946    861   3611   u v      43     11 : 3,0,-16
949    714  -3301   u v      21     17 : 3,0,-16
954     19  -1079   u v      53      9 : 1,0,-48
962     77   1403   u v      37     13 : 3,0,-16
975    238  -2063   u v      17      7 : 1,0,-48
980    341  -2399   u v      49     10 : 1,0,-48
986    245  -2101   u v      29     17 : 3,0,-16
987    155  -1772   u v       8     13 : 4,0,-12
987    592   3083   u v      37      8 : 3,0,-16
989    740  -3431   u v      37     10 : 1,0,-48
992     35  -1213   u v      31     16 : 3,0,-16
994    435   2689   u v      71      7 : 1,0,-48
999    119   1636   u v      22      5 : 4,0,-12
999    670   3289   u v      67      5 : 1,0,-48


$$a = u^2 - 4uv+3v^2, \; \; b = u^2 + 4uv+3v^2, \; \; c = 4 u^2 - 12 v^2 \; \; ,$$ $$a = 3u^2 - 14uv+16v^2, \; \; b = 2uv, \; \; c = 3 u^2 - 16 v^2 \; \; ,$$ $$a = u^2 - 14uv+48v^2, \; \; b = 2uv, \; \; c = u^2 - 48 v^2 \; \; .$$

The first triple comes from $$\left( \begin{array}{rrr} 1 & 1 & 4 \\ -4 & 4 & 0 \\ 3 & 3 & -12 \end{array} \right) \left( \begin{array}{rrr} 1 & 7 & 0 \\ 7 & 1 & 0 \\ 0 & 0 & -1 \end{array} \right) \left( \begin{array}{rrr} 1 & -4 & 3 \\ 1 & 4 & 3 \\ 4 & 0 & -12 \end{array} \right) = 96 \left( \begin{array}{rrr} 0 & 0 & 1 \\ 0 & -2 & 0 \\ 1 & 0 & 0 \end{array} \right)$$ Notice that the final matrix is the Hessian matrix of $xz-y^2.$ Furthermore, the primitive solutions to $xy-z^2 = 0$ with at least one of $x,z$ positive are of the form $$x = u^2, \; \; y = u v , \; \; z = v^2.$$ If you put that as a column vector on the right of the matirx, and on the left as a row vector, you get zero. But the matrix identity then says that............... $$\left( \begin{array}{rrr} 3 & 0 & 3 \\ -14 & 2 & 0 \\ 16 & 0 & -16 \end{array} \right) \left( \begin{array}{rrr} 1 & 7 & 0 \\ 7 & 1 & 0 \\ 0 & 0 & -1 \end{array} \right) \left( \begin{array}{rrr} 3 & -14 & 16 \\ 0 & 2 & 0 \\ 3 & 0 & -16 \end{array} \right) = 96 \left( \begin{array}{rrr} 0 & 0 & 1 \\ 0 & -2 & 0 \\ 1 & 0 & 0 \end{array} \right)$$

$$\left( \begin{array}{rrr} 1 & 0 & 1 \\ -14 & 2 & 0 \\ 48 & 0 & -48 \end{array} \right) \left( \begin{array}{rrr} 1 & 7 & 0 \\ 7 & 1 & 0 \\ 0 & 0 & -1 \end{array} \right) \left( \begin{array}{rrr} 1 & -14 & 48 \\ 0 & 2 & 0 \\ 1 & 0 & -48 \end{array} \right) = 96 \left( \begin{array}{rrr} 0 & 0 & 1 \\ 0 & -2 & 0 \\ 1 & 0 & 0 \end{array} \right)$$

If you want to have non-primitive solutions, and perhaps all positive, take $u,v \geq 0,$ $\gcd(u,v)=1,$ use all three recipes above and keep the triples where $a,b > 0$ and $\gcd(a,b,c) = 1,$ then take $k \geq 1$ and triples $\left( ka, \; kb, \; k|c| \right) \; .$

The general setup of Fricke and Klein (1897) says that a finite number of such recipes give all primitive integer solutions.

working. these are the primitive integer $a \geq b > 0,$ $a \leq 100,$ $a^2 + 14 ab + b^2 = c^2$

 1         1         4
5         2        13
6         1        11
10         3        23
12         7        37
21         5        44
21        10        59
22        15        73
28        15        83
35         2        47
35         3        52
35        26       121
39         4        61
44         5        71
45        28       143
51        40       181
55         7        92
55        36       179
56        11       109
65        14       131
65        33       188
68         5        97
70        57       253
76        21       169
77        20       167
78        55       263
88         3       107
90        13       157
91        66       311
92        77       337
99        34       241
99        35       244


Not bad in what follows. Still missing those with $a,b$ both odd.

Got them.

   int a =   u* u +4 *  u * v + 3 * v * v;
int b =   u* u -4 *  u * v + 3 * v * v;
int c =  4* u* u  - 12 * v * v;
1      1      4   u v       1      0
21      5    -44   u v       1      2
35      3     52   u v       4      1
55      7    -92   u v       2      3
65     33   -188   u v       1      4
99     35    244   u v       8      1


=======================================

=================================================

first alternate formula, Just take the absolute value of $c$

   int a = 3 * u* u - 14 * u * v + 16 * v * v;
int b = 2 * u * v;
int c = 3 * u * u - 16 * v * v;

5      2    -13   u v       1      1
6      1     11   u v       3      1
12      7    -37   u v       3      2
21     10     59   u v       5      1
28     15     83   u v       7      2
39      4    -61   u v       1      2
51     40   -181   u v       5      4
55     36    179   u v       9      2
56     11   -109   u v       7      4
65     14    131   u v       7      1
70     57   -253   u v       7      5
88      3    107   u v      11      4
90     13   -157   u v       9      5


=================================================

original formula, in essence

  int a =   u* u - 14 * u * v + 48 * v * v;
int b = 2 * u * v;
int c =  u * u - 48 * v * v;

10      3    -23   u v       5      1
22     15     73   u v      11      1
35      2    -47   u v       1      1
35     26    121   u v      13      1
44      5    -71   u v      11      2
45     28   -143   u v       7      2
68      5     97   u v      17      2
76     21    169   u v      19      2
77     20   -167   u v       5      2
78     55   -263   u v      13      3
91     66   -311   u v      11      3
92     77    337   u v      23      2
99     34    241   u v      17      1


=============================================

• Thanks for your answer! Why should these recipes work? Is there a proof or motivation? Apr 15, 2018 at 20:28