Is there a formula that genrates only and all primitive Pythagorean triples?

96 Views Asked by At

The most common formula for generating Pythagorean triples is Euclid's, shown here as $$A=m^2-k^2\qquad B=2mk\qquad C=m^2+k^2$$ It generates all primitves but also generates trivals, doubles, square multiples, and doubles of square multiples of primitives. A variation of this is

\begin{align*} &A=(2n-1+k)^2-k^2&&=(2n-1)^2+2(2n-1)k\\ &B=2(2n-1+k)k &&=\phantom{(2n-1)^2+{}} 2(2n-1)k+2k^2\\ &C=(2n-1+k)^2+k^2 &&=(2n-1)^2+2(2n-1)k+2k^2 \end{align*} It generates no trivials and all primitives but also generates odd square multiples of primitives.

In the latter, if we let $\,n=1\implies \big(A=2k+1\quad B=2k^2 + 2k\quad C=2 k^2 + 2 k + 1\big),\,$ or $\,k-1\implies \big(A=4n^2-1\quad B=4n\quad C=4n^2+1\big)$ we get only primitives but not all primitives.

Is there a formula that genrates only and all primitives besides the one that generates the ternary tree? I doubt such a formula exists but I would love to see it if it does.

1

There are 1 best solutions below

0
On

As Will Jagy pointed out in his comment, Euclid's formula satisfies your criteria IF certain conditions are stated. The trick is to find a way to include those conditions in a formula, rather than having them stated independently. Here is as close as I can come; apologies if you think it is falls short of what you seek.

$$r:=2^a(2u-1); s:=2^{a+b}(2v-1); (a,b,u,v) \in \mathbb Z^+$$ $$ m:=\frac{r}{\gcd(r,s)}; k:=\frac{s}{\gcd(r,s)}$$ $$ A=|m^2-k^2|; B=2mk; C=m^2+k^2$$ It is possible to cram all of this into one set of formulas for $(A,B,C)$ in terms of the variables $(a,b,u,v)$ if necessary, but the typography would be horrible.

A limitation similar to $(a,b,u,v) \in \mathbb Z^+$ is (I believe) generally presumed, even if not expressly stated, in all such formulas for Pythagorean triples. The formulas arrived at here for the Pythagorean triples $A,B,C$ meet the criteria of Euler's formula in terms of completeness, ensure that one and only one of $m,k$ is even, and avoid any shared factors among $m,k$, hence among $(A,B,C)$, ensuring primitive triples.