# Is this Pythagorean triple formula original?

I am hesitant because I have asked this question before in a different form here. In 2009, I knew nothing about Pythagorean triples, not even Euclid's formula. In my ignorance, I did a brute force search, and the patterns I saw led to a formula for generating them. Years later, when I learned about Euclid's formula, it was confusing and I questioned it here. I'm an amateur but what I have found has kept me plodding along for over a decade.

I developed a formula that should have been discovered in the $$2300$$ years since Euclid. It generates the subset of triples where $$GCD(A,B,C)$$ is an odd square and this includes all primitives––without the trivials, the doubles and the even-square multiples of Euclid's formula. The formula is like Euclid's $$\quad A=m^2-k^2,\quad B=2mk,\quad C=m^2+k^2\quad$$ but, as I discovered later, with $$\space m\space$$ replaced by $$\space (2m-1+k)\space$$ and this is why I show them both with a $$\space k.\space$$ This formula generates non-trivial triples for every pair of natural numbers $$(n,k)$$ and very few non-primitives. Here is

\begin{align*} A=(2n-1)^2+ &\quad 2(2n-1)k \\ B= \qquad &\quad 2(2n-1)k+ \quad 2k^2\\ C=(2n-1)^2+ &\quad 2(2n-1)k+ \quad 2k^2\\ \end{align*} It produces "sets" of triples where non-primitives like $$\space(27,36,45)\space$$ are in predictable/avoidable locations. $$\begin{array}{c|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}$$

1. $$\text{If }\space(2n-1)=1\space$$ or $$\space k=1,\space$$ triples are primitive: $$\quad C-B=1\space \lor\space C-A=2.$$
2. $$\text{If }\space(2n-1)\space$$ is prime, the following formula will generate only primitives. It repeatedly generates $$\quad\big((2n-1)-1\big)\quad$$ primitives and then skips a predicted non-primitive.

\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*} 3) Else, there is a non-primitive whenever $$\space k\space$$ is a multiple of any factor of $$\space(2n-1).$$

I have not been able to find reference anything like this formula or the sets it generates in the many books I've bought on the subject or on web sites or in forums like this.

Is this formula original with me or is there someone, somewhere or something I should cite in my references?

• If your formula is a linear transformation of Euclid's — and it looks like it is, by your characterization — then there's no fundamental difference between it and Euclid's; it generates the exact same values. This is, at heart, no different than replacing $k$ with $k+1$ in the original formula. Commented Feb 16, 2021 at 3:57
• @Steven Stadnicki I developed my formula about $8$ years before I knew Euclid's formula existed. They do produce the same results if $$A=(2m-1+k)^2-k^2,\qquad B=2(2m-1+k)k,\qquad C=(2m-1+k)^2+k^2$$ but I only discovered this relationship a year or two after I discovered Euclid's formula. Euclid's formula will "find" doubles and even-square multiples of primitives that my formula won't but mine shows even more relationships than I have mentioned in my question –– relationships that are not apparent with Euclid's formula. BTW, Euclid's is better at "finding" triples where $X=B-A$. Long story. Commented Feb 16, 2021 at 4:08
• Apologies; I'm not trying to suggest that you created it as a linear transformation of Euclid's formula. Having come up with this on your own is an impressive feat and not to be sold short! I'm just saying that I wouldn't consider this an original formula, just 'Euclid's formula wearing a different hat' as it were. Deriving the Euclid formula on your own is still a fine feat. Commented Feb 16, 2021 at 16:42
• @Steven Stadnicki You are very kind. Perhaps the title and the question should read, "Are there references to this formula elsewhere?" BTW, I found the formula by noticing groups of triples where $C-B$ was always $(2n-1)^2$ and that $A_{n+1}-A_n$ was always $(2n-1)$. Commented Feb 16, 2021 at 16:54