# Two primes in a Primitive Pythagorean Triangle

Let's recall the

Euclidean Rule for Pythagorean Triangles:

Let (m,n) be co-prime natural numbers (m<n), then

h := n$^{2}$ + m$^{2}$
e := 2 m n
d := n$^{2}$ - m$^{2}$ = (n - m) * (n + m)

form the hypothenuse, the even and the odd leg
of a primitive Pythagorean triangle (PPT)

If we want two primes as sides, since e is even, d and h must be prime numbers,

and that means for d, the difference (n - m) must be one, resulting in n = 1 + m

With this assignment in the formula for h, we have h = 2m * (m + 1) +1

Now let d be a prime p (> 2, since d is odd!), we with have m = $\frac{p - 1}{2}$,

n = 1 + m, or n = $\frac{p + 1}{2}$, e = $\frac{p^2 - 1}{2}$ and h = $\frac{p^2 + 1}{2}$ the following

Theorem: Let 2 < p $\in \mathbb{P}$ be the odd leg and $\frac{p^2 - 1}{2}$ be the even leg of a rectangular triangle,
then the the hypothenuse will be $\frac{p^2 + 1}{2}$.

Corollary: For '2 primes in PPT' we must have the hypothenuse h = $\frac{p^2 + 1}{2}$ be a prime

The OEIS sequence A048161 ("Primes p such that q=(p^2+1)/2 is also a prime")

starts with: 3, 5, 11, 19, 29, 59, 61, 71, 79, 101, 131, 139, 181, 199, 271, 349, 379, 409, 449

see:http://oeis.org/search?q=A048161&sort=&language=english&go=Search

The odd leg has to be 1 mod 10 or 9 mod 10. If it is 3 mod 10 or 7 mod 10, the hypotenuse will be a multiple of 5. If it is 5 mod 10 the odd leg isn't prime. There are some small exceptions where the multiple of 5 is exactly 5.

The odd leg has to be 1 mod 10 or 9 mod 10.

We have a necessary condition, that the odd leg is $\pm 1$ mod 10, but the
condition is not sufficient, as is shown by the various primes, which are $\pm 1$ mod 10
but do not fit in the pattern as 31,41,89,109,149,151,179,191 etc

The first two examples of a '2 primes in a Pythagorean Triangle' are

(odd/evem/hypothenuse d/e/h) '3 - 4 - 5' and '5 - 12 - 13'

with $d_{i},h_{i}$ being prime, $e_{i}= \frac {d_{i}^{2}-1}{2}$ and $h_{i}= \frac {d_{i}^{2}+1}{2}$

Especially, we have $h_{i}$ = $d_{i+1}$ and $h_{i+1}$ = $\frac{d_{i}^{4}+2*d_{i}^{2}+5}{8}$

Code:
The first such concatenations are:

(listed is for the first & second triangle: d/e/h = d/e/h)

3            4            5                 12                 13
11           60           61               1860               1861
19          180          181              16380              16381
59         1740         1741            1515540            1515541
271        36720        36721          674215920          674215921
349        60900        60901         1854465900         1854465901
521       135720       135721         9210094920         9210094921
929       431520       431521        93105186720        93105186721
1031       531480       531481       141236026680       141236026681
1051       552300       552301       152518197300       152518197301
1171       685620       685621       235038077820       235038077821
2381      2834580      2834581      4017424722780      4017424722781
2671      3567120      3567121      6362176114320      6362176114321
2711      3674760      3674761      6751934203560      6751934203561
2719      3696480      3696481      6831985891680      6831985891681
3001      4503000      4503001     10138509003000     10138509003001
3499      6121500      6121501     18736387246500     18736387246501
3691      6811740      6811741     23199907725540     23199907725541
4349      9456900      9456901     44716488261900     44716488261901
4691     11002740     11002741     60530154756540     60530154756541
4801     11524800     11524801     66410519044800     66410519044801
4999     12495000     12495001     78062524995000     78062524995001
5591     15629640     15629641    122142838894440    122142838894441
5669     16068780     16068781    129102861412980    129102861412981
6101     18611100     18611101    173186540216100    173186540216101
6359     20218440     20218441    204392678235240    204392678235241
6361     20231160     20231161    204649937703960    204649937703961
7159     25625640     25625641    328336738330440    328336738330441
7211     25999260     25999261    337980786273060    337980786273061
7489     28042560     28042561    393192613719360    393192613719361
8231     33874680     33874681    573747006425880    573747006425881
8431     35540880     35540881    631577111128080    631577111128081
8761     38377560     38377561    736418594154360    736418594154361
9241     42698040     42698041    911561352618840    911561352618841
10099     50994900     50994901   1300239963999900   1300239963999901
10139     51399660     51399661   1320962575457460   1320962575457461
11719     68667480     68667481   2357611473442680   2357611473442681
11821     69868020     69868021   2440770179228220   2440770179228221
12239     74896560     74896561   2804747424813360   2804747424813361
12281     75411480     75411481   2843445733306680   2843445733306681
12781     81676980     81676981   3335564612637180   3335564612637181
13789     95068260     95068261   4518987124782060   4518987124782061
14419    103953780    103953781   5403194292097980   5403194292097981
15269    116571180    116571181   6794420119867380   6794420119867381
16729    139929720    139929721   9790163409568920   9790163409568921
19379    187772820    187772821  17629316153149020  17629316153149021
21911    240045960    240045961  28811031696206760  28811031696206761

The OEIS sequence A048270 (Sequence of 2 Pythagorean triangles, each with a leg and hypotenuse prime.
The leg of the second triangle is the hypotenuse of the first) has more details

http://oeis.org/search?q=A048270&sort=&language=english&go=Search

For a triple concatenation of '2 primes in a Pythagoren Triangle' let (odd/even/hypothenuse d/e/h)

$h_{1} = d_{2}$ and $h_{2} =d_{3}$, all $d_{i},h_{i} \in \mathbb{P}$, the first example is:

(271,36720,36721), (36721,674215920,674215921), (674215921,227283554064939120,227283554064939121)

Since $h_{3}= \frac{d_{3}^{2}+1}{2}$ and $d_{3} = h_{2}$ we have $h_{3}= \frac{h_{2}^{2}+1}{2}$ , $h_{2}= \frac{d_{2}^{2}+1}{2}$ and $d_{2} = h_{1}$ we have $h_{2}= \frac{h_{1}^{2}+1}{2}$,

together with $h_{1}= \frac{d_{1}^{2}+1}{2}$ we finally proceed to

$h_{3}= \frac {d_{1}^8+4*d_{1}^6+14*d_{1}^4+20*d_{1}^2+89}{128}$

The first 10 of such concatenations are:
(listed is $d_{1}, h_{1}, h_{2}, h_{3}$)

Code:
  271      36721            674215921                       227283554064939121
349      60901           1854465901                      1719521888985870901
3001    4503001       10138509003001               51394682401966165513503001
10099   50994901     1300239963999901           845311981991231924243564004901
11719   68667481     2357611473442681          2779165929854284669077096233881
12281   75411481     2843445733306681          4042591819129984425389199617881
25889  335120161    56152761154332961       1576566292627782385364652425513761
39901  796044901   316843742204049901      50194978486933216208387723049054901
46399 1076433601   579354648680913601     167825904474092411857589114013393601
63659 2026234141  2052812397077003941    2107019368796517449205621380464765741

The OEIS sequence A048295 ('Sequence of 3 Pythagorean triangles, each with a leg and hypotenuse prime.
The hypotenuse of each triangle is the leg of the next triangle') has more details:

http://oeis.org/search?q=A048295&sort=&language=english&go=Search