# Primitive Pythagorean Triples & (Semi-)Prime Numbers

There seems to be no shortage of people finding patterns related to prime numbers on this forum. Alas, I felt the need to share my stumbling upon such an instance.

Take a list of primitive Pythagorean triples, let their sides be denoted by the common a , b , and c .

I have noticed that the difference ( a-b with a>b) between a and b is very, very often a prime number, which holds for large values. And, if the number is not prime, then it is semi-prime (only factors are 1, itself, and two primes).

3/4/5= 1 .... 1428/1475/2053= 47 .... 693/1924/2045= 1231 20/21/29=1 .... 1204/1653/2045= 449 .... 1281/1640/2081= 349 5/12/13= 7 8/15/17= 7 7/24/25= 17 12/35/37= 23 9/40/41= 31

Of course, there are those that fail (are semi-prime; I don't believe I've found any counterexamples).

For example: 819/1900/2069= 1081 (23*47).

I find it intriguing that it outputs so many primes. I am not sure which fields of mathematics this relates to, but I would love to have the input of others. Is this only an interesting phenomenon or a gold nugget?

Pythagorean Triples up to 2100 + link up to 10000: http://www.tsm-resources.com/alists/trip.html

My conjecture: : Every number generated in this way is a prime or semi-prime number. And: note that this only includes primitive triples.

• I think you probably need more data. When you say "I don't believe I've found any counterexamples," what statement would an example counter? What input would you hope to get on this topic? – abiessu Jul 14 '18 at 3:46
• Are you saying that you have found no case in which $a-b$ is neither prime nor semi-prime? – saulspatz Jul 14 '18 at 4:15
• Note that $1$ is not considered a prime nowadays, so the precise formulation of your conjecture would be that there are never more than two factors in the prime factorization of the difference. (I take it that you're interested in a) proving or disproving this conjecture and b) understanding why so many of the differences are primes.) – joriki Jul 14 '18 at 7:35
• abiessu - You're right, I do; I haven't been able to find exhaustive lists of only promitive Pythagorean triples, and I'm not familiar enough with software development to create something that would generate them correctly. – ΣVΔL Jul 14 '18 at 10:42
• saulspatz - Yes, but my resources are limited. I was hoping to throw it out the world and let it be scrutinized, in case I missed anything. – ΣVΔL Jul 14 '18 at 10:44

\begin{align} 4635^2 + 4292^2 &= 6317^2 & 4635 - 4292 &= 343 = 7^3 \\ 3445^2 + 708^2 &= 3517^2 & 3445 - 708 &= 2737 = 7\cdot 17 \cdot 23\\ 31005^2 + 28268^2 &= 41957^2 & 31005 - 28268 &= 2737 = 7\cdot 17 \cdot 23 \end{align}

The difference $a-b$ of the legs in a primitive Pythagorean triple can have arbitrarily many prime factors (distinct or not). But to have many prime factors the difference must be large, and hence the legs must be large too, so one first encounters many cases with few prime factors.

How to find triples such that the difference has many prime factors:

Recall that one can parametrise the primitive Pythagorean triples by $$(r^2-s^2, 2rs, r^2+s^2)$$ with $r$ and $s$ coprime and of different parity. Thus the difference "odd leg $-$ even leg" is $$(r^2 - s^2) - 2rs = (r - s)^2 - 2s^2\,.$$ If $r$ and $s$ are coprime, then $r-s$ and $s$ are coprime too, and a prime $p$ can divide the difference of the legs of a primitive Pythagorean triple if and only if $2$ is a square modulo $p$, that is the case if and only if $p \equiv \pm 1 \pmod{8}$. Every such prime can be written in the form $x^2 - 2y^2$ with $x,y$ (positive) integers, e.g. $7 = 3^2 - 2\cdot 1^2$, $17 = 5^2 - 2\cdot 2^2$, $23 = 5^2 - 2\cdot 1^2$.

We can factor such a representation as $p = (x + y\sqrt{2})\cdot (x - y\sqrt{2})$, and the set $$\mathbb{Z}[\sqrt{2}] = \{ x + y\sqrt{2} : x,y \in \mathbb{Z}\}$$ is a ring, in particular the product of two such numbers is again of that form: $$(x+y\sqrt{2})(u + v\sqrt{2}) = (xu + 2yv) + (xv + yu)\sqrt{2}\,.$$ And $(x-y\sqrt{2})(u-v\sqrt{2}) = (xu + 2yv) - (xv + yu)\sqrt{2}$, so $$(x^2 - 2y^2)(u^2 - 2v^2) = (xu + 2yv)^2 - 2(xv + yu)^2\,.$$ Thus if you have distinct primes $p_1, \dotsc, p_r$ with representations $p_{\rho} = x_{\rho}^2 - 2y_{\rho}^2$, then $$x + y\sqrt{2} = \prod_{\rho = 1}^r (x_{\rho} + y_{\rho}\sqrt{2})$$ gives us a pair of positive integers with $$x^2 - 2y^2 = \prod_{\rho = 1}^r (x_{\rho}^2 - 2y_{\rho}^2) = \prod_{\rho = 1}^r p_{\rho}\,.$$ Since the $p_{\rho}$ are by assumption all distinct, $x$ and $y$ are coprime - if not all $p_{\rho}$ are distinct, one must choose the signs of $x_{\rho}$ and $y_{\rho}$ corresponding to the same prime in a compatible way to have $\gcd(x,y) = 1$, but that can always be done - and $x$ is odd. Then $r = \lvert x \rvert +\lvert y\rvert$ and $s = \lvert y\rvert$ produces a primitive Pythagorean triple such that the difference between the legs is $p_1\cdot \dotsc \cdot p_r$.

As the first example at the top shows, it is not necessary that all the primes are distinct, we can find primitive Pythagorean triples for which the difference between the legs is divisble by a power of some prime, and we can have the exponent as large as we please. The second and third example have the smallest possible difference between the legs such that the difference is divisible be three distinct primes. The second corresponds to $(3+\sqrt{2})(5+\sqrt{2})(5-2\sqrt{2})$ and the third to $(3+\sqrt{2})(5+\sqrt{2})(5+2\sqrt{2})$.

• Although this isn't the answer I was hoping for, thank you! – ΣVΔL Jul 14 '18 at 22:36

$1320^2+1575^2=2055^2$

$1575-1320=255=3 \cdot5 \cdot17$

I believe there will be more numbers with many factors as they grow in size.

• OP asks about primitive Pythagorean triples, your counterexample has $\gcd(1320, 1575, 2055)=15$ – rtybase Jul 14 '18 at 9:22
• True, I just missed that out, thanks. I will check other cases. – usiro Jul 14 '18 at 9:30