Pythagorean Triples Theorem

source: https://www.math.brown.edu/johsilve/frintch1ch6.pdf
A primitive Pythagorean triple (or PPT for short) is a triple of integers
(a,b,c)
such that
a
,
b
, and
c
have no common factors and satisfy:
2
a
+
2
b
=
2
c
Theorem 2.1 (Pythagorean Triples Theorem). We will get every primitive Phythagorean triple
(a,b,c)
with
a
odd and
b
even by using the formulas​
a=st
,
b=
1
2
(
2
s
-
2
t
)
,
c=
1
2
(
2
s
+
2
t
)
​​where
s>t≥1
are chosen to be any odd integers with no common factors.
For example, taking
t=1
in Theorem 2.1 gives a triple
s,
2
s
-1
2
,
2
s
+1
2
whose
b
and
c
entries differ by 1. This explains many of the examples that we listed. The following table gives all possible triples with
s≤11
:
In[]:=
primitivePythagoreanTriplesTable[11]
Out[]//TraditionalForm=
s
t
ast
b
1
2
(
2
s
-
2
t
)
c
1
2
(
2
s
+
2
t
)
3
1
3
4
5
5
1
5
12
13
7
1
7
24
25
9
1
9
40
41
11
1
11
60
61
5
3
15
8
17
7
3
21
20
29
11
3
33
56
65
7
5
35
12
37
9
5
45
28
53
11
5
55
48
73
9
7
63
16
65
11
7
77
36
85
11
9
99
20
101
2.4 In our list of examples are the two primitive Pythagorean triples
2
33
+
2
56
=
2
65
and
2
16
+
2
63
=
2
65
​Find at least one more example of two primitive Pythagorean triples with the same value of
c
. Can you find three primitive Pythagorean triples with the same
c
? Can you find more than three?
In[]:=
sameValuePPTTable[100]
Out[]//TraditionalForm=
2
25
=
2
7
+
2
24
2
15
+
2
20
​
​
2
50
=
2
14
+
2
48
2
30
+
2
40
​
​
2
65
=
2
16
+
2
63
2
25
+
2
60
2
33
+
2
56
2
39
+
2
52
2
75
=
2
21
+
2
72
2
45
+
2
60
​
​
2
85
=
2
13
+
2
84
2
36
+
2
77
2
40
+
2
75
2
51
+
2
68
2
100
=
2
28
+
2
96
2
60
+
2
80
​
​

Mathematica code

primitivePythagoreanTriplesTable[n_]:=TraditionalFormGridJoins,t,a==st,b==
2
s
-
2
t
2
,c==
2
s
+
2
t
2
,SelectFlattenTableIfGCD[t,s]1,s,t,st,
2
s
-
2
t
2
,
2
s
+
2
t
2
,{},{t,1,n-2,2},{s,t+2,n,2},1,#≠{}&,FrameAll,Background{{LightGray,White,LightGreen,LightBlue,LightPurple},{{LightGray,White}}}
sameValuePPTTable[m_]:=TraditionalForm[Grid[Select[Table[Join[
HoldForm[2]
n
,"=",Map[Plus@@
HoldForm[2]
#
&,Rest[PowersRepresentations[
2
n
,2,2]]]],{n,1,m}],Length[#]>3&],FrameAll,Background{{{LightOrange,LightRed,LightGreen,LightBlue,LightPurple,LightCyan}},{{LightGray,White}}}]]