%I #82 Apr 19 2023 09:04:44
%S 5,10,13,17,20,25,26,29,34,41,37,40,45,52,61,50,53,58,65,74,85,65,68,
%T 73,80,89,100,113,82,85,90,97,106,117,130,145,101,104,109,116,125,136,
%U 149,164,181,122,125,130,137,146,157,170,185,202,221,145,148,153,160
%N Triangle read by rows, sums of 2 distinct nonzero squares: T(n,k) = k^2+n^2, (n>=2, 1 <= k <= n-1)
%C Discovered by Bernard Frénicle de Bessy (1605?-1675). - _Paul Curtz_, Aug 18 2008
%C Terms that are not hypotenuses in primitive Pythagorean triangles, are replaced by 0 in A222946. - _Reinhard Zumkeller_, Mar 23 2013
%C This triangle T(n,k) gives the circumdiameters for the Pythagorean triangles with a = (n+1)^2 - k^2, b = 2*(n+1)*k and c = (n+1)^2 + k^2 (see the Floor van Lamoen entries or comments A063929, A063930, A002283, A003991). See also the formula section. Note that not all Pythagorean triangles are covered, e.g., (9,12,15) does not appear. - _Wolfdieter Lang_, Dec 03 2014
%H Reinhard Zumkeller, <a href="/A055096/b055096.txt">Rows n = 2..121 of triangle, flattened</a>
%H M. de Frénicle, <a href="http://gallica.bnf.fr/ark:/12148/bpt6k5493994j/f17.image">Méthode pour trouver la solutions des problèmes par les exclusions</a>, in: "Divers ouvrages de mathématiques et de physique, par Messieurs de l'Académie royale des sciences", Paris, 1693, pp 1-44.
%H Antti Karttunen, <a href="http://www.iki.fi/~kartturi/matikka/A055096e.htm">Larger table, showing also locations of 4k+1 primes and squares</a>
%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/CongruumProblem.html">Congruum Problem.</a>
%H <a href="/index/Su#ssq">Index entries for sequences related to sums of squares</a>
%F a(n) = sum2distinct_squares_array(n).
%F T(n, 1) = A002522(n).
%F T(n, n-1) = A001844(n-1).
%F T(2*n-2, n-1) = A033429(n-1).
%F T(n,k) = A133819(n,k) + A140978(n,k) = (n+1)^2 + k^2, 1 <= k <= n. - _Reinhard Zumkeller_, Mar 23 2013
%F T(n, k) = a*b*c/(2*sqrt(s*(s-1)*(s-b)*(s-c))) with s =(a + b + c)/2 and the substitution a = (n+1)^2 - k^2, b = 2*(n+1)*k and c = (n+1)^2 + k^2 (the circumdiameter for the considered Pythagorean triangles). - _Wolfdieter Lang_, Dec 03 2014
%F From _Bob Selcoe_, Mar 21 2015: (Start)
%F T(n,k) = 1 + (n-k+1)^2 + Sum_{j=0..k-2} (4*j + 2*(n-k+3)).
%F T(n,k) = 1 + (n+k-1)^2 - Sum_{j=0..k-2} (2*(n+k-3) - 4*j).
%F Therefore: 4*(n-k+1) + Sum_{j=0..k-2} (2*(n-k+3) + 4*j) = 4*n(k-1) - Sum_{j=0..k-2} (2*(n+k-3) - 4*j). (End)
%F From _G. C. Greubel_, Apr 19 2023: (Start)
%F T(2*n-3, n-1) = A033429(n-1).
%F T(2*n-4, n-2) = A079273(n-1).
%F T(2*n-2, n) = A190816(n).
%F T(3*n-4, n-1) = 10*A000290(n-1) = A033583(n-1).
%F Sum_{k=1..n-1} T(n, k) = A331987(n-1).
%F Sum_{k=1..floor(n/2)} T(n-k, k) = A226141(n-1). (End)
%e The triangle T(n, k) begins:
%e n\k 1 2 3 4 5 6 7 8 9 10 11 ...
%e 2: 5
%e 3: 10 13
%e 4: 17 20 25
%e 5: 26 29 34 41
%e 6: 37 40 45 52 61
%e 7: 50 53 58 65 74 85
%e 8: 65 68 73 80 89 100 113
%e 9: 82 85 90 97 106 117 130 145
%e 10: 101 104 109 116 125 136 149 164 181
%e 11: 122 125 130 137 146 157 170 185 202 221
%e 12: 145 148 153 160 169 180 193 208 225 244 265
%e ...
%e 13: 170 173 178 185 194 205 218 233 250 269 290 313,
%e 14: 197 200 205 212 221 232 245 260 277 296 317 340 365,
%e 15: 226 229 234 241 250 261 274 289 306 325 346 369 394 421,
%e 16: 257 260 265 272 281 292 305 320 337 356 377 400 425 452 481,
%e ...
%e Formatted and extended by _Wolfdieter Lang_, Dec 02 2014 (reformatted Jun 11 2015)
%e The successive terms are (1^2+2^2), (1^2+3^2), (2^2+3^2), (1^2+4^2), (2^2+4^2), (3^2+4^2), ...
%p sum2distinct_squares_array := (n) -> (((n-((trinv(n-1)*(trinv(n-1)-1))/2))^2)+((trinv(n-1)+1)^2));
%t T[n_, k_]:= (n+1)^2 + k^2; Table[T[n, k], {n,15}, {k,n}]//Flatten (* _Jean-François Alcover_, Mar 16 2015, after _Reinhard Zumkeller_ *)
%o (Haskell)
%o a055096 n k = a055096_tabl !! (n-1) !! (k-1)
%o a055096_row n = a055096_tabl !! (n-1)
%o a055096_tabl = zipWith (zipWith (+)) a133819_tabl a140978_tabl
%o -- _Reinhard Zumkeller_, Mar 23 2013
%o (Magma) [n^2+k^2: k in [1..n-1], n in [2..15]]; // _G. C. Greubel_, Apr 19 2023
%o (SageMath)
%o def A055096(n,k): return n^2 + k^2
%o flatten([[A055096(n,k) for k in range(1,n)] for n in range(2,16)]) # _G. C. Greubel_, Apr 19 2023
%Y Sorting gives A024507. Count of divisors: A055097, Möbius: A055132. For trinv, follow A055088.
%Y Cf. A001844 (right edge), A002522 (left edge), A033429 (central column).
%Y Cf. A000290, A033583, A079273, A190816, A226141, A331987.
%K nonn,tabl
%O 2,1
%A _Antti Karttunen_, Apr 04 2000
%E Edited: in T(n, k) formula by Reinhard Zumkeller k < n replaced by k <= n. - _Wolfdieter Lang_, Dec 02 2014
%E Made definition more precise, changed offset to 2. - _N. J. A. Sloane_, Mar 30 2015