Find all solutions to the equation $x^2 + 3y^2 = z^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.
 A: 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$.
A: 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.
A: 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)$
A: 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$.
A: 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
