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.

  • $\begingroup$ 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? $\endgroup$ – abiessu Jul 14 '18 at 3:46
  • 1
    $\begingroup$ Are you saying that you have found no case in which $a-b$ is neither prime nor semi-prime? $\endgroup$ – saulspatz Jul 14 '18 at 4:15
  • $\begingroup$ 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.) $\endgroup$ – joriki Jul 14 '18 at 7:35
  • $\begingroup$ 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. $\endgroup$ – ΣVΔL Jul 14 '18 at 10:42
  • $\begingroup$ 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. $\endgroup$ – Σ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})$.

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


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

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

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

Among the Pythagorean triples where $|A-B|\le100$, not all prime numbers are represented among primitive's differences. For example, there are no primitives where $|A-B|=2, 3, 5, 11, 13, 19 ...$ Here those that can be found with brute force and I have found way to generate all primitives where $|A-B|=X$ for any prime difference contained in the following list. Let me know if you would like to know how.

$$\\diff=7\\ (5,12,13)\quad (15,8,17)\quad (55,48,73)\quad (65,72,97)\quad (297,304,425)\quad (403,396,565)\quad (1755,1748,2477)\quad (2325,2332,3293)\quad $$

$$ \\diff=17\\ (7,24,25)\quad (45,28,53)\quad (105,88,137)\quad (207,224,305)\quad (555,572,797)\quad (1265,1248,1777)\quad (3293,3276,4645)\quad (7315,7332,10357)\quad $$

$$ \\diff=23\\ (33,56,65)\quad (35,12,37)\quad (133,156,205)\quad (275,252,373)\quad (855,832,1193)\quad (1525,1548,2173)\quad (4905,4928,6953)\quad $$

$$ \\diff=31 (9,40,41)\quad (91,60,109)\quad (171,140,221)\quad (429,460,629)\quad (893,924,1285)\quad (2607,2576,3665)\quad (5311,5280,7489)\quad $$

$$ \\diff=41\\ (39,80,89)\quad (77,36,85)\quad (319,360,481)\quad (377,336,505)\quad (2001,1960,2801)\quad (2059,2100,2941)\quad $$

$$ \\diff=47\\ (63,16,65)\quad (85,132,157)\quad (225,272,353)\quad (663,616,905)\quad (1475,1428,2053)\quad (3705,3752,5273)\quad $$

$$ \\diff=71\\ (13,84,85)\quad (231,160,281)\quad (351,280,449)\quad (1113,1184,1625)\quad (1809,1880,2609)\quad (6731,6660,9469)\quad $$

$$ \\diff=73\\ (95,168,193)\quad (117,44,125)\quad (455,528,697)\quad (817,744,1105)\quad (2905,2832,4057)\quad (4515,4588,6437)\quad (99,20,101)\quad (161,240,289)\quad (341,420,541)\quad (1219,1140,1669)\quad (2263,2184,3145)\quad (6837,6916,9725)\quad $$

$$ \\diff=89\\ (51,140,149)\quad (209,120,241)\quad (629,540,829)\quad (931,1020,1381)\quad (3367,3456,4825)\quad (5733,5644,8045)\quad $$

$$ \\diff=97\\ (15,112,113)\quad (325,228,397)\quad (465,368,593)\quad (1575,1672,2297)\quad (2387,2484,3445)\quad $$


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.