How do you go about solving a system of equations like below for integer solutions?
$$xy=6(x+y+z)$$ $$x^2+y^2=z^2$$
Would you first try and list out a number of Pythagorean triples, then try and see which ones when multiplied are divisible by 6 (by 2 and 3)? Since the other side is just the sum of the 3 of them left.
I mean is there an elegant way to find these triplets, apart from a brute-force or any exhaustion method? Or even using Graphs perhaps? And why is there not infinite solutions to this? (there are actually 6 triplets).
P.S. As a bonus, replace the first equation above with:
$$x^2 + (z-510)x + 1020p = 0$$ while in the 2nd equation: $$y=1020p/x$$ where $p$ is Prime.
Mathematica gives me only 2 solutions for $p$ for this. But how??
Let $t = x+y+z \implies z^2 = x^2+y^2 = (x+y)^2 - 2xy = (x+y+z - z)^2 - 2\cdot 6(x+y+z)= t^2-2tz+z^2-12t\implies t^2-2tz-12t=0\implies t(t-2z-12)=0\implies t = 0$ or $t = 2z+12$. Thus $x+y=-z$ or $x+y+z=2z+12$ or $x+y=z+12$. Thus first case yields $xy = 0 \implies x = 0 $ or $y = 0$ or $x = y = 0=z$. Thus $x = 0, y = -z$ is a solution, and $x = -z, y = 0$ is another. For if $x+y = z+12 \implies x^2+y^2=(x+y-12)^2= x^2+y^2+144+2xy-24x-24y\implies 24x+24y=144+2xy\implies 24x-2xy=144-24y\implies 12x-xy=72-12y\implies (12-y)x=72-12y\implies x = \dfrac{72-12y}{12-y}= 12- \dfrac{72}{12-y}\implies (12-y)\mid 72\implies 12-y = \pm \{1, 2,3,4,6,8,9,12,18,24,36,72\}$. You can now check case by case to pick the one that is a solution.