Can we prove Euclid’s formula skips triples where $GCD(A,B,C)\ne 2\land GCD(A,B,C)\ne x^2, x\in\mathbb{N}$

pythagorean triples

Given $A=m^2-n^2\quad B=2mn\quad C=m^2+n^2\quad$
I've had success in finding triples for a given side by solving Euclid's equations for $n$ and testing a finite range of $m$ values to see which one(s) yield a positive integer. Primitives are a sure find, if they exist, but I have had mixed luck in finding multiples. For example:
It is easy to find $27,36,45$ if we know only the value of $C$.
$$C=m^2+n^2\Rightarrow n=\sqrt{C-m^2}\text{ where } \biggl\lceil\sqrt{\frac{C}{2}}\space\space\biggr\rceil \le m\le\bigl\lfloor\sqrt{C}\bigr\rfloor$$

I developed these limits using a lot of heuristics and a little of logic.

$$\text{For }C=45,\space m_{min}=\lceil\sqrt{22.5}\space \rceil=5\land m_{max}=\lfloor{\sqrt{45}}\rfloor=6$$
$$\sqrt{45-5^2}\notin\mathbb{N}\text{ but }\sqrt{45-6^2}=3\text{ and }f(6,3)=(27,36,45)$$

$$\text{Now take the case of }C=51\text{ knowing }45,24,51=3(15,8,17)$$
Disregarding any limits except that $m^2\lt C$, we find:
$$\sqrt{51-1}\notin\mathbb{N}\quad\sqrt{51-4}\notin\mathbb{N}\quad\sqrt{51-9}\notin\mathbb{N}\quad\sqrt{51-16}\notin\mathbb{N}\quad\sqrt{51-25}\notin\mathbb{N}\quad\sqrt{51-36}\notin\mathbb{N}\quad\sqrt{51-49}\notin\mathbb{N}\quad$$

I can find $C=17$: $f(4,1)=15,8,17$ but not $C=51.$ From my casual testing, I can infer that Euclid's formula generates $only$ triples where $GCD(A,B,C)=2$ when $m,n$ are the same parity, or where $GCD(A,B,C)=x^2, x\in\mathbb{N}$ when $m,n$ are of opposite parity. Is there a way we can prove this?

Best Answer

The Euclid formula will generate all primitive triples. For full generality you need to multiply through by $k > 0$.

$A = k(m^2 - n^2), B = k(2mn), C = k(m^2 + n^2)$

Related Question