A new lgorithm for generting Pythgoren triples RH Dye 1 nd RWD Nicklls 2 The Mthemticl Gzette (1998); 82 (Mrch, No. 493), p. 86 91 (JSTOR rchive) http://www.nicklls.org/dick/ppers/mths/pythgtriples1998.pdf 1 Introduction The following observtion by one of us (RWDN) rose while investigting Pythgoren triples (x, y, z) with y = x + 1, nd led to some interesting reltionships which llow Pythgoren triples to be generted itertively. In this rticle we obtin these nd other lgorithms which, s fr s we re wre, hve not been described before. In ddition we show tht some relted reltionships recently described by Htch (1995) nd by Mills (1996) re consequence of these lgorithms. Let z = y + b. So x 2 + y 2 = (y + b) 2, nd hence y = (x 2 b 2 )/2b. The triple cn therefore be expressed s ( x 2 b 2 ) x,, 2b Let y = x +. So x + = (x 2 b 2 )/2b nd thus ( x 2 + b 2 2b ). x 2 2bx (b 2 + 2b) = 0. (1) 2 Triples with y = x + 1 In this cse we hve = 1, nd eqution 1 becomes If, lso, b = 1 then eqution 2 becomes x 2 2bx (b 2 + 2b) = 0. (2) x 2 2x 3 = (x 3)(x + 1) = 0. It follows tht the two roots 3, 1 of this qudrtic generte the triples 3,4,5 nd 1, 0, 1 respectively. 1 Deprtment of Mthemtics nd Sttistics, University of Newcstle-upon-Tyne, Newcstle-upon-Tyne, UK. 2 Deprtment of Anesthesi, Nottinghm University Hospitls, City Hospitl Cmpus, Nottinghm, UK. emil: dick@nicklls.org
RH Dye & RWD Nicklls The Mthemticl Gzette (1998); 82, 86 91 2 In order to generte the next triple in the = 1 sequence (ie. y = x + 1) using eqution 2 it is necessry to know the next vlue of b. Now the next triple in the = 1 sequence is 20,21,29, for which b = 8. Since 8 = 3 + 5 the reltionship b n+1 = X n + Z n suggested itself s possibility to be explored for determining subsequent vlues of b, where X n,y n,z n represent the n th Pythgoren triple of sequence. Using this nottion, b 2 = 3 + 5 = 8, nd eqution 2 becomes x 2 16x 80 = (x 20)(x + 4) = 0, which genertes the second = 1 triple 20,21,29. The first four triples in the = 1 sequence cn be generted using eqution 2 s follows: b 1 = 1 x 2 2x 3 = 0 = (x 3)(x + 1) 3, 4, 5 b 2 = 3 + 5 x 2 16x 80 = 0 = (x 20)(x + 4) 20, 21, 29 b 3 = 20 + 29 x 2 98x 2499 = 0 = (x 119)(x + 21) 119, 120, 169 b 4 = 119 + 169 x 2 576x 83520 = 0 = (x 696)(x + 120) 696, 697, 985 When the working is lid out like this cler pttern emerges which fcilittes fctoristion, nmely tht for the cse where y = x + 1 then (x +Y n 1 ) is fctor, nd eqution 2 fctorises s follows: x 2 2b n x (b n 2 + 2b n ) = (x X n )(x +Y n 1 ) = 0. In view of these interesting heuristic reltionships more systemtic pproch ws explored which led to solution vi Pell s eqution (see Dvenport, 1970), which we now present. 3 Triples where is constnt Consider the triple X,Y,Z where Y = X + ( > 0). Then Expnding nd doubling both sides gives X 2 + (X + ) 2 = Z 2. 4X 2 + 4X + 2 2 = 2Z 2, i.e. (2X + ) 2 + 2 = 2Z 2, ( ) 2X + 2 ( ) Z 2 i.e. + 1 = 2. Write (2X + )/ = U nd Z/ = T. Then U 2 + 1 = 2T 2. If = 1 then we hve n eqution in integers (U,T Z), nd therefore this is cse of Pell s eqution for which it is known tht the n th solution U n, T n in positive integers is given by U n + T n 2 = (1 + 2) 2n 1.
RH Dye & RWD Nicklls The Mthemticl Gzette (1998); 82, 86 91 3 Thus U n+1 + T n+1 2, = (1 + 2) 2(n+1) 1, Equting 2 nd non- 2 prts gives = (1 + 2) 2 (1 + 2) 2n 1, = (1 + 2) 2 (U n + T n 2), = (3 + 2 2)(U n + T n 2), = (3U n + 4T n ) + (2U n + 3T n ) 2. T n+1 = 2U n + 3T n, (3) U n+1 = 3U n + 4T n. (4) Although these recurrence reltions hve been reched using Pell s eqution for integers, we wish to highlight the following observtion. Suppose tht U n, T n re determined recursively by equtions 3 nd 4, whether or not they re integers. Then direct clcultion gives 2T 2 n+1 U 2 n+1 = 2(2U n + 3T n ) 2 (3U n + 4T n ) 2, = 2T n 2 U n 2. Thus, provided 2T 2 1 U 2 1 = 1, the pirs U n, T n re solutions of 2T 2 U 2 = 1, whether or not U 1, T 1 re integers. Substituting for T nd U with T = Z/ nd U = (2X + )/ in equtions 3 nd 4 (bering in mind tht the full set of Pythgoren triple solutions is given only for the cse where = 1) gives respectively ( Zn+1 ) = 2 ( 2Xn + ) ( ) 3Zn +, nd which reduce to ( 2Xn+1 + ) = 3 ( 2Xn + ) ( ) 4Zn +, Z n+1 = 4X n + 3Z n + 2, (5) X n+1 = 3X n + 2Z n +. (6) Since Y n = X n + we cn rerrnge eqution 6 to obtin X n+1 = 2(X n + Z n ) +Y n. (7) Subtrcting eqution 6 from eqution 5 gives Z n+1 X n+1 = Z n + X n +, i.e. b n+1 + = Z n + X n +, i.e. b n+1 = Z n + X n, (8) the reltionship conjectured bove in Section 2.
RH Dye & RWD Nicklls The Mthemticl Gzette (1998); 82, 86 91 4 4 Triples where b is constnt Similr reltionships cn be obtined for the cse where b is constnt, s follows: n+1 = X n +Y n, (9) X n+1 = X n + 2b, (10) Y n+1 = 2X n +Y n + 2b, (11) Z n+1 = 2X n + Z n + 2b. (12) We leve it to the interested reder to verify tht these do give sequence of triples, nd tht in this cse eqution 1 fctorises s follows: x 2 2bx (b 2 + 2b n ) = (x X n )(x + X n 1 ) = 0. 5 Conclusion We hve therefore shown tht the following reltionships generte Pythgoren triples X,Y,Z For =constnt (X n + = Y n ) { Xn+1 = 3X n + 2Z n +, b n+1 = X n + Z n. For b =constnt (Z n = Y n + b) { Zn+1 = 2X n + Z n + 2b, n+1 = X n +Y n. In the specil cses = 1 ( = constnt) nd b = 1 (b = constnt) then the bove recurrence reltionships generte ll the relevnt corresponding Pythgoren triples. However, for ll other cses the bove reltionships necessrily give only some of the triples, since the recurrence reltions (equtions 3 nd 4) do not, from ny initil U 1, T 1 generte ll frctionl solutions of Pell s eqution. A significnt feture of these lgorithms is tht if the initil triple is primitive, then every member of the generted sequence is lso primitive. For exmple, consider the = constnt cse. Suppose h X n+1 nd h Y n+1, then h 2 (X 2 n+1 +Y 2 n+1 ), nd hence h Z n+1. Also, h (Y n+1 X n+1 ), nd so h. From equtions 5 nd 6 it follows tht h (4X n + 3Z n ) nd h (3X n + 2Z n ); by tking liner combintions of these we see tht h Z n nd h X n, from which it follows tht h Y n, s Y n = X n +. It follows, therefore, tht if the triple X n+1, Y n+1, Z n+1 is not primitive, then neither is X n, Y n, Z n ; nd so on down to X 1, Y 1, Z 1. A similr rgument for the b = constnt cse pplies with equtions 10, 11, 12. 6 Exmples 6.1 Constnt, ( = 1) Suppose we strt with the primitive Pythgoren triple 119,120,169 nd wish to generte subsequent triples in the sequence. Using eqution 6 we obtin X 2 = 3X 1 + 2Z 1 + = 3(119) + 2(169) + 1 = 696, nd so the next triple is 696,697,985.
RH Dye & RWD Nicklls The Mthemticl Gzette (1998); 82, 86 91 5 6.2 Constnt, ( = 7) Strt with the primitive Pythgoren triple 5,12,13 ( = 7). In this cse our lgorithm genertes X 2 = 48, nd hence the triple 48,55,73, which misses the triple 21,28,35. 6.3 Constnt b, (b = 2) Strt with the primitive Pythgoren triple 8,15,17. Using eqution (10) we obtin Z 2 = 2X 1 + Z 1 + 2b = 2(8) + 17 + 2(2) = 37, nd so our next triple is 12,35,37, which misses the triple 10,24,26. 7 Alterntive reltionships for X n+1 nd Z n+1 The empiricl reltionship X n+1 = 6X n X n 1 + 2, described in recent rticle by Htch (1995) for the cse when = 1, is in fct prticulr cse of more generl reltionship which follows directly from our pproch, s follows. From eqution 6 From eqution 8 X n = 3X n 1 + 2Z n 1 + = 2(X n 1 + Z n 1 ) + X n 1 +. (13) b n = X n 1 + Z n 1. (14) Eliminting (X n 1 + Z n 1 ) between equtions 13 nd 14 gives But X n + + b n = Z n, so X n = 2b n + X n 1 +. X n = (2Z n 2X n 2) + X n 1 + = 2Z n 2X n + X n 1. Eliminting (2Z n ) using eqution 6 gives X n = (X n+1 3X n ) 2X n + X n 1, i.e. X n+1 = 6X n X n 1 + 2. (15) When = 1 then this is Htch s eqution X n+1 = 6X n X n 1 + 2, s required. Finlly, similr rgument shows tht the reltionship Z n+1 = 6Z n Z n 1 discussed by Mills (1996) for sequence with constnt, lso follows from our pproch. From eqution 5 2Z n+1 = 8X n + 6Z n + 4. (16) From eqution 6 Eliminting Z n between equtions 16 nd 17 gives 3X n+1 = 9X n + 6Z n + 3. (17) 2Z n+1 = 3X n+1 X n +.
RH Dye & RWD Nicklls The Mthemticl Gzette (1998); 82, 86 91 6 Using the corresponding equtions for Z n nd Z n 1 we see tht 2(Z n+1 6Z n + Z n 1 ) = 3(X n+1 6X n + X n 1 ) (X n 6X n 1 + X n 2 ) 4, which, by eqution 15, gives 2(Z n+1 6Z n + Z n 1 ) = 3(2) 2 4 = 0. Thus s required. Z n+1 = 6Z n Z n 1, 8 References Dvenport H. (1970). The higher rithmetic; n introduction to the theory of numbers. (Cmbridge University Press). Htch G. (1995). Pythgoren triples nd tringulr squre numbers. Mthemticl Gzette; 79 (Mrch), pp. 51 55 (JSTOR). Mills J.T.S. (1996). Another fmily tree for Pythgoren triples. Mthemticl Gzette; 80 (November), pp. 545 548 (JSTOR).