Pythagorean Quadruples
 
David W. Hansen
2011
 
     In studying Pythagorean triples, we consider triples of numbers, (a, b, c), where a2 + b2 = c2. Some examples of Pythagorean triples are
                                                                   (3, 4, 5),     where   32 + 42   =   52,                                                                (1)
and                                                           (5, 12, 13),    where   52 + 122  =  132.                                                              (2)
 
     Now, if we replace the 52 in (2) by the 32 + 42 from (1), we have
 
                                                                        (32 + 42) + 122   =   132,
 
or                                                                        32 + 42 + 122   =   132,
 
which is an example of a Pythagorean quadruple (3, 4, 12, 13), where 32 + 42 + 122   =   132.   In general,
 
                                A Pythagorean quadruple is a set of positive integers (a, b, c, d), where a2 + b2 + c2 = d2.
                               __________________________________________________________________
 
Some examples of Pythagorean quadruples are:  
 
                                                             (1, 2, 2, 3),     since   12 + 22 + 22    =   32
                                              
                                                           (3, 4, 12, 13),    since   32 + 42 + 122  =  132;
 
 and                                                    (6, 10, 15, 19),   since   62 + 102 + 152 = 192.
 
     Are there other Pythagorean quadruples? Yes. Any multiple of the four integers (the members) of a Pythagorean quadruple will be a Pythagorean quadruple. Forexample, multiplying each of the four members of (3, 4, 12, 13) by 2 gives us (6, 8, 24, 26), which is a Pythagorean quadruple since 62 + 82 + 242 = 262. Multiplying by 3, we get (9, 12, 36, 39), which is also a Pythagorean quadruple since   92 + 122 + 362 = 392. In fact, if (a, b, c, d) is a Pythagorean quadruple (and thus a2 + b2 + c2 = d2 ), then multiplying each of its members by any positive integer n gives us (na, nb, nc, nd), another Pythagorean quadruple, since
 
                     (na)2 +  (nb)2  + (nc)2   =   n2 a2  +  n2 b2 + n2 c2    =  n2(a2 + b2 + c2)                (factoring)
                                                                                                  =         n2 d2                   (replacing a2 + b2 + c2 by d2)
                                                                                                  =         (nd)2,                         (factoring)
 
proving that (na)2 + (nb)2 + (nc)2   =   (nd)2 , and thus (na, nb, nc, nd) is a Pythagorean quadruple. Since n can be any positive integer, there will be an infinite number of Pythagorean quadruples, and we have
 
                         Theorem 1
 
                          If (a, b, c, d) is a Pythagorean quadruple and n is any positive integer, then (na, nb, nc, nd)
                          is also a Pythagorean quadruple, and the number of Pythagorean triples is infinite.
                          ___________________________________________________________________
 
     So, now that we know that there are an infinite number of Pythagorean quadruples, just how do we go about finding them? Perhaps we can find a formula to help us in this. Let’s see.
 
  1. Generating Formulas for Pythagorean Quadruples
 
     To find formulas for the members of a Pythagorean quadruple (a, b, c, d), we shall look at the square of the sum of three integers, say x, m, and n;
                                                           (x + m + n)2  =  x2 + m2 + n2 + 2mx + 2nx + 2mn.                                                  (3)
 
Now, if the sum 2mx + 2nx + 2mn in (3) were zero, then we would have
 
                                                            (x + m + n)2  =  x2 + m2 + n2 + 0,
 
or                                                         x2 + m2 + n2  =  (x + m + n)2,                                                                               (4)
 
which would give us a sum of three squares on the left side of (4) equaling a single square on the right side, which is exactly what we want. Let’s continue.
 
     To get (4), we must have                2mx + 2nx + 2mn = 0.    Solving this for x, we get
 
                                                             mx + nx + mn  =   0
 
                                                                     x(m + n) = - mn
 
                                                                                  - mn
or                                                                  x    =   ----------    = - mn / (m + n).
                                                                                  m + n
 
Substituting this value of x into (4), we get    
 
                                      x2            +      m2     +    n2     =                  (x  +  m  +  n)2                                                        (4)
 
                           [ - mn /(m+n) ]2   +     m2   +     n2     =            { - mn /(m+n)  +  m  +  n }2
 
                            m2n2 /(m+n)2     +      m2    +    n2     =    { [- mn  +  m(m+n)  +  n(m+n)] / (m+n) }2                            (5)
                        
Multiplying (5) by (m+n)2, we get                          
                                                                             
                      m2n2  +    m2(m+n)2    +   n2(m+n)2         =      { - mn + m(m+n) + n(m+n) }2
 
or                  (mn)2   +  [m(m+n)]2   +   [n(m+n)]2         =                [ m2 + mn + n2 ]2                               
 
or                  (mn)2   +   [mn + m2 ]2   +   [mn + n2 ]2      =               [ mn + m2 + n2 ]2.                                                     (6)
 
   Now, if in (6) we let    
 
                               mn  =  a,            mn + m2  =  b,            mn + n2  =  c,       and         mn + m2 + n2 =  d,                        (7)
 
then (6) becomes                                    a2 + b2 + c2   =   d2,
 
and we have found formulas for the members a, b, c, and d of any Pythagorean quadruple (a, b, c, d).
 
     To verify that these formulas for a, b, c, and d really do give us a Pythagorean quadruple, we must show that a2 + b2 + c2 = d2.  Using the formulas in (7), we get
                      
                    a2  +  b2 +  c2   =  (mn)2  +  (mn + m2 )2  +  (mn + n2 )2 
 
                                           =  m2n2  +  m2n2  +  2m3n  +  m4  +  m2n2  +  2mn3  +  n4
 
                                           =   m2n2  +  m4  +  n4  +  2m3n  +  2mn3  +  2m2n2  =   (mn  +  m2  +  n2 )2
 
                                           =   d2,                 so, (a, b, c, d) is a Pythagorean quadruple.

   It is interesting to note that by using the formulas in (7), we can write d in terms of a, b, and c. Here’s how.
 
                                   d =  (mn + m2) + n2    =   b + n2   =   b  +  (mn + n2) -  mn    =      b  +   c  -  a.
 
   So,                                                                       d   =   b + c - a.                                                                                (8) 

     Furthermore,                    a + d   =   mn + (mn + m2 + n2 )  =  m2 + 2mn + n2  =  (m + n)2
 
and                                       b + c   =  (mn + m2) + (mn + n2)  =  m2 + 2mn + n2  =  (m + n)2
 
   So,                                                                a + d  =  b + c  =  (m + n)2,                                                                       (9)
 
giving us                           Theorem 2
 
                                        If, for any positive integers m and n,  
                     
                                        1)     a = mn                                    b = m(m+n) = mn + m2
                                                c = n(m+n) = mn + n2              d = mn + m2 + n2,
                      
                                         then  a2 + b2 + c2 = d2 and (a, b, c, d) is a Pythagorean quadruple.
    
                                         Furthermore,                        
      
                                         2)   d  =  b + c - a,         and          a + d  =  b + c  =  (m+n)2.
                                        __________________________________________________
 
     Now, from Theorem 2, we have
                                                
                              a  =  mn,               b  =  mn + m2,               c  =  mn + n2,              d  =  mn +  m2  +  n2.                    (10)
 
and looking at these four equations, we see that
 
                                 If   m is even and  n is even,   then   a,  b,  c,  and  d are all even.                         
                                 If   m is  odd  and  n is odd,     then   a is odd,   b and c are even,  and   d is odd.    
                                 If   m is  odd  and  n is even,   then   b is odd,   a and c are even,  and   d is odd.    
                                 If   m is even and  n is odd,     then   c is odd,   a and b are even,  and   d is odd.
 
Thus, we have             Theorem 3
 
                                  In any Pythagorean quadruple N = (a, b, c, d), either              
                             
                                      a)  a, b, c, and d are all even, or
                           
                                      b)  d is always odd, one of its three remaining members is odd,
                                          and the other two are even.
                              ______________________________________________________
     
     Again, looking at the four equations in (10), we see that   if m < n,  then   a  <  b  <  c  < d, which is a nice ordering of the members of N = (a, b, c, d), but if m > n, then  a  <  b, a  <  c, and a  <  d, but  b  >  c.  Since we get the same members of
(a, b, c, d) no matter whether we choose m > n or m < n, then
 
                                                      we shall always choose m < n to ensure that  a < b < c < d.
 
     Again, from Theorem 2, we have
 
                               a  =  mn             b  =  mn + m2             c  =  mn + n2            d  =  mn +  m2  +  n2,                            (11)

which can be visualized pictorially as
 
                                                                                             Figure 1
                                         
                                                       |<- - - - - - - - - - n2  - - - - - - - - - - >|
 
                       |<- - - - - mn - - - - ->|<- - - - m2 - - - ->|                            |<- - - - m2 - - - ->|
                      
0                              a                         b<- -  n2 - m2  - ->c                         d 
                                                                                          
                                                                                  |<- - - - - - - - - -  n2  - - - - - - - - - - >|

                                                       |<- - - - - - - - - - - - - -   m2 + n2  - - - - - - - - - - - - - - >|

                ___ 0______________mn_________mn+m2_________mn+n2_______mn + m2 + n2______________
                       0                             a                         b                          c                          d
 
                                                      Various Sums and Differences of a, b, c, and d

     From (11) and Figure 1, we can derive all the formulas (12) through (16) below. Try it, it’s easy!
 
                                                                      a + d   =   b + c   =   (m + n)2                                                                   (12)
 
                                                                       b - a   =     m2    =    d - c                                                                        (13)
                                                                b  =  a + m2,           d  =  c + m2 
                                                                                          
                                                                        c - a   =   n2   =   d - b                                                                            (14)
                                                               c  =  a +  n2,        d  =  b +  n

                                                                        c - b   =   n2 - m2                                                                                   (15)
                              
                                                                         d - a   =  m2 + n2                                                                                  (16)

 
2. Primitive Pythagorean Quadruples
 
     Now, it is definitely nice to know that there are an infinite number of Pythagorean quadruples as stated in Theorem 1 above, but most of these are just quadruples whose members are multiples of the members of other quadruples. Can we perhaps find additional quadruples whose members are NOT multiples of some other quadruple?; that is, Pythagorean quadruples whose members have no common factors? Let’s see.
 
     We shall call a Pythagorean quadruple whose members have NO common factors a primitive Pythagorean quadruple.
Thus, (1, 2, 2, 3) is a primitive Pythagorean quadruple because its members have no common factors, whereas (3, 6, 6, 9) is not, since its members have a common factor of 3. Other primitive Pythagorean quadruples are (3,4,12,13), and (6,10,15,19), as given above, since their members have no common factors.
 
     Now, if m and n have a common factor, say f, then we can write m = fr and n = fs, for some integers r and s. Then,   
  
              a = mn = (fr)(fs) = f2rs, which shows that a has a factor of f2,
              b = mn + m2 = fr(fs) + (fr)2 = f2rs + f2r2 = f2(rs + r2), which shows that b has a factor of f2,
              c = mn + n2 = fr(fs) + (fs)2 = f2rs + f2s2 = f2(rs + s2), which shows that c has a factor of f2, and
              d = mn + m2 + n2 = fr(fs) + (fr)2 + (fs)2 = f2rs + f2r2 + f2s2 = f2(rs + r2 + s2), which shows that d has a factor of f2.
  
Thus, if m and n have a common factor f, then a, b, c, and d will have a common factor f2, and thus the members of the Pythagorean quadruple N = (a, b, c, d) will have a common factor and can not then be a primitive Pythagorean quadruple. So, to get a primitive Pythagorean quadruple, m and n must have no common factors, giving us  
 
                   Theorem 4
 
                   If m and n are positive integers with no common factors, then N = (a, b, c, d),
                   where a = mn, b = mn + m2, c = mn + n2, and d = mn + m2 + n2, will be a
                   primitive Pythagorean quadruple.
                   _________________________________________________________
 
     Here are some small tables of primitive Pythagorean quadruples for various values of m. Numbers in red are perfect squares.
     
                                                      Primitive Pythagorean Quadruples (for m = 1)

                                       a               b               c                d                             Form of d
                   m    n          mn        mn + m2     mn + n2     mn + m2 + n2     3L+1, 6L+1   or    3L, 3(6L+1)
                - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                   1     1           1                2               2               3                  3(
0)+1    6(0)+1               
                   1     2           2                3               6               7                  3(
2)+1    6(1)+1               
                   1     3           3                4             12              13                 3(4)+1    6(2)+1
                   1     4           4                5             20              21                                            3(7)  3[6(1)+1]
                   1     5           5                6             30              31                 3(10)+1   6(5)+1
                   1     6           6                7             42              43                 3(14)+1   6(7)+1
                   1     7           7                8             56              57
                   1     8           8                9             72              73                 3(24)+1   6(12)+1
                   1     9           9              10             90              91                 3(30)+1   6(15)+1
                   1    10         10              11           110             111                                          3(37)  3[6(6)+1]
                   1    11         11              12           132             133                3(44)+1   6(22)+1
                   1    12         12              13           156             157                3(52)+1   6(26)+1
                   1    13         13              14           182             183                                          3(61)  3[6(10)+1]
                   1    14         14              15           210             211                3(70)+1   6(35)+1
                   1    15         15              16           240             241                3(80)+1   6(40)+1
              -------------------------------------------------------------------------------------------------------------------------
The data in this table suggest that b = a+1, d = c+1, and c = ab.  Let's see if this is so.
 
      If m = 1, then
 
                    a  =  mn = 1n = n
                                               
                    b  =  mn + m2  = 1n + 1  =  n+1  =  a + 1                             Thus, b = a + 1.
                                                           
                    c  =  mn + n2   =  1n + n2  =  n + n2  = n(n+1)  =  ab              Thus, c = ab.
        
                    d  =  mn + m2 + n2   =  1n + 1 + n2  =  n + 1 + n2  =  n(n+1)+ 1  =  ab + 1 = c + 1  
                    Thus,  d  =  c + 1.
 
        So,   if m = 1, then  (a, b, c, d)  =  (a,  b = a+1,  c = a(a+1),  d = c+1) ). This gives us

                    Theorem 5
 
                    For any positive integer k, there always exists a primitive Pythagorean quadruple
                    N = (a, b, c, d), whose first member a = k; namely, N = (k,  k+1,  k(k+1),  k(k+1)+1). 
                    _______________________________________________________________
 
 Thus, one easy way to find a primitive Pythagorean quadruple (a, b, c, d) for any positive integer a is to
 
                                                 1) Pick any positive integer k. This will be a.
                                                 2) Add 1 to this integer a. This will be b.
                                                 3) Multiply a and b. This will be c.
                                                 4) Add 1 to this integer c. This will be d.
 
Example   Let's choose a = 16, giving us                (16, - , - , - ). 
               Then, add 1 to a, giving us                    (16, 17 , - , - ).
               Multiply 16 and 17 to get                     (16, 17, 272, - ).
               Add 1 to 272, which gives us              (16, 17, 272, 273)  as a primitive Pythagorean quadruple.   
 
                                                         Primitive Pythagorean Quadruples
                                                   (for m = 2 to 9 and selected values of n.)
 
                                       a               b               c                d                             Form of d
                   m    n          mn        mn + m2     mn + n2     mn + m2 + n2     3L+1, 6L+1   or   3L, 3(6L+1)
                - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                   2     3           6              10             15               19                3(
6)+1   6(3)+1
                   2     5          10             14             35               39                                       3(
13)  3[6(2)+1]
                   2     7          14             18             63               67                3(2
2)+1  6(11)+1   
                   2     9          18             22             99              103               3(
34)+1  6(17)+1
                   2    11         22             26            143             147                  3(
49)    3(7)(7)  3[6(1)+1][6(1)+1]
                   2    13         26             30            195             199                3(66)+1  6(33)+1
                   2    15         30             34            255             259                3(86)+1  6(43)+1
                   2    17         34             38            323             327                                       3(109)  3[6(18)+1]
                   2    19         38             42            399             403                3(134)+1  6(67)+1
                   2    21         42             46            483             487                3(162)+1  6(81)+1
                   2    23         46             50            575             579                                        3(193)  3[6(32)+1]
                   2    25         50             54            675             679                3(226)+1  6(113)+1
                   2    27         54             58            783             787                3(262)+1  6(131)+1
                   2    29         58             62            899             903                    3(301)   3(7)43   3[6(1)+1][6(7)+1]
                   2    31         62             66           1023           1027                3(
342)+1  6(171)+1
               ------------------------------------------------------------------------------------------------------------------------
                   3     4          12            21              28              37                 3(12)+1    6(6)+1  
                   3     5          15            24              40              49                 3(16)+1    6(8)+1
                   3     7          21            30              70              79                 3(26)+1    6(13)+1
                   3     8          24            33              88              97                 3(32)+1    6(16(+1
                   3    10         30            39             130            139                 3(46)+1    6(23)+1
                   3    11         33            42             154            163                 3(54)+1    6(27)+1
                   3    13         39            48             208            217                 3(72)+1    6(36)+1
                   3    14         42            51             238            247                 3(82)+1    6(41)+1
                   3    16         48            57             304            313               3(104)+1    6(52)+1   
                   3    17         51            60             340            349               3(116)+1    6(58)+1
                   3    19         57            66             418            427               3(142)+1    6(71)+1
                   3    20         60            69             460            469               3(156)+1    6(78)+1
                   3    22         66            75             550            559               3(186)+1    6(93)+1
                   3    23         69            78             598            607               3(202)+1    6(101)+1
                   3    25         75            84             700            709               3(236)+1    6(118)+1
             --------------------------------------------------------------------------------------------------------------------------
                   4     5          20            36              45              61               3(20)+1 6(10)+1             
                   4     7          28            44              77              93                                      3(31)  3[6(5)+1]
                   4     9          36            52             117            133               3(44)+1 6(22)+1
                   4    11         44            60             165            181               3(60)+1 6(30)+1
                   4    13         52            68             221            237                                      3(79)  3[6(13)+1]
                   4    15         60            76             285            301               3(100)+1 6(50)+1
                   4    17         68            84             357            373               3(124)+1 6(62)+1
                   4    19         76            92             437            453                                      3(151) 3[6(25)+1]                
                   4    21         84          100             525            541               3(180)+1 6(90)+1                       
                   4    23         92          108             621            637               3(212)+1 6(106)+1
                   4    25       100          116             725            741                                      3(247)  3[6(41)+1]
                   4    27       108          124             837            853               3(284)+1 6(142)+1
                   4    29       116          132             957            973               3(324)+1 6(162)+1
                   4    31       124          140           1085           1101                                      3(367)  3[6(61)+1]
                   4    33       132          148           1221           1237               3(412)+1 6(206)+1
             ---------------------------------------------------------------------------------------------------------------------------
                   5     6          30           55              66              91                3(30)+1   6(15)+1
                   5     7          35           60              84             109               3(36)+1   6(18)+1
                   5     8          40           65             104            129                                      3(43)  3[6(7)+1]
                   5     9          45           70             126            151               3(50)+1   6(25)+1
                   5    11         55           80             176            201                                      3(67)  3[6(11)+1]             
                   5    12         60           85             204            229               3(76)+1   6(38)+1
                   5    13         65           90             234            259               3(86)+1   6(43)+1
                   5    14         70           95             266            291                                      3(97)  3[6(16)+1]
                   5    16         80          105            336            361               3(120)+1  6(60)+1
                   5    17         85          110            374            399                     3(133)   3(7)19  3[6(1)+1][6(3)+1]
                   5    18         90          115            414            439               3(146)+1  6(73)+1
                   5    19         95          120            456            481               3(160)+1  6(80)+1
                   5    21        105         130            546            571               3(190)+1  6(95)+1
                   5    22        110         135            594            619               3(206)+1  6(103)+1
                   5    23        115         140            644            669                                      3(223) 3[6(37)+1]
               ------------------------------------------------------------------------------------------------------------------------
                   6     7          42            78              91            127               3(42)+1     6(21)+1
                   6    11         66           102            187            223               3(74)+1     6(37)+1
                   6    13         78           114            247            283               3(94)+1     6(47)+1
                   6    17        102          138            391            427               3(142)+1    6(71)+1
                   6    19        114          150            475            511               3(170)+1    6(85)+1
                   6    23        138          174            667            703               3(234)+1    6(117)+1
                   6    25        150          186            775            811               3(270)+1    6(135)+1
                   6    29        174          210           1015          1051              3(350)+1    6(175)+1
                   6    31        186          222           1147          1183              3(394)+1    6(197)+1
                   6    35        210          246           1435          1471              3(490)+1    6(245)+1          
                   6    37        222          258           1591          1627              3(542)+1    6(271)+1
                   6    41        246          282           1927          1963              3(654)+1    6(327)+1
                   6    43        258          294           2107          2143              3(714)+1    6(357)+1
                   6    47        282          318           2491          2527              3(842)+1    6(421)+1
                   6    49        294          330           2695          2731              3(910)+1    6(455)+1
                 --------------------------------------------------------------------------------------------------------------------------
                   7     8          56           105             120            169               3(56)+1   6(28)+1   13(13) = [6(2)+1]2
                   7     9          63           112             144            193               3(64)+1   6(32)+1 
                   7    10         70           119             170            219                                     3(73)  3[6(12)+1]
                   7    11         77           126             198            247               3(82)+1   6(41)+1
                   7    12         84           133             228            277               3(92)+1   6(46)+1
                   7    13         91           140             260            309                                     3(103)  3[6(17)+1]
                   7    15       105           154             330            379               3(126)+1  6(63)+1 
                   7    16       112           161             368            417                                     3(139)  3[6(23)+1]
                   7    17       119           168             408            457               3(152)+1  6(76)+1
                   7    18       126           175             450            499               3(166)+1  6(83)+1
                   7    19       133           182             494            543                                     3(181)  3[6(30)+1]
                   7    20       140           189             540            589               3(196)+1  6(98)+1
                   7    22       154           203             638            687                                     3(229)  3[6(38)+1]
                   7    23       161           210             690            739               3(246)+1  6(123)+1
                   7    24       168           217             744            793               3(264)+1  6(132)+1
                  --------------------------------------------------------------------------------------------------------------------------
                   8     9         72           136             153             217              3(72)+1     6(36)+1
                   8    11        88           152             209             273                       3(91)  3(7)13  3[6(1)+1][6(2)+1]
                   8    13      104           168             273             337              3(112)+1    6(56)+1

                   8    15      120           184             345             409              3(136)+1    6(68)+1
                   8    17      136           200             425             489                                      3(163)   3[6(27+1]
                   8    19      152           216             513             577              3(192)+1    6(96)+1
                   8    21      168           232             609             673              3(224)+1    6(112)+1
                   8    23      184           248             713             777                       3(259)    3(7)37  3[6(1)+1][6(6)+1] 
                   8    25      200           264             825             889                               7(127)     [6(1)+1][6(21)+1]
                   8    27      216           280             945            1009              3(336)+1    6(168)+1               
                   8    29      232           296            1073           1137                                      3(379)    3[6(63)+1]
                   8    31      248           312            1209           1273                               19(67)     [6(3)+1][6(11+1]
                   8    33      264           328            1353           1417                               13(109)   [6(2)+1][6(18)+1] 
                   8    35      280           344            1505           1569                                      3(523)    3[6(87)+1]
                   8    37      296           360            1665           1729              3(576)+1    6(288)+1 
                 -------------------------------------------------------------------------------------------------------------------------------
                   9    10        90           171             190             271              3(90)+1      6(45)+1    
                   9    11        99           180             220             301                                 7(43)      [6(1)+1][6(7)+1] 
                   9    13      117           198             286             367              3(122)+1    6(61)+1  
                   9    14      126           207             322             403                                 13(31)    [6(2)+1][6(5)+1]
                   9    16      144           225             400             481                                 13(37)    [6(2)+1][6(6)+1]
                   9    17      153           234             442             523              3(174)+1    6(87)+1 
                   9    19      171           252             532             613              3(204)+1    6(102)+1                            
                   9    20      180           261             580             661              3(220)+1    6(110)+1 
                   9    22      198           279             682             763                                 7(109)     [6(1)+1][6(18)+1]
                   9    23      207           288             736             817                                 19(43)     [6(3)+1][6(7)+1]
                   9    25      225           306             850             931                                 7(133)     [6(1)+1][6(22)+1]
                   9    26      234           315             910             991              3(330)+1    6(165)+1  
                   9    28      252           333            1036           1117              3(372)+1    6(186)+1  
                   9    29      261           342            1102           1183                7(169)      7(13)(13)  [6(1)+1][6(2)+1][6(2)+1]
                   9    31      279           360            1240           1321              3(440)+1    6(220)+1    
                 ---------------------------------------------------------------------------------------------------------------------------------

                                                                    Numbers in red are perfect squares.
 
                             3.  How to Find All the Members of a Primitive Pythagorean
                                       Quadruple Knowing Only a Few of Them
 

    
A.  If we know the values of three of the four members of a Pythagorean quadruple, then by simply substituting these values into (12), (13), or (14) above and solving the resulting equation, we can find the value of the remaining member.
 
     For example, if N = (15, 24, ?, 49) = (15, 24, c, 49), then substituting into (12), we have 
 
                                     a + d   =   b + c,     15 + 49  =  24 + c,      or        c   =   15 + 49 - 24   =  40,              
 
     or, substituting into (14), we get    c - a  =  d - b,     c - 15  =  49 - 24,     or      c  =  15 + 49 - 24   =  40.

                                                              (15, 24, ?, 49 ) = (15, 24, 40, 49)
  
    
B.  If we know the values of just two of the members of a Pythagorean quadruple, then we can always find the values of the other two members by using the procedures shown below.

                  If we are given,                                then we do this,                                  to get the other two members. 

       ________________________________________________________________________________________                                                                                           ____     
           
1.             a, b              From (13) and (11),    m  =  b - a,     n = a/m                     c = a + n2,   d = b + n2  
                                                                                   ______
      If N = (15, 24, ?, ?) = (15, 24, c, d), we have m = 24 - 15 = 3  and  n = 15/3 = 5.              (m,n) = (3,5)   
   
                                  Then,   c = a + n2  =  15 + 52  =  40,     and     d = b + n2  =  24 + 52  =  49.
      
                                                                 (15, 24, ?, ? ) = (15, 24, 40, 49)
         ___________________________________________________________________________________
                                                                                         ____
            
2.          a, c                From (14) and (11),      n = c - a,      m = a/n                     b = a + m2,   d = c + m2    
                                                                                     ______
        If N = (14?, 63? ) = (14, b, 63, d), we have n =
63 - 14 = 7 and m = 14/7 = 2.              (m,n) = (2,7)
   
                                 Then,   b = a + m2  =  14 + 22  =  18,     and     d = c + m2  =  63 + 22  =  67.
             
                                                                (14, ? , 63, ?) = (14, 18, 63, 67)
          ___________________________________________________________________________________
                                                                                          _____                                  
            
3.         a, d                          From (12),   m + n = a + d,                                     b = a + m2,    c = a + n2
                                                                                         _____  
                                                                  or            n = a + d   -  m.
                                                                                                       ____
                                           From (11),      mn = a.       Thus,     m (a + d - m)  =  a.
                                                                                                           ____      _____
                           --->  Solve the above equation to get m, or use  m = (a + d - d - 3a ) / 2

                                                                   --->  Then, n = a/m.              
                                                                                                 _______
               If N = (36, ?, ?133) = (36, b, c, 133),  we have   m(36 + 133  - m) = 36,  m(13 - m) = 36, 
        
                                            m2 - 13m + 36 = 0,     and   (m - 4)(m - 9) = 0.  So, m = 4 or 9.  
 
                                          If m = 4, then  n = a/m = 36/4 = 9.   If m = 9, then n = 36/9 = 4.  
 
                                                        Picking m < n, we get m = 4 and n = 9.                            (m,n) = (4,9)
                                                                _______     ________                 ___    __
                                           [  or     m = (
36 + 133  - 133 - 3(36) ) / 2   = (169 - 25 ) / 2 = 4  ]

                                   Then,   b = a + m2  =  36 + 42  =  52,     and     c = a + n2  =  36 + 92  =  117.
             
                                                                (36, ?, ?, 133) = (36, 52, 117, 133)      
____________________________________________________________________________________________                                                                                       
                                                                                              _____                                                          
            
4.         b, c                          From (12),       m + n = b + c .                                   a = mn,      d = b + n2 
 
                                                        From (11),           b = m(m + n).
                                                                                                        ____
                                            --->    Thus,         m  =  b/(m + n)  =  b/
b + c,
                                                                                ____
                                            --->    and            n  = 
b + c  -  m.
                                                                                                              _______               
                     If N = (?70, 126?) = (a, 70, 126, d),   we have  m = 70/
70 + 126   =  70/14  =  5, 
                                                                     _______
                                                      and  n = 70 + 126 - 5 = 14 - 5 = 9.                                 (m,n) = (5,9)   
  
                                       Then,   a = mn = 5(9)  =  45,     and     d = b + n2  =  70 + 92  =  151.
             
                                                              (?, 70, 126, ?) = (45, 70, 126, 151)

     _________________________________________________________________________________________
                               
             5.         b, d                                    From (14),     d - b = n2                                  a = mn,        c = a + n2  
                                                                                               ____
                                                                                --->  n =
d - b

                                                                   From (11),     b = m(m + n)                                                     
                                                                                                        ____
                                                                                   b = m (m +  d - b) 
                                                                                          ____
                                                                      --->  m2  +  
d - b  m  -  b  =  0         
 
                                                                    Solve the above equation to get  m.                              
                                                                                                                   _______       ___     
                          If N = (?138, ?427) = (a, 138, c, 427), we have      n =
427 -138  =   289 = 17,   
                                               _______    
           and                    m2 +
427 - 138  m - 138 = 0,    m2 + 17m - 138 = 0,     (m - 6)(m + 23) = 0.  
  
                                                       So, m = 6 and n = 17.                                                            (m,n) = (6,17)

                           Then,  a = mn = 6(17) = 102,     and     c = a + n2  =  102 + 172  =  391.
                      
                                                                (?, 138, ?, 427) = (102, 138, 391, 427)

  _________________________________________________________________________________________
 
             
6.         c, d                                  From (13),        d - c = m2                                  a = mn,          b = a + m2
                                                                                               ____
                                                                               --->  m =
d - c

                                                                From (11),       c = n(m + n)
                                                                                              ____
                                                                                  c = n (
d - c + n)
                                                                                      ____                     
                                                                    --->  n2
d - c  n  -  c  =  0

                                                                 Solve the above equation to get n.
                                                                                                                 _____
                              If N = (??, 7079) = (a, b, 70, 79),  we have      m =
79 -70 = 3,    and
                                 _____       
                       n2 +
79 -70 n - 70 = 0,   n2 + 3n - 70 = 0,   (n - 7)(n + 10) = 0.  So, n = 7.                   (m,n) = (3,7)  
                                                                               
                                           Then,  a = mn = 3(7) = 21,     and     b = a + m2  =  21 + 32  =  30.
             
                                                                 (?, ?, 70, 79) = (21, 30, 70, 79)
      _____________________________________________________________________________________           
     
     C.  If we know the value of just one of the members of a Pythagorean quadruple, then we use the procedures shown below.
                 If we are given,                         then we do this,                              to get the other three members.             
      _____________________________________________________________________________________
                                                                                                                              
        
1.        a                         From Theorem 2, a = mn, so we find any        b = a + m2,    c  =  a + n2,      d = b + n2 
                                               two positive integers m and n such that                     
                                               mn = a, where m = n = 1, or m < n.                 
                                       
                              (Note: There will be more than one quadruple if there is more than one way to find m and n.)
 
                   If a = 10, then N = ( 10, ?, ? , ?) = (10, b, c, d), and we have   
                                                                                                                  
                      a)      a = 10 = 1(10) = mn,   so     m = 1,    n = 10.                                           (m,n) = (1,10)
    
                               Then,   b = 10 + 12  =  11,    c = 10 + 102  =  110,    d = 11 + 102  =  111.

                                               and          ( 10, ?, ? , ? )  =  (10, 11, 110, 111).
 
                       b)      a = 10 = 2(5) = mn,   so    m = 2,    n = 5.                                               (m,n) = ( 2,5)
              
                                 Then,   b = 10 + 22  =  14,    c = 10 + 52  =  35,    d = 14 + 52  =  39.

                                                and            ( 10, ?, ? , ? )  =  (10, 14, 35, 39).

                   So, there are two Pythagorean quadruples in which a = 10.
 _________________________________________________________________________________________ 
  
         2.        b                      Write b as a product of two factors p and q.             a  =  mn,    c  =  a + n2,    d = b + n2 
                                             From Theorem 2, we have b = pq = m(m +n).                  
                                                             Let   m = p,   n = q - p.                                                                                         
 
                            (Note: There will be more than one quadruple if there is more than one way to find m and n.)
 
                   If b = 30, then N = (?, 30, ? ,  ?) = (a, 30, c, d), and we have  
 
                       a)      b = 30  =  1(30)  =  m(m + n),   so     m = 1,    n = 30 - 1 = 29.                        (m,n) = (1,29)
                                                                                                                             
                                Then,   a = mn = 1(29) = 29,   c = 29 + 292  =  870,   d = 30 + 29  =  871.

                                                 and            (?, 30, ? ,  ?)  =  (29, 30, 870, 871).
 
                        b)      b = 30  =  2(15)  =  m(m + n),   so     m = 2,    n = 15 - 2 = 13.                         (m,n) = (2,13)
                                                                                                               
                                 Then,   a = mn = 2(13) = 26,  c = 26 + 132  =  195,   d = 30 + 132  =  199.

                                                 and            (?, 30, ? ,  ?)  =  (26, 30, 195, 199).
 
                        c)      b = 30  =  3(10)  =  m(m + n),   so     m = 3,    n = 10 - 3 = 7.                           (m,n) = (3,7)
                                                                                                                                         
                                 Then,   a = mn = 3(7) = 21, c = 21 + 72  =  70,   d = 30 + 72  =  79.

                                                 and            (?, 30, ? ,  ?)  =  (21, 30, 70, 79).
     
                         d)      b = 30  =  5(6)  =  m(m + n),   so     m = 5,    n = 6 - 5 = 1.                              (m,n) = (5,1)           
                                       But, this gives us m > n, contradicting the requirement that m < n.
 
                   So, there are three Pythagorean quadruples in which b = 30.

     Now, for any positive integer b, we have always have b = 1(b) = m(m+ n).  So, if we pick m = 1 and n = b - 1, then, we can always construct a Pythagorean quadruple N = (a, b, c, d) containing b.  And since m and n have no common factor, the quadruple will be primitive.  Using Theorem 2 with m = 1 and n = b - 1, we get    
 
                     a = mn = 1(b -1) = b - 1,    b = m(m + n) = 1(1 + b - 1) = b,     c = n(m + n) = (b-1)(b) = b(b-1), 
     
                                          d = b + n2  =  b + (b-1)2  =  b + b2 - 2b + 1  =  b2 - b + 1  =  b(b - 1) + 1
 
          Thus,  N  =  [b-1,  b,  b(b-1),  b(b-1)+1].       (Note that b must be greater than 1 so that a = b-1 will be positive.)    

                    Theorem 6
 
                    For any positive integer k > 1, there always exists a primitive Pythagorean quadruple
                    N = (a, b, c, d), whose second member b = k; namely, N = (k-1,  k,  k(k-1),  k(k-1)+1). 
                    ________________________________________________________________
 
     Thus, we can always find a primitive Pythagorean quadruple whose second member is any positive integer > 1.
 
      An easy way to find a primitive Pythagorean quadruple (a, b, c, d) for any positive integer b > 1 is to
 
                                                     1) Pick any positive integer k > 1. This will be b.
                                                     2) Subtract 1 from b. This will be a.
                                                     3) Multiply a and b. This will be c.
                                                     4) Add 1 to c. This will be d.

Example  Let's choose k = 14, giving us b = 14.             (  - ,  14 , -  ,  -  ) 
               Subtract 1 from b, giving us a = 13.                (13,  14 ,  - ,   - )
               Multiply a and b to get c = 13(14).                 (13,  14, 182,   - )
               Add 1 to c, which gives us d = 183, and         (13,  14, 182, 183)   is a primitive Pythagorean quadruple.
  ________________________________________________________________________________________
 
         3.        c                       Write c as a product of two factors p and q.             a  =  mn,    b  =  a + m2,     d = b + n2   
                                             From Theorem 2, we have c = pq = n(m+n).              
                                                            Let   n = p,   m = q - p.
 
      
                            (Note: There will be more than one quadruple if there  is more than one way to find m and n.)
 
                   If c = 35, then N = (?, ?, 35,  ?), and we have
 
                       a)      35  =  1(35)  =  n(m + n),   so     n = 1,    m = 35 - 1 =  34,                          (m,n) = (34,1)
                                                    contradicting the requirement that m < n.
 
                       b)      35  =  5(7)  =  n(m + n),   so     n = 5,    m = 7 - 5 = 2.                                (m,n) = (2,5)
                                                       
                                Then,   a = mn = 2(5) = 10, b = 10 + 22  =  14,   d = 14 + 52  =  39.

                                                       and            ( ?, ?, 35, ?)  =  (10, 14, 35, 39).

                                            So, there is just one Pythagorean quadruple in which c = 35.

                   If c = 420, then N = ( ? , ?, 420, ?), and we have

                       a)      c = 420  =  1(420)  =  n(m + n),   so   n = 1,  m = 420 - 1 =  419,                 (m,n) = (420,1)
                                                  contradicting the requirement that m < n.
 
                       b)      c = 420  =  3(140)  =  n(m + n),   so   n = 3,   m = 140 - 3 = 137.                 (m,n) = (137,3)
                                                  contradicting the requirement that m < n.
 
                       c)      c = 420  =  5(84)  =  n(m + n),     so   n = 5,    m = 84 - 5 = 79.                    (m,n) = (79,5)
                                                  contradicting the requirement that m < n.

                       d)      c = 420  =  7(60)  =  n(m + n),   so    n = 7,    m = 60 - 7 = 53.                     (m,n) = (53,7)
                                                  contradicting the requirement that m < n.
 
                        e)      c = 420  =  15(28)  =  n(m + n),   so   n = 15,   m = 28 - 15 = 13.                 (m,n) =( 13,15)
                                                                                          
                                 Then,   a = mn = 13(15) = 195 , b = 195 + 132  =  364,   d = 420 + 132  =  589.

                                                 and            (? , ?, 420, ?)  =  (195, 364, 420, 589).
 
                         f)      c = 420  =  20(21)  =  n(m + n),   so   n = 20,    m = 21 - 20 = 1.                  (m,n) = (1,20)
                                                                                                                                                  
                                 Then,   a = mn = 1(20) = 20,  b = 20 + 12  =  21,   d = 420 + 12  =  421.

                                                 and            ( ?, ?, 420, ?)  =  (20, 21, 420, 421).

                         g)      c = 420  =  21(20)  =  n(m + n),   so    n = 21,   m = 20 - 21 = - 1,                (m,n) = (21,-1)
                                                  contradicting the requirement that m be a positive integer. 

             Any other product of two factors of 420 will contradict the requirements that m be positive, so there are only two Pythagorean quadruples in which c = 420.    _________________________________________________________________________________________ 
  
         4.        d                         From Theorem 2,  d  =  mn +  m2  +  n2,                  a =  mn,    b  =  a + m2,    c = a + n2
                                                                                                                               
                            so,                                  d + mn  =  m2  +  2mn + n2,   
                                                                                
                            and             ---> d + mn  =  (m + n)2,      or      ---> mn = (m + n)2 - d.                                               (17)  
 
                                    Now, we must use trial and error (in an organized fashion as shown below)  
                                    to find values for m and n which satisfy one of the equations in (17) above.                    
 
                        (Note: There may be more than one quadruple if there is more than one way to find m and n.)
 
     a)   If d = 97, then N  =  (  ?  ,  ?  ,  ? ,  97 ) = (a, b, c, 97), and using the first equation in (17), we need to find m and n  
           such that
                                d + mn =  97 + mn = (m + n)2;   that is, 97 + mn  must be the perfect square (m + n)2
 
                       The nearest (m+n)2          so, we must have        and we guess              giving us                         
                     which is  ­>  97 + mn is                97 + mn =                 m    n                   (m + n)2
                  ----------------------------------------------------------------------------------------------------------------
                               102 = 100                         97 +  3                      1     3             (1+3)2  =  42  
 102.
                                     
                               112 = 121                         97 + 24                     1    24            (1+24)2  =  252  
 112
                                                                                                      3     8             (3+8)2  =  112.
                                                    Thus, m = 3, n = 8, and                                                                 (m,n) = (3,8)           
 
                         a = mn = 3(8) = 24,              b = a + m2  =  24 + 32  =  33,            c  =  a + n2  = 24 + 82  =  88,
 
                                                 giving us            (  ?  ,  ?  ,  ? ,  97 )  =  (24, 33, 88, 97).
                                      ____________________________________________________
 
     b)   If d = 283, then N =  ( ?  ,  ?  ,  ? , 283 ) = (a, b, c, 283), and using the first equation in (17), we need to find m and n
           such that
                                  d + mn =  283 + mn = (m + n)2; that is, 283 + mn must be the perfect square (m + n)2
 
                        The nearest (m+n)2         so, we must have      and we guess            giving us                         
                     which is  ­>  283 + mn is            283 + mn =             m    n                  (m + n)2
                       ------------------------------------------------------------------------------------------------------
                               172 = 289                       283 + 6                   1     6              (1+6)2   =  72   
 172.
                                                                                                  2     3              (2+3)2   =  52   
≠   172
                               182 = 324                      283 + 41                  1    41             (1+41)2  =  422 
≠   182
                                                      
                               192 = 361                      283 + 78                  1    78             (1+78)2  =  792  ≠   192
                                                                                                  2    39             (2+39)2  =  412  ≠   192
                                                                                                  3    26              (3+26)2 =  292   182
                                                                                                  6    13              (6+13)2 = 192

                                                    Thus, m = 6, n = 13, and                                                              (m,n) = (6,13)
 
                           a = mn = 6(13) = 78,         b = a + m2  =  78 + 62  =  114,       c  =  a + n2  = 78 + 132  =  247,

                                              giving us            ( ?  ,  ?  ,  ? 283 )  =  (78, 114, 247, 283).
                                    ________________________________________________________

     c)   If d = 301, then N =  ( ?  ,  ?  ,  ? , 301 ) = (a, b, c, 301). Using the second equation in (17) above, and writing in an
           abbreviated way, we need to find m and n such that
                                                                             mn = (m+n)2 - 301.
              d = 301

            (m+n)2 :    182 = 324                 18               192 = 361                 19                    202 = 400                  20
                  d               - 301                                           - 301                                               - 301
               mn                   23 = 1(23) 24 x                       60 = 1(60) 61 x                           99 = 1(99) 100 x
                                                                                                3(20) 23 x                                   911)  20 ok
                                                                                               4(15)  19 ok
 
                           (Note: The means add the two factors. Thus, 1(23) 24 means 1(23) 1+23 = 24.)
   
  So, we have found two solutions for d = 301; namely,  (m,n) = (4,15) and (m,n) = (9,11).
 
             1) For   m = 4, n = 15, we get                                                                                (m,n) = (4,15)
 
                        a = mn = 4(15) = 60,         b = a + m2  =  60 + 42  =  76,       c  =  a + n2  = 60 + 152  =  285,
 
                                    giving us            ( ?  ,  ?  ,  ? 301 )  =  (60, 76, 285, 301), and

             2) for  m = 9, n = 11, we get                                                                                  (m,n) = (9,11)
 
                       a = mn = 9(11) = 99,         b = a + m2  =  99 + 92  =  180,       c  =  a + n2  = 99 + 112  =  220,
 
                                   giving us            ( ?  ,  ?  ,  ? 301 )  =  (99, 180, 220, 301).
                             __________________________________________________________

      Now, in finding the values of m and n which give us Pythagorean quadruples with d = 301, we used the three squares 182, 192, and 202 to get the two solutions we found. Shouldn’t we now try more squares to obtain even more solutions? How do we know when to stop trying with more squares? Well, let’s see.
     If we continue by trying the squares 212 through 262, we get the partial tables shown below:   

                 d = 301
 
            (m+n)2 :            212 = 441                                222 = 484                                     232 = 529                   
                  d                       - 301                                       - 301                                            - 301
                mn                        104   mn<d                              183   mn<d                                    228   mn<d
 
 
            (m+n)2 :            242 = 576                                252 = 625                                     262 = 676             
               - d                        - 301                                       - 301   mn>d                                 - 301    mn>d
               mn                          275   mn<d                             324                                               375  
                                                                                 
       We know that  mn < mn + m2 + n= d, so mn is always less than d ( mn < d), and in the tables above for 212, 222, 232, and 242, we do have mn < d. For 212, mn = 104 < 301 = d; for 222, mn = 183 < 301 = d, etc. But, for 252 and 262, we see that
 mn > d, which is not possible. Thus, we need to
 
                                                        Try only those squares for which mn < d.                                              (18)   
                                     
                                                                              
     In fact, if we always start with the smallest square that is > d, and then try increasingly larger consecutive squares, then, since d is fixed, eventually mn will become > d for some square and all other squares larger than that one, and no other squares need be tried.

     d)   If d = 247, then N =  ( ?  ,  ?  ,  ? , 247 ) = (a, b, c, 247). Using the second equation in (17) above, we need to find m and n such that
                                                                               mn = (m+n)2 - 247.
                     d = 247
 
           (m+n)2 :    162 = 256                16                 172 = 289                  17               182 = 324                  18
              d                    247                                              247                                              247
             mn                      9 = 1(9) 10 x                         42 = 1(42) 43 x                        77 = 1(77) 78 x
                                                                                                2(21) 23 x                              7(11)  18 ok
                                                                                               3(14) 17 ok 
 
                                                                           
           (m+n)2 :    192 = 361                    19              202 = 400                20                 212 = 441                 21
              d                    247                                               247                                             247                            
            mn                   114 = 1(114) 115 x                   153 = 9(17) 26 x                      194 = 2(97) 99 x
                                             2(57)  →   59 x                                                                 
                                             3(38)  →   41 x                                         
                                             6(19)  →   25 x
  
  
           (m+n)2 :    222 = 484                  22                232 = 529                           
              d                     247                                              247                               
            mn                    237 = 3(79) 82 x                       282  mn > d (not possible so we stop here)
                                                                                                                                   
 
     So, we have found two solutions for d = 247; namely, (m,n) = (3,14) and (m,n) = (7,11).
 
                1) For   m = 3, n = 14, we get                                                                                (m,n) = (3,14)
 
                      a = mn = 3(14) = 42,         b = a + m2  =  42 + 32  =  51,       c  =  a + n2  = 42 + 142  =  238
 
                                       giving us            ( ?  ,  ?  ,  ? 247 )  =  (42, 51, 238, 247), and

                2) for   m = 7, n = 11, we get                                                                                 (m,n) = (7,11)
 
                      a = mn = 7(11) = 77,         b = a + m2  =  77 + 72  =  126,       c  =  a + n2  = 77 + 112  =  198,
                                 giving us            ( ?  ,  ?  ,  ? 247 )  =  (77, 126, 198, 247).
                               __________________________________________________________
 
                            Determining the Number of Consecutive Squares Needed to Find d
 
     From (18), we know that only if mn < d can we find Pythagorean quadruples for d.  Look at the tables below which illustrate one of our methods for finding Pythagorean quadruples for d.
 
               k:                    1st                     2nd                       3rd                       4th                               kth
 
          (m+n)2:                 s2                   (s+1)2                  (s+2)2                 (s+3)2                          (s+k-1)2       
        __    d                    d _              _      d _              _       d                        d__          .  .  .     _          d     
             mn:                s2 - d              (s+1)2 - d             (s+2)2 - d             (s+3)2 - d                     (s+k-1)2 - d,
 
where  s2, (s+1)2, (s+2)2, (s+3)2. . . are consecutive squares, s2 is the smallest square > d, and k is the number of the square.
 
     In general, (as shown above in the tables), the kth square is (s+k-1)2,    and    mn = (s+k-1)2 - d.                                  (19) 
 
Since mn must be less than d, we get                      mn       <    d.
 
Substituting from (19),                                   (s+k-1)2 -  d  <    d,     
 
or,                                                                   (s+k-1)2   <   2d.                                                                                   (20)
                                                                                        __        
Solving for k, we get                                       k   <   1 + 2d  -  s                                                                                  (21)
 
     Thus, to determine the number of squares needed to find d, we simply need to find the largest value of k which makes either (20) or (21) true. 
       
Example If d = 247, then the smallest square > 247 is 162 = 256. So, using s2 = 162, s = 16, and d = 247  in (20), we get
                                                                 (s+k-1)2    <    2d
                                                                 (16+k-1)2  <  2(247)
                                                                   (k+15)2   <    494                                                                                        (22)
 
     Substituting various values of k into (22), we get
 
                                                          k                 (k+15)2
                                                      - - - - - - - - - - - - - - - - - - - - - - - -
                                                          1               162 = 256 < 494
                                                          3               182 = 324 < 494
                                                          6               212 = 441 < 494
                                                   - -> 7               222 = 484 < 494
                                                          8               232 = 529 > 494
 
Thus, 7 is the largest value of k which satisfies (22).                           
                                                                                    _____              ___
     Using (21) with s = 16 and d = 247, we get   k < 1 + 2(247) -  16 = √ 494 - 15 = 7.226, so k < 7.226, and the largest value of k which satisfies k < 7.226 is k = 7, as we just found above using (20).  
 
     Thus, we must use 7 squares in finding those primitive Pythagorean quadruples which have d = 247 as a member. Those 7 squares will start with s2 = 162 and end with (k+15)2 = (7+15)2 = 222; namely,
 
                                                                  162, 172, 182, 192, 202, 212, and 222.                                                              (23)
 
     Note: See 4d) above to see the complete solution to this problem where we used exactly the 7 squares from 162 to 222 as in (23) above.
 
Example If d = 811, then the smallest square > 811 is 292 = 841. So, using s2 = 292, s = 29, and d = 811 in (20), we get
 
                                                                  (s+k-1)2   <  2d
                                                                 (29+k-1)2  <  2(811)
                                                                   (k+28)2   <  1622                                                                                        (24)
 
Substituting various values of k into (24), we get
 
                                                          k                 (k+28)2
                                                      - - - - - - - - - - - - - - - - - - - - - - - -
                                                          2                302 =  900 < 1622
                                                          5                332 = 1089 < 1622
                                                         10               382 = 1444 < 1622
                                                  - -> 12               402  = 1600 < 1622
                                                         13               412  = 1681 > 1622
 
Thus, 12 is the largest value of k which satisfies (24).
                                                                                      _____              ____
     Using (21) with s = 29 and d = 811, we get     k < 1 + 2(811) - 29 = √ 1622 - 28 = 12.274, so k < 12.274, and the largest value of k which satisfies k < 12.274 is k = 12, as we just found above using (20).  
 
Thus, we must use 12 squares in finding those primitive Pythagorean quadruples which have d = 811 as a member. Those 12 squares will start with s2 = 292 and end with (k+28)2 = (12+28)2 = 402; namely,
 
                                                  292, 302, 312, 322, 332, 342, 352, 362, 372, 382, 392, and 402.
 
Example If d = 481, then the smallest square > 481 is 222 = 484. So, using s2 = 222, s = 22, and d = 481 in (20), we get
 
                                                                        (s+k-1)2   <  2d
                                                                       (22+k-1)2  <  2(481)
                                                                        (k+21)2    <  962                                                                                    (25)
 
Substituting various values of k into (25), we get
 
                                                          k                 (k+21)2
                                                      - - - - - - - - - - - - - - - - - - - - - - - -
                                                          1               222 = 484   <  962
                                                          3               252 = 625   <  962
                                                          9               302 = 900   <  962
                                                   --> 10               312 = 961   <  962
                                                         11              322 = 1024  > 962
 
Thus, 10 is the largest value of k which satisfies (23), which tells us that we must use 10 squares in finding those primitive Pythagorean quadruples which have d = 481 as a member. Those 10 squares will start with s2 = 222 and end with (k+21)2
= (10+21)2 = 312; namely, 222, 232, 242, 252, 262, 272, 282, 292, 302 and 312.
 
     Let’s find all the quadruples with d = 481 as a member.
 
        If d = 481, then N =  ( ?  ,  ?  ,  ? , 481 ) = (a, b, c, 481). Using the second equation in (17) above, and writing in an abbreviated way, we need to find m and n such that
                                                         mn = (m+n)2 - 481.
                               d = 481
 
               (m+n)2 :    222 = 484               22                 232 = 529                  23                  242 = 576                 24
                   d                    481                                 __       481                                                481
                 mn                      3 = 1(3) 4 x                          48 = 1(48) 49 x                          95 = 1(95) 96 x
                                                                                                   3(16) 19 x                                 5(19) 24 ok
                                                                                  
 
                                                                           
               (m+n)2 :    252 = 625                   25                262 = 676                  26                272 = 729                 27
                  d                    481                                               481                                                481                   
                mn                   144 = 1(144) 145 x                    195 = 5(39)  44 x                       248 = 8(31) 39 x
                                                9(16) →   25 ok                           13(15) 28 x                                                                                   
                           
              (m+n)2 :   282 = 784                    28                  292 = 841                  29                302 = 900                30
                  d                   481                                                  481                                               481
                 mn                 303 = 3(101) 104 x                       360 = 5(72) 77 x                       419 = 1(419) 420 x
                                                                                                       8(45)   53 x
 
 
                                                                                          
               (m+n)2 :   312 = 961                     31                 322 = 1024                       
                   d                  481                                                     481                               
                  mn                480 = 3(160) 163 x                          543    mn > d (not possible, so we stop here)
                                                5(96)    101 x                                                   
                                               15(32)     47 x
 
 
     Thus, we have found two solutions for d = 481; namely, (m,n) = (5,19) and (m,n) = (9,16).
 
        1) For   m = 5 n = 19, we get                                                                                (m,n) = (5,19)
 
           a = mn = 5(19) = 95,         b = a + m2  =  95 + 52  =  120,       c  =  a + n2  = 95 + 192  =  456
 
                                giving us            ( ?  ,  ?  ,  ? 481 )  =  (95, 120, 456, 481), and

         2) for   m = 9, n = 16, we get                                                                                 (m,n) = (9,16)
 
           a = mn = 9(16) = 144,         b = a + m2  =  144 + 92  =  225,       c  =  a + n2  = 144 + 162  =  400,
 
                                 giving us            ( ?  ,  ?  ,  ? 481 )  =  (144, 225, 400, 481).
 
    Note that    a = 144 = 122,    b = 225 = 152,    and   c = 400 = 202 are all perfect squares. How very nice!
                                                           ___________________
 
 
                                      Determining Which Positive Integers Can Be Values for d
 
     What kind of integers d can be members of a primitive Pythagorean quadruple? Well, Theorem 3 above tells us that d is always an odd integer, so we have
                                                              d must always be an odd positive integer.                                                    (26)
 
But, will any odd positive integer work? No. 17 is an odd positive integer, but 17 is never a value for d, which can be confirmed by looking at the tables above or by using the procedures for finding d discussed in detail above. The same is true for 45 and 63 and many others.
 
    Look at the sums of the digits for each of the d’s in the small tables for Pythagorean quadruples above. For each sum, either
 
          a) the sum is divisible by 3, and thus d is of the form 3L for some integer L,    or   
          b) the sum is 1 more than a sum which is divisible by 3, and thus d is of the form 3L+1,    but
          c) the sum is never 2 more than a sum which is divisible by 3, and thus d is never of the form 3L+2.
 
Let’s see why this is.
 
     Now, n > m, so we can write  n = m + k   for  k = 1, 2, 3 . .  .   Then 
 
                             d  =  mn + m2 + n2   =   m(m + k)  +  m2  +  (m + k)2   =   m2 + mk + m2 + m2 + 2mk + k2
                                 =   3m2 + 3mk + k2   =   3(m2 + mk) + k2   =   3L + k2   for some integer L.     Thus,
 
                                    If d is a member of a primitive Pythagorean quadruple, and n = m + k,
                                    then d = 3L + k2, for some positive integers L and k.                                                          (27)
 
Look at the following table showing the values of k and d = 3L + k2 for k = 1 to 9.
 
                                                                                       Table 1
                                 k         d = 3L + k2                                                                      Form of d
                            - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                 1            3L + 1                                                                          →  3L + 1
                                 2            3L + 4    =    3L + 3 + 1    =   3(L+1) + 1   =   3L1 + 1    →   3L + 1
                                 3            3L + 9    =    3(L + 3)       =   3L1                                  →   3L
 
                                 4            3L + 16   =    3L + 15 + 1   =   3(L+5) + 1   =  3L1 + 1   →   3L + 1
                                 5            3L + 25   =    3L + 24 + 1   =   3(L+8) + 1   =  3L1 + 1   →   3L + 1
                                 6            3L + 36   =    3(L + 12)      =   3L1                                →   3L
 
                                 7            3L + 49   =    3L + 48 + 1   =   3(L+16) + 1   =  3L1 + 1  →   3L + 1
                                 8            3L + 64   =    3L + 63 + 1   =   3(L+21) + 1   =  3L1 + 1  →   3L + 1
                                 9            3L + 81   =    3(L + 27)       =   3L1                                →   3L
                            - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                      
      As we can see in the last column on the right, d is always of the form 3L or 3L+1, but never 3L+2.
  
     In general, any integer divided by 3 will either have no remainder or a remainder of 1 or 2. Thus, if k is divided by three, then either
                                           a) k will have no remainder, and         k = 3p,       or
                                           b) k will have a remainder of 1, and    k = 3p+1,   or
                                           c) k will have a remainder of 2, and    k = 3p+2   for some integer p.
 
    In general, for k = 3p, 3p+1, and 3p+2, p = 0, 1, 2  .  .  .  , we have Table 2 shown below:
 
                                                                                     Table 2
                    k                                                                                                          
           (p=0,1, . . .)   d = 3L + k2                                                                                                      Form of d
        - - - - - - - - - - - - - - - - -  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                  3p          3L + 9p2          =    3(L + 3p2)                                                     =  3L1         →  3L
 
               3p + 1      3L + (3p+1)2    =    3L + 9p2 + 6p + 1    =   3(L+3p2 + 2p) + 1        =   3L1 + 1  →  3L + 1
 
               3p + 2      3L + (3p+2)2    =    3L + 9p2 + 12p + 4   =  3(L+3p2 + 4p + 1) + 1   =   3L1 + 1  →  3L + 1 
 
         - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  which proves                  
                                     Theorem 7a
 
                                     If d is a member of a primitive Pythagorean quadruple (a, b, c, d),
                                     then d is odd and of the form 3L or 3L+1 but never of the form 3L+2,
                                     for some positive integer L. 
                                     ____________________________________________________
 
     Thus, any d which is a member of a primitive Pythagorean quadruple must be odd and of the form 3L or 3L+1. However, is the converse of this statement true?; that is,
 
        Is any odd number which is in the form of 3L or 3L+1, a member d of a primitive Pythagorean quadruple (a, b, c, d)?
 
     Unfortunately, the answer is no. 45 is of the form 3L; namely, 45 = 3(15), but 45 is not a member of any primitive Pythagorean quadruple as can be seen by examining the tables above. So, what is wrong?
 
     Well, if we look at the prime factors of 45, we get 45 = 3(3)(5), and we see that one of its factors, 5, is not of the form 3L or 3L+1. It is of the form 3L+2; namely, 5 = 3(1)+2. And, 45 is not a member of any primitive Pythagorean quadruple.
 
     187 is of the form 3L+1; namely, 187 = 3(62) +1, but 187 is not a member of any primitive Pythagorean quadruple as can be seen by examining the tables above or using the procedures for d above. So, what is wrong?
 
     Again, if we look at the prime factors of 187, we get 187 = 11(17), and we see that both of its factors, 11 and 17 are not of the form 3L or 3L+1. They are both of the form 3L+2; namely, 11 = 3(3)+2, and 17 = 3(5)+2 And, 187 is not a member of any primitive Pythagorean quadruple.    Thus, we have
 
                                 The prime factors of d must be odd and of the form 3L or 3L+1 but not 3L+2,                      (28)
 giving us
                                    Theorem 7b
 
                                    For d to be a member of a primitive Pythagorean quadruple (a, b, c, d),
                                    d and its prime factors must be odd and of the form 3L or 3L+1, but
                                    not 3L+2, for some positive integer L. 
                                   ____________________________________________________
 
     Since d = mn + m2 + n2, we can write d in the following manner: 
 
                                              d = mn + m2 + n2   =   mn + m2 + n2 + 2mn - 2mn 
                                               
                                                                           = 3mn + m2 - 2mn + n2
 
                                                                           = 3mn + (m - n)2.                                                                                (29)
 
Looking at (29), we see that for d to have a factor of 3, then  m - n  must have a factor of 3. So, if for some integer p,
 
                                                                              m - n = 3p,                                                                                      (30) 
 
then, from (29),                              d  =  3mn + (3p)2  = 3mn + 9p2 = 3(mn + 3p2),                                                           (31) 
                                                                                                     
which shows us that d can have a factor of 3.                                      
 
     However, looking at the right-hand side of (31); namely,
    
                                                    d  =  3mn + (3p)2  = 3mn + 9p2 = 3(mn + 3p2),                                                            (31)
                                                                                                         
                                                                                             (must have a factor of 3)
 
we see that for d to have more than one factor of 3, then mn must have a factor of 3, which implies that either m or n must have a factor of 3.  Let’s say that n has a factor of 3. Then, n = 3q. But, from (30), we have   m - n = 3p,  or   m = n + 3p =
3q + 3p  =  3(q + p), which shows that m also has a factor of 3. Thus, m and n have a common factor, which is not possible for primitive Pythagorean quadruples, and therefore, d cannot have more than one factor of 3. (The result is the same if we assume that m has a factor of 3.)  All this gives us
 
                         Theorem 7c
 
                         For d to be a member of a primitive Pythagorean quadruple (a, b, c, d),  d and its
                         prime factors must be odd and of the form 3L or 3L+1, but not 3L+2, for some
                         positive integer L, with no more than one prime factor of 3
                         ____________________________________________________________
 
     Now, since d can have no more than one prime factor of 3, then either
 
       a) d has no prime factors of 3 and therefore must be a product of only prime factors of the form
            3L+1, since factors of the form 3L have a prime factor of 3, making d be of the form 3L+1, or
 
       b)  d has one prime factor of 3 and therefore must be a product of just one 3 and prime factors of
            the form 3L+1, making d be of the form 3(3L+1).
              
This gives us
 
                 Theorem 7d
 
                 For d to be a member of a primitive Pythagorean quadruple (a, b, c, d),  d  must be
                 odd and of the form 3L+1 or 3(3L+1) with no even prime factors or prime factors
                 of the form 3L+2, L = 0,1,2, . . . 
                 _____________________________________________________________________
 
      Now, in Theorem 7d, d and its prime factors must always be odd.   Thus, 3L+1 must be odd, which occurs only when L is even, for if L were odd, then 3L would be odd, and 3L+1 would be even. So, if L is even, say L = 2L1, then 3L+1 = 3(2L1)+1 = 6L1 + 1, and d must be of the form 6L1 + 1 for L1 some positivetive integer. So,
 
                                               If d is odd and of the form 3L+1, then d is of the form 6L1+1.                                   (33)
 
     Also, 3L+2 must be odd, which occurs only when L is odd, for if L were even, then 3L would be even, and 3L+2 would be even. So, if L is odd, say L = 2L1+1, then 3L+2 = 3(2L1+1)+2 = 6L1 + 5, and none of the prime factors of d must be of the form 6L1 + 5 for L1 some non-negative integer. So,
 
    If the prime factors of d are odd and of the form 3L+2, then these prime  factors are of the form 6L1+5.          (34)
 
     Thus, (33) and (34) give us our final theorem about d; namely
 
                              Theorem 8
 
                              For d to be a member of a primitive Pythagorean quadruple (a, b, c, d),
                              d must be of the form 6L+1 or 3(6L+1) with no prime factors of the
                              form 6L+5, L = 0, 1, 2, . . . 
                             _____________________________________________________
 
 Example  Can any of the following numbers be values of d in a primitive Pythagorean quadruple?
 
      189     No.  189 = 9(21) = 3(3)3(7), which has more than one prime factor of 3, so 189 can not be put in the form of
                        either 6L+1 or 3(6L+1). 
    
      111    Yes.  111 = 3(37) = 3[6(6)+1], which is in the form 3(6L+1), and there are no prime factors of the form 6L+5.
 
                                                           (10, 11, 110, 111)                       (m,n) = (1,10)                                                
   
      889    Yes.  889 = 6(148)+1, which is in the form 6L+1 and none of its prime factors are of the form 6L+5, since
                        889 = 7(127), where 7 = 6(1)+1 and 127 = 6(21)+1, both being prime factors of the form 6L+1.
 
                                                           (200, 264, 825, 889)                       (m,n) = (8,25)
             
      527     No.   527 = 6(87)+5, which is in the form of 6L+5, and one of its prime factors is of the form 6L+5, since
                         527 = 17(31), and 17 = 6(2)+5 is a prime factor of the form 6L+5.             
                                                      
  
                             Using the Quadratic Formula to find m and n for d
 
     Now, d = mn + m2 + n2. So, let’s use the quadratic formula to solve this equation for n.
 
                                                                      d = mn + m2 + n2.    
 
                                                                  n2 + mn + (m2 - d) = 0
                                                            ____________                                    ________
                                           - m   +/-   √ m2 - 4(m2 - d)                      - m   +/-  √ 4d - 3m2
                             n   =    --------------------------------------    =      --------------------------------                                         (35)
                                                             2                                                    2
 
Looking at the right-hand side of (35), we see that
 
      1) 4d - 3m2 must be > 0 so that n is a real number. So, 
 
                                                          4d - 3m2   >     0
                                                                  4d    >    3m2
                                                                 3m2  <     4d
                                                                  m2   <   4d/3
                                                                                ____
                                                                   m   <   4d/3
                                                                                    ____
                 Thus,                                     1   <   m   < 4d/3.                                                                                       (36) 
 
      2) 4d - 3m2 must be a perfect square, say p2, so that n may be an integer.
 
                  Thus,                            4d - m2 = p2,       for some positive integer p.                                                      (37)
 
       3) Since m < n, and m can be equal to 1, we must have n > 2.    Thus,
                                                                 ________
                                                - m   +/-   √ 4d - 3m2
                       n       =        ----------------------------------    >    2
                                                              2
                                                                 ________
                                                - m   +/-   √ 4d - 3m2         >     4
                                                                 ________
                                                          +/- √ 4d - 3m2         >        m + 4
                                                                   4d - 3m2        >      (m + 4)2                
                                                                        4d            >     3m2 + m2 + 8m + 16
                                                                          d            >      m2 + 2m + 8
 
                     Thus,                                   m2 + 2m + 8 < d   so that   n > 2,                                                                  (38)
 giving us:
 
                               Theorem 9
 
                               If d and p are positive integers, and there exists a positive integer m such that
 
                                                               4d - 3m2 = p2, a perfect square,
 
                                then d is a member of a primitive Pythagorean quadruple (a, b, c, d), and
                                                                       ____                                       
                                               a)       1 < m <  4d/3
 
                                               b)       m2 + 2m + 8 < d
 
                                               c)      n = ( - m + p )/2
                          
                                               d)      d = mn + m2 + n2,   
                              ___________________________________________________________
 
Example In a primitive Pythagorean quadruple (a, b, c, d), can d = 19?   According to Theorem 9, if we can find a positive integer m which makes 4d - 3m2 = 4(19) - 3m2 = 76 - 3m2 a perfect square, then d = 19 will be a member of a primitive Pythagorean quadruple (a, b, c, d). From a) and b), we get
          ____       ______
    a)  4d/3   = 4(19)/3 = 5.03, so 1 < m < 5.03, and we will use m = 1, 2, 3, 4, 5.
 
    b)  m2 + 2m + 8 < 19 is true for m = 1, 2, and 3, but not for m = 4 and 5.  So, we need to use only m = 1, 2, and 3.
 
       Substituting these values of m into 4d - 3m2 = 4(19) - 3m2 = 76 - 3m2, we have
 
                                                         m        76 - 3m2  = p2                                                     
                                                    - - - - - - - - - - - - - - - - - - - - -- - - - - - - - - - -
                                                          1        76  -   3   =  73
                                                          2        76  -  12  =  64 = 82,    a perfect square.
                                                          3        76  -  27  =  49 = 72,    a perfect square.
            
      When m = 2 or 3, p2 = 76 - 3m2 is a perfect square, so d = 19 is a member of a primitive Pythagorean quadruple
(a, b, c, d).         
                                                             
     For m = 2, p = 8, and from c) of Theorem 9,  n = (- m + p) / 2 = (- 2 + 8) / 2  = 3.             (m,n) = (2,3)
 
     For m = 3, p = 7, and from c) of Theorem 9,  n = (- m + p) / 2 = (- 3 + 7) / 2   = 2.  So, m = 3 and n = 2, but this makes
 m > n, and we require m < n.                             
 
    Thus, a = mn = 2(3) = 6,     b = a + m2 = 6 + 22 = 10,    c = a + n2 = 6 + 32 = 15,   and    d = c + m2 = 15 + 22 = 19,
giving us                                                   (6, 10, 15, 19)                             as a quadruple with d = 19.
 
Example In a primitive Pythagorean quadruple (a, b, c, d), can d = 201?   According to Theorem 7, if we can find a positive integer m which makes 4d - 3m2 = 4(201) - 3m2 = 804 - 3m2 a perfect square, then d = 201 will be a member of a primitive Pythagorean quadruple (a, b, c, d). From a) and b), we get
          ____       _______
    a)  4d/3   = 4(201)/3 = 16.37, so 1 < m < 16.37, and we will use m = 1, 2, 3, 4, 5,  . . .  , 16.
 
    b) m2 + 2m + 8  <  201  is true for m = 1, 2, 3, . . . , 12, but not for m = 13, 14, 15, and 16. 
        So, we need to use only m = 1, 2, 3, . . . , 12.
 
       Substituting these values of m into 4d - 3m2 = 4(201) - 3m2 = 804 - 3m2, we have
                                                         m       804  -  3m2  =   p2                                                     
                                                    - - - - - - - - - - - - - - - - - - - - -- - - - - - - - - - -
                                                          1       804  -    3    =   801
                                                          2       804  -  12    =   792
                                                          3       804  -  27    =   777
                                                          4       804  -  48    =   756
                                                          5       804  -  75    =   729 = 272
                                                          6       804  -  108  =   696
                                                          7       804  -  147  =   657
                                                          8       804  -  192  =   612
                                                          9       804  -  243  =   561
                                                         10      804  -  300  =   504 
                                                         11      804  -  363  =   441 = 212
                                                         12      804  -  432  =   372
                                         
     When m = 5 or 11, p2 = 804 - 3m2 is a perfect square, so d = 201 is a member of a primitive Pythagorean
     quadruple (a, b, c, d).         
                                                          
     For m = 5, p = 27, and from c) of Theorem 9,  n = (- m + p) / 2  = (- 5 + 27) / 2   = 11.        (m,n) = (5,11)
 
     For m = 11, p = 21, and from c) of Theorem 9,  n = (- m + p) / 2 = (- 11 + 21) / 2   = 5.    So, m = 11 and n = 5,  but this
     makes m > n, and we require m < n.                             
 
Thus,  a = mn = 5(11) = 55,  b = a + m2 = 55 + 52 = 80,  c = a + n2 = 55 + 112 = 176,  and  d = c + m2 = 176 + 52 = 201,
giving us                                   
                                                                          (55, 80, 176, 201)  
as a quadruple with d = 201.
 
 
                                                                                   Home
  ___________________________________________________________________________________________