%I #41 Sep 26 2021 05:07:03
%S 5,0,13,17,0,25,0,29,0,41,37,0,0,0,61,0,53,0,65,0,85,65,0,73,0,89,0,
%T 113,0,85,0,97,0,0,0,145,101,0,109,0,0,0,149,0,181,0,125,0,137,0,157,
%U 0,185,0,221,145,0,0,0,169,0,193,0,0,0,265,0,173,0,185,0,205,0,233,0,269,0,313,197,0,205,0,221,0,0,0,277,0,317,0,365
%N Triangle for hypotenuses of primitive Pythagorean triangles.
%C For primitive Pythagorean triples (x,y,z) see the Niven et al. reference, Theorem 5.5, p. 232, and the Hardy-Wright reference, Theorem 225, p. 190.
%C Here a(n,m) = 0 for non-primitive Pythagorean triangles.
%C There is a one-to-one correspondence between the values n and m of this number triangle for which a(n,m) does not vanish and primitive solutions of x^2 + y^2 = z^2 with y even, namely x = n^2 - m^2, y = 2*n*m and z = n^2 + m^2.
%C The diagonal sequence is given by a(n,n-1) = A001844(n-1), n >= 2.
%C The row sums of this triangle are 5, 13, 42, 70, 98, 203, 340, 327, 540, ...
%C a(n,k) = A055096(n-1,k) * ((n+k) mod 2) * A063524 (gcd(n,k)): terms in A055096 that are not hypotenuses in primitive Pythagorean triangles, are replaced by 0. - _Reinhard Zumkeller_, Mar 23 2013
%C The number of non-vanishing entries in row n is A055034(n). - _Wolfdieter Lang_, Mar 24 2013
%C The non-vanishing entries when ordered according to nondecreasing leg sums x+y (see A225949 and A198441) produce (with multiplicities) A198440. - _Wolfdieter Lang_, May 22 2013
%C a(n, m) also gives twice the member s(n, m) of the triple (r(n, m), s(n, m), t(n, m)) with squares r(n, m)^2, s(n, m)^2 and t(n, m)^2 in arithmetic progression with common difference A(n, m) = A249869(n, m), the area of the primitive Pythagorean triangle, or 0 if there is no such triangle. The other members are given by 2*r(n, m) = A278717(n, m) and 2*t(n, m) = A225949(n, m). See A278717 for details and the Keith Conrad reference there. - _Wolfdieter Lang_, Nov 30 2016
%D G. H. Hardy and E. M. Wright, An Introduction to the Theory of Numbers, Fifth Edition, Clarendon Press, Oxford, 2003.
%D Ivan Niven, Herbert S. Zuckerman and Hugh L. Montgomery, An Introduction to the Theory Of Numbers, Fifth Edition, John Wiley and Sons, Inc., NY 1991.
%H Reinhard Zumkeller, <a href="/A222946/b222946.txt">Rows n = 2..120 of triangle, flattened</a>
%F a(n,m) = n^2 + m^2 if n > m >= 1, gcd(n,m) = 1, and n and m are integers of opposite parity (i.e., (-1)^(n+m) = -1), otherwise a(n,m) = 0.
%e The triangle a(n,m) begins:
%e n\m 1 2 3 4 5 6 7 8 9 10 11 12 13 ...
%e 2: 5
%e 3: 0 13
%e 4: 17 0 25
%e 5: 0 29 0 41
%e 6: 37 0 0 0 61
%e 7: 0 53 0 65 0 85
%e 8: 65 0 73 0 89 0 113
%e 9: 0 85 0 97 0 0 0 145
%e 10: 101 0 109 0 0 0 149 0 181
%e 11: 0 125 0 137 0 157 0 185 0 221
%e 12: 145 0 0 0 169 0 193 0 0 0 265
%e 13: 0 173 0 185 0 205 0 233 0 269 0 313
%e 14: 197 0 205 0 221 0 0 0 277 0 317 0 365
%e ...
%e ------------------------------------------------------------
%e a(7,4) = 7^2 + 4^2 = 49 + 16 = 65.
%e a(8,1) = 8^2 + 1^2 = 64 + 1 = 65.
%e a(3,1) = 0 because n and m are both odd.
%e a(4,2) = 0 because n and m are both even.
%e a(6,3) = 0 because gcd(6,3) = 3 (not 1).
%e The primitive triangle for (n,m) = (2,1) is (x,y,z) = (3,4,5).
%e The primitive triangle for (n,m) = (7,4) is (x,y,z) = (33,56,65).
%e The primitive triangle for (n,m) = (8,1) is (x,y,z) = (63,16,65).
%o (Haskell)
%o a222946 n k = a222946_tabl !! (n-2) !! (k-1)
%o a222946_row n = a222946_tabl !! (n-2)
%o a222946_tabl = zipWith p [2..] a055096_tabl where
%o p x row = zipWith (*) row $
%o map (\k -> ((x + k) `mod` 2) * a063524 (gcd x k)) [1..]
%o -- _Reinhard Zumkeller_, Mar 23 2013
%Y Cf. A020882 (ordered nonzero values a(n,m) with multiplicity).
%Y Cf. A249866, A225950 (odd legs), A225951 (perimeters), A225952 (even legs), A225949 (leg sums), A249869 (areas), A258149 (absolute leg differences), A278717 (leg differences).
%K nonn,easy,tabl,look
%O 2,1
%A _Wolfdieter Lang_, Mar 21 2013