# Find a solution: $3(x^2+y^2+z^2)=10(xy+yz+zx)$

I'm something like 90% sure that this diophantine equation has nontrivial solutions:

$3(x^2+y^2+z^2)=10(xy+yz+zx)$

However, I have not been able to find a solution using my calculator. I would greatly appreciate if someone could try to find one using a program. Or maybe you can just guess one that happens to work?

Thanks!

EDIT: By nontrivial I mean no $0$'s. (Credits to Slade for reminding me to define this)

EDIT2: In fact, you are free to find a nontrivial solution to $(3n-3)(x^2+y^2+z^2)=(9n+1)(xy+yz+zx)$ where $n\equiv 1\pmod 5$ is a positive integer. The one I posted above is the case $n=5(2)+1$, but you will make my day if you can find a nontrivial solution for any $n=5k+1$.

• Do you have an argument for your intuition? – Thomas Andrews Feb 4 '15 at 22:59
• What does "non-trivial" mean? For example, $(0,1,3)$ is a solution. – Slade Feb 4 '15 at 23:00
• $x^2+y^2+z^2=(x+y+z)^2-2(xy+yz+zx)$, so this can be rewritten as $3(x+y+z)^2 = 16(xy+yz+zx)$. – Thomas Andrews Feb 4 '15 at 23:01
• This immediately reminded me of Markov numbers, though perhaps that concept is not directly relevant to your question: mathworld.wolfram.com/MarkovNumber.html – Robert Soupe Feb 5 '15 at 3:11

This was a bunch of nonsense characters typed by hand so that the software would not test me with a captcha''

   0           1           3
0           3           1
1           0           3
1           3           0
3           0           1
3           1           0
3           9          40
3          40           9
5          32         119
5         119          32
8          11          65
8          65          11
9           3          40
9          40           3
11           8          65
11          65           8
13          15          96
13          96          15
15          13          96
15          96          13
32           5         119
32         119           5
40           3           9
40           9           3
65           8          11
65          11           8
96          13          15
96          15          13
119           5          32
119          32           5

• It feels like cheating, but Mathematica can find these and other solutions with this one-liner: Solve[3 (x^2 + y^2 + z^2) == 10 x y + 10 y z + 10 z x && 50 > x > 0 && 50 > y > 0 && z > 0 && GCD[x, y, z] == 1, {x, y, z}, Integers] – Steve Kass Feb 4 '15 at 23:18
• I can't figure out what "fgndsxbxgzfb" means... – Bart Michels Feb 6 '15 at 18:31
• I am also interested in the meaning of "fgndsxbxgzfb". – NalRa Feb 6 '15 at 18:33
• @NalRa, I forgot about that. If I just paste computer output and say to post as an answer, the software says that it cannot tell whether I am human, and makes me type in a Captcha to prove I'm a person. However, if I type in one line of nonsense before pasting in the computer output, no such problem. It wouls probably still work if I deleted the nonsense line later... – Will Jagy Feb 6 '15 at 18:50

As far as I understand - this is the site for solving the problem. Programming and calculation using the computer is not mathematics. If you want to calculate - there is a special section. https://mathematica.stackexchange.com/questions

Here it is necessary to solve the equations.

For the equation:

$$3(x^2+y^2+z^2)=10(xy+xz+yz)$$

The solution is simple.

$$x=4ps$$

$$y=3p^2-10ps+7s^2$$

$$z=p^2-10ps+21s^2$$

$p,s -$ any integer which we ask.

Why make a program? What's the point? For what?

• This is indeed a family of solutions! Care to explain how you found it? Are these the only solutions (or perhaps the only relatively prime solutions)? – Greg Martin Feb 5 '15 at 6:54
• @Ark I was not interested. In General, it $(1;0;3)$ - I am interested in only formula. – individ Feb 5 '15 at 17:06
• @individ: We are "interested only in formula", as well! Could you outline how you derived it? – Kieren MacMillan Aug 22 '17 at 16:01

When he wrote the equation he meant probably that entry.

$$q(x^2+y^2+z^2)=(3q+1)(xy+xz+yz)$$

It turns out, this equation has a connection with the Pell equation:

$$p^2-5s^2=\pm1$$

For $+1$ it is necessary to use the first solution $(9 ; 4)$. For $-1$ it is necessary to use the first solution $(2 ; 1)$. Knowing what the decision can be found on the following formula.

$$p_2=9p_1+20s_1$$

$$s_2=4p_1+9s_1$$

Using the solutions of the Pell equation can be found when there are solutions. $q=\mp(p^2-s^2)$

Will make a replacement. $t=\mp4ps$ Then the solution can be written:

$$x=2(q+1)tkn$$

$$y=(q+t+1)k^2-2(3q+1)tkn+(t-q-1)(10q^2+7q+1)n^2$$

$$z=(t-q-1)k^2-2(3q+1)tkn+(t+q+1)(10q^2+7q+1)n^2$$

$k,n$ - integers asked us. May be necessary, after all the calculations is to obtain a relatively simple solution, divided by the common divisor.

• @Ark I don't understand the question. Solving the Pell equation are the standard way , using expansion in continued fractions. – individ Feb 5 '15 at 17:03
• @Ark I can't help you. My methods calculations aren't published anywhere. Officially banned. You cannot use them. All removed. – individ Feb 5 '15 at 17:08
• @Ark this is not discussed. – individ Feb 5 '15 at 17:11
• @Ark If you can find a copy of Kenneth Rosen's book, Elementary Number Theory, he has a section on solving Pell's equation. This is through continued fractions if I recall correctly. – Joel Feb 5 '15 at 22:27
• @individ: Okay… I get that. =) Looking forward to hearing about it if you’re ever ready. – Kieren MacMillan Aug 22 '17 at 18:04

Because the equation is homogenous, the integer solutions can be derived from the rational solutions, in other words swapping between projective and affine form.

I prove below that the set of non-zero rational solutions are common rational multiples of the following (which, conversely, satisfies the equation identically) for any rational parameter t:

$$x,\ y,\ z = 2 t - 1,\ 3 t^2 - 8 t + 5,\ t^2 - 6 t + 8$$

So, explicitly, the complete set of integer solutions with GCD(x, y, z) = 1 can be expressed as follows, as $$m,\ n$$ range over coprime integer pairs

$$x,\ y,\ z = (2 m - n) n,\ 3 m^2 - 8 m n + 5 n^2,\ m^2 - 6 m n + 8 n^2$$

Proof:

Let $$p,\ q,\ r = - x + y + z,\ x - y + z,\ x + y - z$$

<=> $$2 x,\ 2 y,\ 2 z = q + r,\ r + p,\ p + q$$

Then $$p^2 + q^2 + r^2 = 3 (x^2 + y^2 + z^2) - 2 (x y + y z + z x)$$

and $$p q + q r + r p = - (x^2 + y^2 + z^2) + 2 (x y + y z + z x)$$

So if $$a (p^2 + q^2 + r^2) = b (p q + q r + r p)$$

then $$(3 a + b) (x^2 + y^2 + z^2) = 2 (a + b) (x y + y z + z x)$$

So the required equation is obtained with $$3 a + b,\ a + b = 3,\ 5$$, i.e. $$a,\ b = -1,\ 6$$ and the original is equivalent to

$$p^2 + q^2 + r^2 + 6 (p q + q r + r p) = 0$$

If r = 0 then this becomes $$(p + 3 q)^2 = 8 q^2$$, which for rational $$p, q$$ has only the solution p = q = 0

Otherwise, we can replace $$\frac{p}{r},\ \frac{q}{r}$$ by $$p,\ q$$ respectively and the equation becomes

$$q^2 + 6 (p + 1) q + (p^2 + 6 p + 1) = 0$$

which for rational $$q$$ (assuming rational $$p$$) requires rational $$s$$ with

$$q = 2 s - 3 (p + 1)$$

$$9 (p + 1)^2 - (p^2 + 6 p + 1) = 4 s^2$$

The latter is equivalent to $$8 s^2 - (4 p + 3)^2 = 7$$

So in view of the obvious rational solution $$4 p + 3,\ s = 1, 1$$ we can replace in this $$4 p + 3,\ s = 2 t u + 1,\ u + 1$$

which implies either $$u = 0$$, which recovers the solution already observed, or $$u = \frac{4 - t}{t^2 - 2}$$

which gives successively

$$p = \frac{- t^2 + 2 t + 1}{t^2 - 2}$$

$$s = \frac{t^2 - t + 2}{t^2 - 2}$$

$$q = \frac{2 v^2 - 8 v + 7}{t^2 - 2}$$

So the original $$p,\ q,\ r$$ can be taken as follows, and the result follows

$$p,\ q,\ r = - t^2 + 2 t + 1,\ 2 t^2 - 8 t + 7,\ t^2 - 2$$

Sanity check: In the expressions for $$x, y, z$$ take $$t = 0$$ to give $$x, y, z = 1, 5, 8$$ and the equation becomes 2.3^3.5 = 2.3^3.5

Regards

John R Ramsden

• I see the OP was really interested in the equation $(3n−3)(x^2+y^2+z^2)=(9n+1)(xy+yz+zx)$ where $n ≡ 1$ (mod 5) [ possibly intending to write $3 n$ instead of $3 n - 3$ ], but I also noticed this question was posted five years ago! If they see my post and this comment now, and still want a solution of this more general equation, then add a comment here and I'll keep an eye on this thread. My solution should apply equally to a more general equation of the same form, with 3 and 10 replaced by linear functions of k, provided it has solutions in the field Q(k) (i.e. without contraint on k). – John R Ramsden May 28 at 16:05

august 2020, this is the good answer, gradually deleting my others here, limit of 5 per day

ADDED: Another way of saying this: Given integers $$B > A > 0,$$ with $$\gcd(A,B) = 1,$$ then there is a solution in integers $$x,y,z,$$ not all $$0,$$ to $$A(x^2 + y^2 + z^2) - B (yz + zx + xy) = 0,$$ if and only if both $$B+2A$$ and $$B-A$$ are integrally represented by the binary form $$u^2 + 3 v^2.$$

ORIGINAL: It is simpler than I had feared. We take $$0 < A < B,$$ and $$\gcd(A,B)=1.$$ After that, what we are really concerned about are the two numbers that come up in diagonalizing the form, those being $$B + 2A$$ and $$B-A.$$

The form is isotropic over the rationals (and integers) if and only if:

(I) when factoring both $$B + 2A$$ and $$B-A,$$ the exponents of $$2$$ are even.

(II) when factoring both $$B + 2A$$ and $$B-A,$$ the exponents of $$q$$ are even, where $$q \equiv 5 \pmod 6$$ is a prime.

That's it. Note that we could combine these into one test, for all primes $$p \equiv 2 \pmod 3.$$

Here is an example, $$6(x^2 + y^2 + z^2) = 55 (yz+zx+xy)$$ All primitive solutions can be found by ordering the elements of three Pythagorean Triple type recipes for $$(x,y,z).$$ The theorem is that a finite number of such recipes succeed; for this problem the count required has turned out to be one of $$1,2,3,4,6,8,12,16.$$ That is, either $$2^k$$ or $$3 \cdot 2^k$$ The quadratic form is so symmetric that each matrix of coefficients comes out in an amusing cyclic pattern.

$$x= 48 u^2 + 97uv + 34v^2 \; , \; \; y= 34 u^2 -29uv -15v^2 \; , \; \; z = -15 u^2 -uv + 48 v^2$$

$$x= 54 u^2 + 91uv + 25v^2 \; , \; \; y= 25 u^2 -41uv -12v^2 \; , \; \; z = -12 u^2 +17uv + 54 v^2$$

$$x= 60 u^2 + 71uv + 9v^2 \; , \; \; y= 9 u^2 -53uv -2v^2 \; , \; \; z = -2 u^2 +49uv + 60 v^2$$

Here are the three recipes sorted and with the $$u,v$$ values specified.

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
x         y         z  such that x >= |y| >= |z|
48        34       -15
48        34       -15      < 48, 97, 34 >      1  0
54        25       -12
54        25       -12      < 54, 91, 25 >      1  0
60         9        -2
60         9        -2      < 60, 71, 9 >      1  0
140       107       -46
140       107       -46      < 60, 71, 9 >      1  1
170        59       -28
170        59       -28      < 54, 91, 25 >      1  1
179        32       -10
179        32       -10      < 48, 97, 34 >      1  1
391       150       -72
391       150       -72      < 60, 71, 9 >      2  1
423        40         6
423        40         6      < 54, 91, 25 >      2  1     POSITIVE
552       525      -206
552       525      -206      < 54, 91, 25 >      1  3
645       414      -188
645       414      -188      < 48, 97, 34 >      1  3
685       354      -168
685       354      -168      < 60, 71, 9 >      1  3
757       204       -90
757       204       -90      < 48, 97, 34 >      3  1
762       189       -80
762       189       -80      < 60, 71, 9 >      3  1
784        90        -3
784        90        -3      < 54, 91, 25 >      3  1
826       747      -300
826       747      -300      < 60, 71, 9 >      2  3
920       818      -331
920       818      -331      < 54, 91, 25 >      1  4
987       540      -254
987       540      -254      < 54, 91, 25 >      2  3
1002       516      -245
1002       516      -245      < 60, 71, 9 >      3  2
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
x         y         z  such that x >= |y| >= |z|


• @Ark, as I said, I do not know anything about publishing for high school students. As you can see by checking MSE questions, including your recent one on Euler's proof for $x^2 + 3 y^2,$ all of the material is done in introductory university courses in number theory. There really are journals (in the U.S. anyway) for research by undergraduate students. This problem is very nice, but ultimately did not require general quadratic forms techniques ( as in Cassels). – Will Jagy Feb 22 '15 at 20:52
• @Ark, worked for me just now, ams.org/cml my last name is Jagy – Will Jagy Feb 22 '15 at 20:54
• @Ark, notice recent artofproblemsolving.com/Forum/viewtopic.php?f=57&t=624222 – Will Jagy Feb 22 '15 at 20:56
• @Ark, publish where??? – Will Jagy Feb 22 '15 at 21:03
• @Ark, I suppose, if the person so advising is able to endorse you and the intended article. The arXiv does not use referees but demands a certain minimum of, well, credibility. – Will Jagy Feb 22 '15 at 21:09

$$(3n-3)(x^2+y^2+z^2)=(9n+1)(xy+yz+zx)\implies$$

$$(7 + 3 n) \Biggl(6 (n - 1) x - (1 + 9 n) (y + z)\Biggr)^2 =\\ 5 (-1 + 3 n) \Bigl(\Biggl(y (7 + 3 n) + z (1 + 9 n)\Biggr)^2 - 24 (-1 + n) (2 + 3 n) z^2\Bigl)$$

Let $$n,z$$ as parameters, then this equation have Pell form.

gp-code:

nxyz()=
{
for(n=2, 55,
n19= 1+9*n; n73= 7+3*n;
D= 5*(3*n-1)*n73;
if(!issquare(D),
C= -5*(3*n-1)*24*(n-1)*(2+3*n)*n73;
Q= bnfinit('x^2-D, 1);
fu= Q.fu[1]; \\print("Fundamental Unit: "fu);
N= bnfisintnorm(Q, C); \\print("Fundamental Solutions (Norm): "N"\n");
for(i=1, #N, ni= N[i];
for(j=0, 3,
s= lift(ni*fu^j);
X= abs(polcoeff(s, 0)); Y= abs(polcoeff(s, 1));
if(X^2-D*Y^2==C,
y= (Y-n19)/n73;
x= (X/n73+n19*(y+1))/6/(n-1);
z= lcm(denominator(x),denominator(y));
x= x*z; y= y*z;
if(3*(n - 1)*(x^2 + y^2 + z^2) == (9*n + 1)*(x*y + y*z + z*x),
print("("n", "x", "y", "z")")
)
)
)
)
)
)
};


Output $$(n,x,y,z)$$:

? \r nxyz.gp
? nxyz()
(2, 263, 3, 39)
(2, 263, 39, 3)
(2, 13, 1, 1)
(2, 2029, 313, 13)
(12, 31259, 9501, 645)
(12, 17390279, 5863461, 15)
(12, 17008338675311, 5734707254439, 645)
(12, 8996620057194221, 3033393402029559, 15)
(12, 23, -3, 15)
(12, 54305687, 18309183, 645)
(12, 28726047317, 9685570983, 15)
(12, 28095079670561213, 9472827435234027, 645)
(12, 27, 3, 5)
(12, 248102969, 83641041, 7095)
(12, 131244443339, 44251732701, 165)
(12, 128361659301988751, 43279743717614349, 7095)
(12, 22431, 7209, 215)
(12, 418643, 140877, 165)
(12, 409856470367, 138191431653, 7095)
(12, 216795018826247, 73096849207503, 165)
(12, 335, -9, 129)
(12, 331085, 111627, 3)
(12, 323820154601, 109182549915, 129)
(12, 171285800223257, 57752490708225, 3)
(12, 345, 99, 11)
(12, 1033625, 348291, 129)
(12, 546912497, 184402665, 3)
(12, 534899570406731, 180352267551945, 129)
(12, 79, 25, 1)
(12, 4720355, 1589181, 1419)
(12, 2498750495, 842504487, 33)
(12, 2443865517463541, 823998956160435, 1419)
(12, 48157, 16165, 43)
(12, 7895, 2607, 33)
(12, 7803215405, 2631010371, 1419)
(12, 4127539903577, 1391684013555, 33)
(12, 157553, 53097, 15)
(12, 154129532603, 51967905117, 645)
(12, 81527354638727, 27488605506693, 15)
(12, 79736606139995013647, 26884818234807767943, 645)
(12, 490499, 164301, 645)
(12, 260315351, 87770589, 15)
(12, 254597561009591, 85842745033119, 645)
(12, 134670267767599349, 45406819349798631, 15)
(12, 2230517, 740223, 7095)
(12, 1189336493, 401008707, 165)
(12, 1163213123733593, 392200959043377, 7095)
(12, 615285638339258987, 207456065037378333, 165)
(12, 3389, 891, 165)
(12, 3714100769, 1252272681, 7095)
(12, 1964596066931, 662403514509, 165)
(12, 1921443711015792671, 647853820469569989, 7095)
(12, 2534577, 854223, 215)
(12, 1340961597, 452132463, 5)
(12, 1311507385382253, 442201384990917, 215)
(12, 693726405183032343, 233903964702072237, 5)
(12, 4269, 1431, 5)
(12, 4187619141, 1411940589, 215)
(12, 2215056036591, 746851186749, 5)
(12, 2166402326572054479, 730446599032512561, 215)
(12, 19423, 6457, 55)
(12, 19132518907, 6450913843, 2365)
(12, 10120215768577, 3412236544783, 55)
(12, 9897925210224031573, 3337286762762271847, 2365)
(12, 55219, 14971, 2365)
(12, 32313529, 10895071, 55)
(12, 31603898624581, 10655897094799, 2365)
(12, 16716992394487381, 5636473932303709, 55)
(12, 48157, 16165, 43)
(12, 25530439, 8608105, 1)
(12, 24969665338195, 8419030436497, 43)
(12, 13207791558649195, 4453275509545459, 1)
(12, 79, 25, 1)
(12, 79727587, 26881705, 43)
(12, 42172242835, 14219229259, 1)
(12, 41245929443880625, 13906903863923347, 43)
(12, 345, 99, 11)
(12, 364261137, 122817255, 473)
(12, 192677832909, 64965249525, 11)
(12, 188445663972161535, 63538287723634977, 473)
(12, 335, -9, 129)
(12, 615189, 207405, 11)
(12, 601703642247, 202876618065, 473)
(12, 318273240551715, 107312295261369, 11)
(12, 22431, 7209, 215)
(12, 12151779, 4097211, 5)
(12, 11884877546769, 4007228148111, 215)
(12, 6286547425375101, 2119637303837199, 5)
(12, 27, 3, 5)
(12, 37947657, 12794463, 215)
(12, 20072833773, 6767964087, 5)
(12, 19631933953623333, 6619305755429517, 215)
(12, 23, -3, 15)
(12, 173372911, 58452229, 2365)
(12, 91709376799, 30921681241, 55)
(12, 89694980300581339, 30242486590433491, 2365)
(12, 31259, 9501, 645)
(12, 292687, 98593, 55)
(12, 286394466067, 96563714203, 2365)
(12, 151489354754713, 51077716550047, 55)
(21, 1417, 426, 48)
(21, 83142331513, 29578439082, 336)
(21, 91315532516753401, 32486110508186634, 48)
(21, 4914317238221204673953257, 1748301175858017549085194, 336)
(21, 2954, 1037, 8)
(21, 87347683, 31073934, 336)
(21, 95935286323747, 34129618776174, 48)
(21, 5162937983728230318259, 1836749666389321064622, 336)
(21, 12839986, 4567617, 168)
(21, 20199, 7158, 16)
(21, 1089383306103, 387555385974, 112)
(21, 1196473731707640183, 425653520240554902, 16)
(21, 166, 27, 24)
(21, 1144496109, 407161938, 112)
(21, 1257004661384493, 447187802705394, 16)
(21, 67648071535180409104413, 24066253210037399689266, 112)
(21, 162, 51, 4)
(21, 376240009, 133849602, 168)
(21, 413226300173881, 147008015858322, 24)
(21, 22238551035757462803577, 7911513042504815726946, 168)
(21, 164382, 58473, 4)
(21, 394819, 140166, 168)
(21, 434131875763, 154445313942, 24)
(21, 23363623933881420691, 8311765239375213222, 168)
(21, 71, 14, 8)
(21, 4929739847, 1753787774, 56)
(21, 5414351751364439, 1926191793195182, 8)
(21, 291383529309669591514199, 103661636443752927469598, 56)
(21, 12514, 4431, 12)
(21, 5178989, 1842362, 56)
(21, 5688269796029, 2023639966826, 8)
(21, 306124944398220177437, 108905993306325509018, 56)
(21, 9536, 3389, 2)
(21, 1702357, 605478, 84)
(21, 1869955422109, 665249129166, 12)
(21, 100635170298651434053, 35801633886681667206, 84)
(21, 1567, 426, 84)
(21, 1964558503, 698904786, 12)
(21, 105726414890938351, 37612878150289098, 84)
(21, 116119714172828328814711, 41310363777438054629874, 12)
(21, 712, 243, 6)
(21, 22308267, 7936266, 28)
(21, 24501335976387, 8716513896258, 4)
(21, 1318585507084135954491, 469095599806853388714, 28)
(21, 23361, 8262, 28)
(21, 25740885657, 9157491966, 4)
(21, 1385294206562535537, 492827665134459174, 28)
(21, 1521473772446088640861641, 541274455119923650488798, 4)
(21, 7591, 2628, 42)
(21, 8462029819, 3010423608, 6)
(21, 455400061126042903, 162011612958193764, 42)
(21, 500167578620665908843883, 177937956269400884789592, 6)
(21, 438, 144, 7)
(21, 8890117, 3162708, 6)
(21, 478439254001089, 170207959681728, 42)
(21, 525471609729598654933, 186940034319557009844, 6)
(21, 40222, 14304, 3)
(21, 100913, 35876, 14)
(21, 110874854861, 39444470048, 2)
(21, 5966938981113611201, 2122778390417863172, 14)
(21, 71, 8, 14)
(21, 116484131, 41440004, 2)
(21, 6268813025048183, 2230172097496232, 14)
(21, 6885060629573009104979, 2449406298176474029988, 2)
(21, 71, 8, 14)
(21, 38292856, 13622934, 3)
(21, 2060802551018062, 733144269794844, 21)
(21, 2263387096192637014984, 805215074623013954982, 3)
(21, 100913, 35876, 14)
(21, 40222, 14304, 3)
(21, 2165060831764, 770234849382, 21)
(21, 2377894353243482254, 845951796011137296, 3)
(21, 438, 144, 7)
(21, 501737268, 178496382, 1)
(21, 27001935493032294, 9606118873595136, 7)
(21, 29656326044900147464932, 10550436038739482164974, 1)
(21, 7591, 2628, 42)
(21, 527118, 187524, 1)
(21, 28367993280288, 10092103054086, 7)
(21, 31156672386592834974, 11084194269277534932, 1)
(21, 23361, 8262, 28)
(21, 693124, 246573, 6)
(21, 37302648961168, 13270666479129, 42)
(21, 40969637906871469348, 14575222285199263197, 6)
(21, 712, 243, 6)
(21, 39189831124, 13942044063, 42)
(21, 43042337210924968, 15312598904334339, 6)
(21, 2316404382684519800324788, 824076328347877344913071, 42)
(21, 1567, 426, 84)
(21, 9081956, 3230963, 2)
(21, 488762846529896, 173880646666007, 14)
(21, 536810049748675969988, 190973760075715894979, 2)
(21, 9536, 3389, 2)
(21, 513489899588, 182677460897, 14)
(21, 563967864007424864, 200635333861190573, 2)
(21, 30350991989079117832003172, 10797568087438115061341201, 14)
(21, 12514, 4431, 12)
(21, 675216370618, 240212732871, 84)
(21, 741592648046669506, 263826536981350143, 12)
(21, 39910204031994469833921946, 14198321609193718386673527, 84)
(21, 71, 14, 8)
(21, 709376086, 252365133, 84)
(21, 779110640492446, 277173813343269, 12)
(21, 41929305404327431789558, 14916630406186233794397, 84)
(21, 394819, 140166, 168)
(21, 164382, 58473, 4)
(21, 8847110986086, 3147418815249, 28)
(21, 9716814856799508798, 3456821775284131641, 4)
(21, 162, 51, 4)
(21, 9294696042, 3306650139, 28)
(21, 10208399269556226, 3631706212978083, 4)
(21, 549384218898584896608714, 195447104722505639044491, 28)
(21, 166, 27, 24)
(21, 12222111382, 4348097451, 168)
(21, 13423590828090502, 4775532081335883, 24)
(21, 722415803611620115127926, 257004246508466775463899, 168)
(21, 20199, 7158, 16)
(21, 12839986, 4567617, 168)
(21, 14102705137762, 5017131532161, 24)
(21, 758963618283224242642, 270006375648288958929, 168)
(21, 2954, 1037, 8)
(21, 160141821914, 56971522493, 56)
(21, 175884357987566762, 62572034929515101, 8)
(21, 9465547739462478924449018, 3367431820301536704807437, 56)
(21, 1417, 426, 48)
(21, 168243422, 59853623, 56)
(21, 184782542228846, 65737623396407, 8)
(21, 9944420270790822529598, 3537793921285983484199, 56)
(32, 71, 21, 3)
(32, 73589, 26823, 3)
(32, 68371913, 24926349, 3)
(32, 63517441391, 23156559201, 3)
(32, 6529, 2203, 103)
(32, 1711769, 607197, 9579)
(32, 1615089143, 588796113, 9579)
(32, 1500441017057, 547015896759, 9579)
(32, 1711769, 607197, 9579)
(32, 6529, 2203, 103)
(32, 6331141, 2307961, 103)
(32, 5881891363, 2144361469, 103)
(32, 71, 21, 3)
(32, 14011, 5053, 31)
(32, 13096813, 4774651, 31)
(32, 12167005897, 4435726357, 31)
(41, 5664, 2079, 4)
(41, 648230352, 238757847, 52)
(41, 438104084544, 161363670519, 4)
(41, 50039371681516272, 18430635481881327, 52)
(41, 1407, 432, 52)
(41, 11548, 4248, 3)
(41, 1319964424, 486172764, 39)
(41, 892092942628, 328578063408, 3)
(41, 1407, 432, 52)
(41, 1048839, 386304, 4)
(41, 119797591527, 44124169872, 52)
(41, 80964740524719, 29821150213344, 4)
(41, 48799, 16884, 624)
(41, 34171543, 12586068, 48)
(41, 3903020849959, 1437571098324, 624)
(41, 2637841596854623, 971576886296628, 48)
(42, 7969, 369, 2337)
(42, 16822903, 6172263, 16359)
(42, 416896849, 153681489, 2337)
(42, 504853232743, 186110082423, 16359)
(42, 19, 3, 3)
(42, 32581, 11973, 21)
(42, 806659, 297363, 3)
(42, 976841701, 360104853, 21)
(42, 71567, 25871, 287)
(42, 1788713, 659321, 41)
(42, 2166199727, 798551711, 287)
(42, 53534310233, 19734995801, 41)
(42, 7969, 369, 2337)
(42, 50181, 18261, 133)
(42, 1249443, 460563, 19)
(42, 1513090101, 557788341, 133)
(51, 85, 4, 25)
(51, 2246261, 827865, 3000)
(51, 383321759, 142194435, 1500)
(51, 260659465109, 96694303185, 3000)
(51, 11321, 765, 3000)
(51, 3240899, 1199535, 1500)
(51, 2206715249, 818598285, 3000)
(51, 93784952264, 34790491635, 375)
(51, 5549, 1185, 600)
(51, 1220231, 452115, 300)
(51, 830334581, 308020065, 600)
(51, 35288987516, 13090812615, 75)
(51, 9491, 3015, 300)
(51, 7027841, 2605965, 600)
(51, 298753751, 110825640, 75)
(51, 812603757929, 301443717885, 600)
(51, 3719, 1275, 60)
(51, 2644709, 980865, 120)
(51, 112413779, 41701020, 15)
(51, 305762950781, 113425910145, 120)
(51, 22049, 7965, 120)
(51, 951644, 352995, 15)
(51, 2588566241, 960255045, 120)
(51, 440052512699, 163242003975, 60)
(51, 201, 45, 20)
(51, 8357, 3057, 24)
(51, 358088, 132831, 3)
(51, 974014325, 361320585, 24)
(51, 79, -5, 40)
(51, 3023, 1116, 3)
(51, 8245865, 3058845, 24)
(51, 1401796619, 520010847, 12)
(51, 365, 9, 120)
(51, 28475, 10536, 15)
(51, 77568245, 28774521, 120)
(51, 13186546055, 4891684731, 60)
(51, 200, 51, 15)
(51, 656345, 243261, 120)
(51, 111636155, 41412471, 60)
(51, 75912045665, 28160353629, 120)
(51, 2060, 639, 75)
(51, 6175685, 2289849, 600)
(51, 1050149735, 389563299, 300)
(51, 714096227165, 264901336521, 600)
(51, 50585, 17709, 600)
(51, 8889635, 3297159, 300)
(51, 6045484265, 2242633461, 600)
(51, 256930931735, 95311170684, 75)
(51, 50585, 17709, 600)
(51, 6081, 2040, 125)
(51, 17502799, 6491035, 1000)
(51, 2975937381, 1103953665, 500)
(51, 2060, 639, 75)
(51, 145339, 52135, 1000)
(51, 25192641, 9344565, 500)
(51, 17131822291, 6355223815, 1000)
(51, 200, 51, 15)
(51, 55191, 20115, 200)
(51, 9479629, 3516385, 100)
(51, 6446286879, 2391316035, 200)
(51, 365, 9, 120)
(51, 79969, 29485, 100)
(51, 54573219, 20244135, 200)
(51, 2319366109, 860392660, 25)
(51, 79, -5, 40)
(51, 30141, 11145, 20)
(51, 20534671, 7617475, 40)
(51, 872720841, 323744760, 5)
(51, 201, 45, 20)
(51, 173731, 64375, 40)
(51, 7388376, 2740785, 5)
(51, 20096247859, 7454909695, 40)
(51, 85, 25, 4)
(51, 65391, 24243, 8)
(51, 2780068, 1031293, 1)
(51, 7561727343, 2805100491, 8)
(51, 531, 183, 8)
(51, 23533, 8728, 1)
(51, 64017003, 23747751, 8)
(51, 10882800265, 4037086645, 4)
(51, 5095, 1819, 40)
(51, 221385, 82116, 5)
(51, 602200975, 223392571, 40)
(51, 102373299645, 37976428041, 20)
(51, 1860, 681, 5)
(51, 5098075, 1891111, 40)
(51, 866684745, 321505581, 20)
(51, 589340567395, 218621942839, 40)
(51, 11321, 765, 3000)
(51, 17560, 6469, 25)
(51, 47957535, 17789979, 200)
(51, 8152807885, 3024367729, 100)
(51, 85, 4, 25)
(51, 405435, 150039, 200)
(51, 69020785, 25603789, 100)
(51, 46933922715, 17410620831, 200)
(52, 87265827, 32385357, 2771)
(52, 1459960973099, 541892263707, 9)
(52, 92048147287974147247338801077, 34165419367023176604883761861, 1467)
(52, 218430685030184926589186837228886079152203, 81074700323244984640952021928026879199483, 9)
(52, 2153, 783, 9)
(52, 137371539031945116491, 50988057645924749097, 1467)
(52, 325983306111787289169901189942697, 120994899822529822409179156770159, 9)
(52, 20552713344229656875318856309726948602653728259979, 7628530190173194062826133687718955675547649314569, 1467)
(52, 23625803, 8768889, 153)
(52, 1489595925019173492378773, 552891839381300285045883, 24939)
(52, 3534818113200842771018599462354087979, 1312014926773376734450543669432841913, 153)
(52, 222864490427906273879838104582592646222270862013280757, 82720391467152578056709729060723124708724980324242619, 24939)
(52, 57313, 21271, 1)
(52, 2223054898745657, 825129077826969, 24939)
(52, 5275319696432786287764084191, 1958035170005975601955549791, 153)
(52, 332600263532425146752562065682195480701388569, 123450909333536721211738813543440164698032057, 24939)
(52, 2702274161, 1003000323, 51)
(52, 47151518843, 17501181513, 489)
(52, 111890778596558634258749, 41530389113585179514643, 3)
(52, 7054530263488799352428867951839315641947, 2618422988302124226949130627353318273929, 489)
(52, 739289, 259743, 8313)
(52, 166984441427201, 61979449203681, 3)
(52, 10528095436957252290397549108559, 3907702722297823999778661509967, 489)
(52, 24983219826937040853661741235001714285233633, 9272996879072957562173947761838531097815809, 3)
(52, 739289, 259743, 8313)
(52, 1810705079410452803, 672077605152835281, 51)
(52, 114161988513920334440985788376914201, 42373391841868689101000875136611071, 8313)
(52, 270906933927627338861500970927626814362048423811, 100552257484502936920291680950911755368111882673, 51)
(52, 47151518843, 17501181513, 489)
(52, 2702274161, 1003000323, 51)
(52, 170373967572005330478362303, 63237536254916614432747929, 8313)
(52, 404298223750622602383461728470474057617, 150062969986439110857051148438085813187, 51)
(52, 57313, 21271, 1)
(52, 3613672152818956111411, 1341283102306646561761, 163)
(52, 8575260959303115911441461891717921, 3182871089622997329721870358572663, 1)
(52, 540656153380082209520978621311915847769444315844723, 200674807237596616898698488971868538441820405999809, 163)
(52, 23625803, 8768889, 153)
(52, 5393000508673, 2001714639859, 163)
(52, 12797615490235134653304247, 4750078225408443559709857, 1)
(52, 806868688454488373932933421852550096065569, 299484649364247716483553654683990289891763, 163)
(52, 2153, 783, 9)
(52, 58479301015729521, 21705704051181393, 2771)
(52, 138771655457564842236928895847, 51507737468423526106814617191, 17)
(52, 8749325506703922571740188861834180695165341777, 3247478454725897149498003876763795701034220657, 2771)
(52, 87265827, 32385357, 2771)
(52, 207101136154068758961, 76869522924283193427, 17)
(52, 13057387310438535438147005908681382883, 4846497473796114860142420438731641581, 2771)
(52, 30985241299866522929367680411548178161339775627889, 11500761225388102414754804352683627625158764415859, 17)