Question 398436

Pythagorean triples are sets of three integers (a, b, and c) which satisfy the equation {{{c^2=a^2+b^2}}}. 


There are 16 primitive Pythagorean triples with c ≤ 100:

( 3, 4, 5)
( 5, 12, 13)	
( 7, 24, 25)	
( 8, 15, 17)
( 9, 40, 41)	
(11, 60, 61)	
(12, 35, 37)	
(13, 84, 85)
(16, 63, 65)	
(20, 21, 29)	
(28, 45, 53)	
(33, 56, 65)
(36, 77, 85)	
(39, 80, 89)	
(48, 55, 73)	
(65, 72, 97) 


For example, (3, 4, 5) can be doubled to produce (6, 8, 10), which is a Pythagorean triple


{{{10^2 = 6^2+8^2}}}

{{{100 = 36+64}}}

{{{100 = 100}}}


and (6, 8, 10) can be doubled to produce (12, 16, 20) which is a Pythagorean triple too

{{{20^2 = 12^2+16^2}}}

{{{400 = 144 + 256}}}

{{{400 = 400}}}

It is possible to devise a formula for producing Pythagorean triples:

if you choose arbitrary positive integers {{{m>n}}}, that these equations generate all Pythagorean Triples (x, y, z):

{{{x=m^2-n^2}}},
 
{{{y=2mn}}}, 

{{{z=m^2+n^2}}}

example:

let m=2 and n=1


{{{x=2^2-1^2=4-1=3}}},
 
{{{y=2*2*1=4}}}, 

{{{z=2^2+1^2=4+1=5}}}


we got first triple from the list above- (3,4,5)



let m=29 and n=25


{{{x = 29^2-25^2 = 841-625 = 216}}},
 
{{{y = 2*29*25 = 1450}}}, 

{{{z = 29^2+25^2 = 841+625 = 1466}}}...we got second triple (216,1450,1466)



check:

{{{1466^2 = 216^2+1450^2}}}

{{{2149156 = 46656 + 2102500}}}

{{{2149156 = 2149156}}}