Generating Pythagorean triples $(a,b,c)$ such that $b>a+n$ for integer $n$, and $a+b$ is minimum

78 Views Asked by At

I'm trying to generate a Pythagorean triple, that is, $a,b,c \in \mathbb N$ that $$a^2 + b^2 = c^2$$ under the condition that $b > a + n$, $n \in \mathbb N$ and $a+b$ is minimum.

I tried expanding the forumula or trying to use the Euclid's formula but I don't know how to add the constraint.

1

There are 1 best solutions below

0
On BEST ANSWER

The difference between legs of a [primitive] Pythagorean triple is always $\quad P=p_1^a p_2^b p_3^c \cdots\quad$ the product "P" of one-or-more [non-negative] "powers" of primes "p" where $\quad P\equiv p_n^x\equiv\pm1\pmod8.\quad $ Under $200,$ $$\space P\in \bigg\{1,\space 7,\space 17,\space 23,\space 31,\space 41,\space 47,\space \big(7^2\big),\space 71,\space 73,\space 79,\space 89,\space 97,\space \big(7\times 17\big),\\ 127, 137,\space 151,\space \big (7\times23\big), \space 167,\space 191,\space 199 \bigg\}$$ The statement of this question $\mid B-A\mid >n$ would be better phrased as $\mid B-A\mid \le P\space$ as we will see below.

For $P=1$. there are three formulas, two of which generates the "pell" number pairs $\big(2,5,12,29,70,\cdots\big)$ needed to feed Euclid's formula here shown as $\quad A=m^2-k^2,\quad B=2mk,\quad C=m^2+k^2.\quad$ For example $$F(2,1)=(3,4,5)\quad F(5,2)=(21,20,29)\quad F(12,5)=(119,120,169)$$

For $P>1,\quad$ one formula may be generalized to $\quad m=k+\sqrt{2k^2\pm P}\quad 1\le k \le\big\lfloor \sqrt{P}\space\big\rfloor \quad$ which generates at least $2^x$ series of pell-like numbers where $x$ is the sum of powers of $p_n.\quad$ Any $k$-value in range which yields an integer is the first-k $\space (k_1)\space$ of such a series. For $P=7,\space$ this means there are $2^1$= $2$ series: $\space P=7\implies k_1\in\{1.2\}.$

\begin{align*} 1+\sqrt{2+7}=4\quad & F(4,1)=(15,8,17)\\ 4+\sqrt{32-7}=9\quad & F(9,4)=(65,72,97)\\ 9 +\sqrt{162+7}=22\quad & F(22,9)=(403,396,565)\\ 22 +\sqrt{968-7}=53\quad & F(53,22)=(2325,2332,3293)\\ \vdots\\ \text{ and }\\ \\ 2+\sqrt{8-7}=3\quad &F(3,2)=(5,12,13)\\ 3 +\sqrt{18+7}=8\quad &F(8,3)=(55,48,73)\\ 8 +\sqrt{128-7}=19\quad &F(19,8)=(297,304,425)\\ 19 +\sqrt{722+7}=46\quad &F(46,19)=(1755,1748,2477)\\ \vdots \end{align*}

In this case, we have generated triples for $n>6.\quad$ For $n>7$, we would have to use the formula $m=k+\sqrt{2k^2\pm 17},\space 1\le k \le\big\lfloor \sqrt{17}\space\big\rfloor =4\quad$ to get $\space k_1\in\{2,3\}$

$$F(7,2)=(45,28,53)\quad F(16,7)=(207,224,305)\quad F(39,16)=(1265,1248,1777))\quad\cdots\quad\\ F(4,3)=(7,24,25)\quad F(11,4)=(105,88,137)\quad F(26,11)=(555,572,797)\quad\cdots $$

For $P=49=7^2,\space k_1\in\{4,5,6,7\};\quad$ for $P=119=7\times17,\space k_1\in\{1,5,8,10\},\space$ etc.

Do note that, for half of all triples, $A>B. \quad$ This simply means $\mid\space B-A\mid\space\equiv \space\pm1\pmod8.\quad$ The generalized formula works for any $P>n.$

The smallest first triple in any of the one-or-more series of triples generated contains the minimum for the criteria. For example, for $\quad n>6\longrightarrow (15,8,17),\space (5,12,13),\quad$ the minimum $A+B\space$ is $\space 5+12=17$.

A brief list of these minimum $B+A$ values for $n\le P$ is \begin{equation}n(A,B,C)\longrightarrow B+A\\ 1(3,4,5)\longrightarrow 7\\ 7(5,12,13)\longrightarrow 17\\ 17(7,24,25)\longrightarrow 31\\ 23(35,12,37)\longrightarrow 47\\ 31(9,40,41)\longrightarrow 49\\ 41(77,36,85)\longrightarrow 113\\ 47(63,16,65)\longrightarrow 79\\ 49(11,60,61)\longrightarrow 71\\ \end{equation}