2

Find all positive integer solutions to the equation $x^2 + 3y^2 = z^2$

So here's what I've done thus far: I know that if a solution exists, then there's a solution where (x,y,z) = 1, because if there is one where $(x,y,z) = d$, then $\frac{x}{d}, \frac{y}{d}, \frac{z}{d}$. is also a solution.

I'm trying to mimic the pythagorean triple proof where they have that $x = u^2 - v^2$ and $y = 2uv$ and $z = u^2 + v^2$

So, looking at the original equation mod 4, I can see that it's in the form: $(0 or 1) - (0 or 1) = 3(0 or 1)$. Thus we for sure know that $3y^2$ is congruent to 0 mod 4 and that $y$ is even. We also learned that $z$ and $x$ are either both even or both odd.

From there I'm guessing I need to handle each case, but I'm stuck as to where to go from here.

5 Answers5

2

The "right" way to find the parametrization of all Pythagorean triples is to realize that primitive Pythagorean triples are in one-to-one correspondence (with a couple of easy exceptions) with lines of rational slope through a given rational point on the circle $s^2+t^2=1$. Proofs of this type are easy to find once you know what you're looking for. The reason I call this the "right" proof is that you don't have to make any clever decisions, consider cases modulo $4$, or anything like that. Once you convert the problem to lines of rational slope, you just do some algebra and that's that.

Happily, the exact same method works for any plane conic, and hence any homogeneous quadratic equation in three variables. You will start with a fixed rational point on the ellipse $s^2+3t^2=1$ (I recommend $(-1,0)$), write down the general equation of a line with rational slope through that point, and solve for the second point of intersection with the ellipse. That gives (once denominators are cleared) a formula for all primitive integer solutions to $x^2+3y^2=z^2$, and you can obtain all integer solutions by multiplying through by any integer $d$.

Greg Martin
  • 78,820
2

Just to complete Greg Martin's answer, the line through through $(-1,0)$ with slope $m$ intersects the unit circle in two points that are solutions of: $$ y=m(x+1), \qquad x^2+3y^2 = 1,$$ hence the $x$-coordinates are solutions of: $$x^2+3m^2(x+1)^2 = 1$$ or: $$ (1+3m^2) x^2 + 6m^2 x + (3m^2-1) = 0.\tag{1}$$ A solution to $(1)$ is obviously given by $x_0=-1$, hence Vieta's theorem gives that the other solution is given by: $$ x_1=\frac{1-3m^2}{1+3m^2},\qquad y_1=\frac{2m}{1+3m^2},$$ hence all the primitive solutions of $x^2+3y^2=z^2$ are given by: $$ x = |p^2-3q^2|,\quad y=2pq,\quad z=p^2+3q^2$$ with $\gcd(p,q)=1$ and $p,q$ not both odd.

Jack D'Aurizio
  • 353,855
  • $x=1, y=1, z=2$ is not included. – Hang Wu Aug 21 '19 at 17:31
  • To include $x=1,y=1,z=2$, one should set $p=q=1$ and divide $x,y,z$ by their greatest common divisor. All other solutions are multiple of one primitive solution. – Hang Wu Feb 03 '22 at 09:06
0

I don't think y is necessarily even, $13^2 + 3*3^2 = 14^2.$

There seem to be two sets of solutions

$2x = p^2 - 3q^2, y = 2pq, 2z = p^2 + 3q^2$ and $pq$ odd

$x = p^2 - 3q^2, y = pq, z = p^2 + 3q^2$ and $pq$ even

$gcd(p,q) = 1 = gcd(p,3)$

fuzzy
  • 81
  • Just came back to this and realised I made a bit of a mess of it. So here it is with a bit of the workings... x^2 + 3y^2 = z^2

    3y^2 = (z - x)(z + x) = 3rp^2 * rq^2

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

    (1) r = 1: 2x = q^2 - 3p^2, y = pq, 2z = q^2 + 3p^2, pq odd

    (2) r = 2: x = q^2 - 3p^2, y = 2pq, z = q^2 + 3p^2, pq even

    – fuzzy May 28 '17 at 13:29
  • Just came back to this and realised I made a bit of a mess of it. Here it is again with a bit of working...

    x^2 + 3y^2 = z^2

    3y^2 = (z - x)(z + x) = (3rp^2)*(rq^2)

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

    (1) r = 1: 2x = q^2 - 3p^2, y = pq, 2z = q^2 + 3p^2, pq odd

    (2) r = 2: x = q^2 - 3p^2, y = 2pq, z = q^2 + 3p^2, pq even

    Hope I got it right this time. (Only have 5mins!)

    – fuzzy May 28 '17 at 13:37
0

I developed an alternative to Euclid's formula that may help here.

$$A=(2n-1)^2+2(2n-1)k\quad B=2(2n-1)k+2k^2\quad C=(2n-1)^2+2(2n-1)k+2k^2$$

Whenever $(2n-1)$ and $k$ are both multiples of $3$, then $9$ will be a factor of $GCD(A,B,C)$.

For example:

$F(2,3)=(27,36,45)\qquad F(2,6)=(45,108,117)\qquad F(2,9)=(63,216,225)\quad$ $F(5,3)=(135,72,153)\qquad F(5,6)=(189,180,261)\qquad F(5,9)=(243,324,405)\quad$

If you divide the $B$ term by $3$ in any of these triples, it will meet your criteria. Just remember let $$n\in\{2,5,8,11,...\}\quad\land\quad k\in\{3,6,9,12,...\}$$

and you will find an infinite number of these triples for any given $n$ or $k$.

poetasis
  • 6,338
-1

Rearrange we have 3y^2=z^2-x^2=(z-x)(z+x)

this means 3|(z-x)(z+x) therefore 3|z-x or 3|z+x

In fact 3 divides only one of them

For the sake of contradiction suppose 3 divides both z-x and z+x

then 3|2z and 3|2x

then 3|gcd(2z,2x)=2gcd(z,x)

since gcd(3,2)=1

therefore 3|gcd(z,x)

then 3|z, 3|x

indicating 9|z^2, 9|x^2

then 9|3y^2

then 3|y^2

then 3|y

then 3 is a common divisor of x, y and z, which is a contradiction to

gcd(x,y,z)=1

Without loss of generality assume 3|z-x

then y^2=(z+x)(z-x)/3

let d=gcd(z+x,(z-x)/3)

then d|z+x, d|3(z-x)/3=z-x

then d|2z, d|2x

then d|gcd(2z,2x)=2gcd(z,x)=2

(it’s easy to show gcd(z,x)=1 based on the assumption that gcd(x,y,z)=1)

case 1: d=1

then (z-x)/3=u^2, z+x=v^2

(this is based on the theorem: if a^k=bc, and if gcd(b,c)=1, then b=m^k, c=n^k

which can be easily proven by the fundamental theorem of arithmetics)

then x=|v^2-3u^2|/2, y=uv, z=(v^2+3u^2)/2,

where gcd(u,v)=1 and u, v are both odd

case 2: d=2

then gcd((z+x)/2, (z-x)/6)=1

then based on the same previous theorem (z-x)/6=a^2, (z+x)/2=b^2

then x=|b^2-3a^2|, y=2ab, z=b^2+3a^2,

where gcd(a,b)=1,

and exactly one of a, b is odd and the other is even

JJS
  • 5