In: Advanced Math
find the integer solutions to A^2 + 2*B^2 = C^2?
the equation have an infinite number of solutions in positive
integers (b=0 isn't interesting); we can find them all, using the
same method as used to find all Pythagorean triples. Firstly note
we can assume a,b,c have no common factor; if they did, we could
divide them out. Conversely, any solution admits further solutions
of the form ka,kb,kc for any positive integer k. Furthermore, if
any two of a,b,c have a common factor, then it's also a factor of
the third. So let's assume the values are pairwise coprime.
2b2=c2−a2=(c−a)(c+a)
The two factors on the right-hand side have a difference of 2a so
are of the same parity. They cannot be both odd, since their
product is even. Also if the two factors had any common factor, it
would also be a factor of their common difference 2a. If any common
prime factor of (c−a) and (c+a)divided a, then it would also divide
(c−a)+a=c, contrary to assumption. So both terms on the right-hand
side are even, and they have no common factor other than 2. This
means one factor must be the square of an even number, let's call
it m, and the other is twice the square of an odd number, let's
call that n.
So we have the following solutions for any even m and odd n, with
(m,n)=1
a=|m2−2n2|/2
b=mn
c=(m2+2n2)/2
with the absolute value needed in a depending on which term in the
right-hand side product is which. These are the primitive
solutions; any integer multiple of them will also be a
solution.
m=2,n=1 gives the easy solution a=1,b=2,c=3 Coprime values of
different parity give infinitely many others. m=4,n=3 gives the
solution 12+2⋅122=172
Note you can also generate an infinite number of solutions with
a=1, and in fact c/b are the alternate continued fraction
convergents of √2, 3/2,17/12,99/70,…3/2,17/12,99/70,… - however,
for any fixed b or c, there are only finitely many solutions
(perhaps zero for some values).