What’s the most natural/useful way of ranking Pythagorean triples “by size”?

283 Views Asked by At

I want to “rank” [primitive] Pythagorean triples by some metric that could reasonably be referred to as “size”.

Naturally, there are a huge number of options: size of hypotenuse, size of smallest leg, perimeter, area, radius of incircle, etc. etc. etc. (Note: One thing I don’t want to use is the row index from the triple’s position in one of the infinite ternary trees.)

Is there a widely-accepted “sizing” of triples? What are the pros and cons of various metrics?

EDIT (inspired by Gerry Myerson’s comment): The “Holy Grail” in this investigation would be a strictly “linear” ordering of the Pythagorean triples. Does (or can) such a thing exist?

EDIT #2: Let $(p,q)$ be the Euclid generating pair for a primitive Pythagorean triple. Applying the Cantor pairing function with $p-q$ and $q$ gives a unique integer value for each triple, which generally correlates with “size”; and I have yet to find anything more compact (e.g., in a set of $38$ of the “smallest” triples, the area-divided-by-6 range is $1–1820$, while the Cantor function for the same set has a range of $4–106$). What’s clearly missing is any obvious way to “descend” through this ordered set.

EDIT #3: The inradius is the most obvious “size” ranking, since the only gaps in the sequence are the powers of $2$. The issue here is the fact that inradius isn’t unique.

4

There are 4 best solutions below

8
On

Given that side-A is odd, side-B is even, and side-C is odd, they take the form of $A = (2x+1), B=4y, C=4z+1), x,y,z\in\mathbb{N}.\quad$ Finding them is a relatively easy but pick any of the three and the solution seems incomplete without the other two. Also, side-A is larger than side-B for half of all triples. (I can demonstrate this if you want.)

Here are some other ratings and methods of finding them. Beginning with Euclid's formula shown here as $ \qquad A=m^2-k^2\qquad B=2mk \qquad C=m^2+k^2.\qquad$ Note: any m-value that yields an integer k-value yields a valid Pythagorean triple.

$\bullet\space$ Perimeter in sizes shown here

\begin{equation} P=2m^2+2mk\implies k=\frac{P-2m^2}{2m}\\ \text{for} \quad \biggl\lfloor\frac{\sqrt{4P+1}+1}{4}\biggr\rfloor\le m \le \biggl\lfloor\frac{\sqrt{2P+1}-1}{2}\biggr\rfloor \end{equation}

The lower limit ensures that $m>k$ and the upper limit insures that $k\ge1$. $$P=286\implies \biggl\lfloor\frac{\sqrt{1144+1}+1}{4}\biggr\rfloor =8\le m \le \biggl\lfloor\frac{\sqrt{572+1}-1}{2}\biggr\rfloor=11\\ \land\quad m\in\{11\}\implies k\in\{2\}$$ $$F(11,2)=(117,44,125)\qquad P=(117+44+125)=286$$

$\bullet\space$ Area:perimeter ratio$\space$ (All are multiples of $\frac{1}{2}$ and here is a way to find them)

$$R=\frac{area}{perimeter}=\frac{AB}{2P}=\frac{2mk(m^2-k^2)}{2(2m^2+2mk)}=\frac{mk-k^2}{2} $$ \begin{equation} R=\frac{mk-k^2}{2}\quad\implies k=\frac{m\pm\sqrt{m^2-8R}}{2}\\\text{for}\quad \big\lceil\sqrt{8R}\big\rceil\le m \le (2R+1) \end{equation} The lower limit insures that $k\in \mathbb{N}$ and the upper limit ensures that $m> k$.

$$R=1\implies \lceil\sqrt{8}\rceil=3\le m \le (2+1)=3 \\\land\qquad m\in\{ 3\}\implies k\in\{ 2,1\}$$ $$F(3,2)=(5,12,13)\space\land\space \frac{30}{30}=1\qquad F(3,1)=(8,6,10)\space\land\space \frac{24}{24}=1$$

$\bullet\space$ Area (Sizes are multiples of $6$ listed in this series). Up to $3$ distinct triples can have the same area.

\begin{equation} k_0=\sqrt{\frac{4m^2}{3}}\cos\biggl({\biggl(\frac{1}{3}\biggr)\cos^{-1}{\biggl(-\frac{3\sqrt{3}D}{2m^4}\biggr)}\biggr)} \\ k_1=\sqrt{\frac{4m^2}{3}}\cos\biggl({\biggl(\frac{1}{3}\biggr)\cos^{-1}{\biggl(\frac{3\sqrt{3}D}{2m^4}\biggr)}\biggr)} \\ k_2=k_1-k_0 \\\qquad\text{ for }\quad\bigg\lfloor\sqrt[\LARGE{4}]{\frac{8D}{3}}\bigg\rfloor \le m \le\big\lceil\sqrt[\LARGE{3}]{D}\big\rceil \end{equation}

$$D=840\implies \lfloor\sqrt[\LARGE{4}]{2(840)}\rfloor=7 \le m \le \lceil\sqrt[\LARGE{3}]{840}\rceil=10\quad\text {and we find}$$ $$m\in \{7\}\implies k\in\{5,8,3\}\qquad\land\qquad m\in\{8\}\implies k\in\{7\}$$ $$\text{We find }\qquad S_{mk}=\{(7,5), (7,8), (7,3), (8,7)\}$$ $$F(7,5)=(24,70,74)\quad F(7,8)=(-15,112,113)\\ F(7,3)=(40,42,58)\quad F(8,7)=(15,112,113)$$

$\bullet\space$ A,B,C product sizes seen here ( All are multiples of $60$. Finding them requires a more convoluted solution available on request.)

$\bullet\space B-A=1$ side difference. An interesting solution to $B-A=1$ was provided by Wacław Sierpiński, $\textit{Pythagorean triangles}$, THE SCRPTA MATHEMATICA STUDIES Number NINE, , GRADUATE SCHOOL OF SCIENCE YESHIVA UNIVERSITY, NEW YORK, 1962, pp. 17-22 with a formula that generates these triples $(T_n)$ sequentially with a starting "seed" of $T_0=(0,0,1)$. \begin{equation}T_{n+1}=3A_n+2C_n+1\qquad B_{n+1}=3A_n+2C_n+2 \qquad C_{n+1}=4A_n+3C_n+2\end{equation}

$$T_1=(3,4,5)\qquad T_2=(20,21,29)\qquad T_3=(119,120,169)\qquad \textbf{ ...}$$

In casual testing, it appears that only the sums and products of A,B,C have unique solutions (only one triple per value) and Area/Perimeter ratio is a pleasing set $\big(R=\big\{\frac{1}{2},\frac{2}{2},\frac{3}{2},\cdots\big\}\big)$ so perhaps one of these are the most "natural" series to pursue.

$\textbf{Update:}$ Gerry Myerson has shown below that perimeter does not map to a unique triple.

8
On

In all the series I searched, I could not find anything suggesting that any $A\times B\times C$ product represents more than one Pythagorean triple. Here are primitive triple product values.

$$P=(m^2-k^2)(2mk)(m^2+k^2) =2 m^5k - 2 mk^5\implies 2mk^5- 2 m^5k + P=0$$

One method of finding these triples is to find the hypotenuse, divide the product by the hypotenuse to find area, and then find the [one-and-only] triple (by area) that has that hypotenuse. This method was provide by Yuri Negometyanov of Kyiv, Ukraine here.

His logic shows how, for $C$ as a factor of P, we can feel confident that \begin{equation} \sqrt[3]{2P} < C < \frac{\sqrt{(4P)^{\frac{4}{5}}+1 } + 1}{2}\quad \land \quad C\bigg |\frac{P}{12} \end{equation}

Any "candidate" factor in this range must take the form of $(4x+1)$ and must also divide $\dfrac{P}{12}$.

For an example, we will use a product: $P=192720$.

$$P=192720\implies \big\lfloor\sqrt[3]{2(192720)}\big\rfloor = 72 \le C \le \left\lfloor\frac{\sqrt{\big(4(192720)\big)^{\frac{4}{5}}+1 } + 1}{2}\right\rfloor=113$$ $$\land\quad \frac{P}{12} =\frac{192720}{12}=16060$$

Only $4$ of the factors of $192720$ and $2$ of the factors of $16060$ are between $72$ and $113$. In this case only 73 is in "C-format" where $\quad \big(C=4x+1\big)\quad$ and only 73 divides P/12 where $\quad \bigg(\dfrac{16060}{73}=1320\bigg).\quad$ We now substitute $1320$ into the area-formula

\begin{equation} k_0=\sqrt{\frac{4m^2}{3}}\cos\biggl({\biggl(\frac{1}{3}\biggr)\cos^{-1}{\biggl(-\frac{3\sqrt{3}D}{2m^4}\biggr)}\biggr)} \\ k_1=\sqrt{\frac{4m^2}{3}}\cos\biggl({\biggl(\frac{1}{3}\biggr)\cos^{-1}{\biggl(\frac{3\sqrt{3}D}{2m^4}\biggr)}\biggr)} \\ k_2=k_1-k_0 \\\qquad\text{ for }\quad\bigg\lfloor\sqrt[4]{\frac{8D}{3}}\bigg\rfloor \le m \le\big\lceil\sqrt[3]{D}\big\rceil \end{equation}

$$D=1320\implies \lfloor\sqrt[4]{1320}\rfloor=6 \le m \le \lceil\sqrt[3]{1320}\space\rceil=11\quad\land\quad m\in \{8,11\}\implies k\in\{3,1\}$$ $$F(8,3)=(55,48,73)\qquad F(11,1)=(120,22,122)$$

Of these findings, we can see that only one triple has $C=73$ and that $P=55\times48\times73=192720$.

3
On

Concerning the so-called sign issue with the ternary tree:

The Wikipedia essay cited elsewhere on this page gives the three matrices $$A=\pmatrix{1&-2&2\cr2&-1&2\cr2&-2&3\cr},\qquad B=\pmatrix{1&2&2\cr2&1&2\cr2&2&3\cr},\qquad C=\pmatrix{-1&2&2\cr-2&1&2\cr-2&2&3\cr}$$ with the properties that 1) if $v$ is a (positive) primitive pythagorean triple then so are $Av$, $Bv$, and $Cv$, 2) every primitive pythagorean triple can be obtained from $v=(3,4,5)$ in exactly one way by multiplying by a (finite) sequence of matrices, each matrix in the sequence being $A$ or $B$ or $C$.

We calculate the inverses, $$A^{-1}=\pmatrix{1&2&-2\cr-2&-1&2\cr-2&-2&3\cr},\qquad B^{-1}=\pmatrix{1&2&-2\cr2&1&-2\cr-2&-2&3\cr},\qquad C^{-1}=\pmatrix{-1&-2&2\cr2&1&-2\cr-2&-2&3\cr}$$ It follows that given any (positive) primitive pythagorean triple $w$, exactly one of the three vectors $A^{-1}w,B^{-1}w,C^{-1}w$ is a positive pythagorean triple.

For example, for $w=(165,52,173)$, we get $A^{-1}w=(-77,-36,85)$, $B^{-1}w=(-77,36,85)$, and $C^{-1}w=(77,36,85)$, so $C^{-1}w$ is the direct ancestor of $w$ on the tree.

9
On

Too big for a comment.

In 2009, I arranged the smallest primitives in a pattern where the same values of $C-B$ were all in the same respective rows. All were odd squares $(2n-1)^2$ and each A-value increment was $(2n-1)$.

It was then easy develop a new formula $F(n,k)$ and, later, to see that it was the same as Euclid's formula $F(m,k)\quad$ if $\quad F(n,k)=F(2m-1+k,k).$

\begin{align*} A=(2n-1)^2+ &\quad 2(2n-1)k \\ B= \qquad &\quad 2(2n-1)k+ \space 2k^2\\ C=(2n-1)^2+ &\quad 2(2n-1)k+ 2k^2\\ \end{align*}

and here is a sample of the "sets" of triples it produces. \begin{array}{c|c|c|c|c|c|} n & k=1 & k=2 & k=3 & k=4 & k=5 \\ \hline Set_1 & 3,4,5 & 5,12,13& 7,24,25& 9,40,41& 11,60,61 \\ \hline Set_2 & 15,8,17 & 21,20,29 &27,36,45 &33,56,65 & 39,80,89 \\ \hline Set_3 & 35,12,37 & 45,28,53 &55,48,73 &65,72,97 & 75,100,125 \\ \hline Set_{4} &63,16,65 &77,36,85 &91,60,109 &105,88,137 &119,120,169 \\ \hline Set_{5} &99,20,101 &117,44,125 &135,72,153 &153,104,185 &171,140,221 \\ \hline Set_{6} &43,24,145 &165,52,173 &187,84,205 &209,120,241 &231,160,281 \\ \hline \end{array}

Note that row$_1$ and column$_1$ are all primitives but, for example, $F(2,3)=(27,36,45)$ is non-primitive. This happens any time $k$ is a multiple of any factor of $(2n-1)$. Aside from $Set_1$ where $(2n-1)=1$, if $(2n-1)$ is prime, the following formula will produce only primitives by generating $(2n-1)-(1)$ primitives and then skipping a triple.

\begin{align*} &A=(2n-1)^2+&2(2n-1)\bigg(k+\bigg\lfloor\frac{(k-1)}{(2n-2)}\bigg\rfloor\bigg)&\qquad\\ &B=&2(2n-1)\bigg(k+\bigg\lfloor\frac{(k-1)}{(2n-2)}\bigg\rfloor\bigg)&\qquad+2\bigg(k+\bigg\lfloor\frac{(k-1)}{(2n-2)}\bigg\rfloor\bigg)^2\\ &C=(2n-1)^2+&2(2n-1)\bigg(k+\bigg\lfloor\frac{(k-1)}{(2n-2)}\bigg\rfloor\bigg)&\qquad+2\bigg(k+\bigg\lfloor\frac{(k-1)}{(2n-2)}\bigg\rfloor\bigg)^2 \end{align*}

If $(2n-1)$ is composite, a primitives will occur more often and, perhaps, they may only be counted using the inclusion exclusion principal. For example, we use $Set_{53}, (2n-1)=105$ which has prime factors $3,5,$ and $7$. Below we let X,Y, and Z be "prime counts" when $k=107$. \begin{equation} (X\cup Y\cup Z)=(X)+(Y)+(Z)-(X\cap Y)-(X\cap Z)-(Y\cap Z)+(X\cap Y\cap Z) \end{equation} $$X=\biggl\lfloor\frac{107}{3}\biggr\rfloor=35\qquad Y=\biggl\lfloor\frac{107}{5}\biggr\rfloor=21\qquad X=\biggl\lfloor\frac{107}{7}\biggr\rfloor=15$$ $$X\cap Y=\biggl\lfloor\frac{107}{3*5}\biggr\rfloor=7\quad X\cap Z=\biggl\lfloor\frac{107}{3*7}\biggr\rfloor=5\quad Y\cap Z=\biggl\lfloor\frac{107}{5*7}\biggr\rfloor=3$$ $$ X\cap Y\cap Z=\biggl\lfloor\frac{107}{3*5*7}\biggr\rfloor=1$$

$$\text{The "multiple count" is }\quad X\cup Y\cup Z=35+21+15-7-5-3+1=57$$ \par Out of $107$ triples for $n=53\land k=107$ the number of primitives is $107-57=50$.

But the whole point of this presentation is to show how these triples may be related to natural numbers and made ordinal using Cantor's pairing function. A simple technique does not produce triples in size order but it does follow Cantor's function and is helped by the fact the $F(n,k)$ produces no trivial triples or the doubles and even-square multiples that Euclid's formula does.

If we increment $n$ and $k$ in specific patterns, we get

$(1,1),\\ (1,2),\space (2,1),\\ (1,3),\space (2,2),\space (3,1),\\ (1,4),\space (2,3),\space (3,2),\space (4,1)$

Note that $F(2,3)=(27,36,45)$ and others are non-primitive but I don't know what to do about that. Whether that is addressed or not, perhaps you can find the "products" of all these, and see what order $(n,k)$ can be arranged to selected for ascending size. Here are a few that I believe are arranged in "product" order.

$$(3,4,5)\quad (5,12,13)\quad (15,8,17)\quad (7,24,25)\quad (21,20,29)\\ (35,12,37)\quad (9,40,41)\quad (11,60,61)\quad (63,16,65)\quad (45,28,53)$$

Aside: I have proven (not here) that the formula generates all primitives by assuming some increment added to or subtracted from the $k$ components. Expansion shows that any other increment results in non-integer values for B and C.