%I #40 Sep 08 2022 08:45:05
%S 2,5,8,10,13,18,17,20,25,32,26,29,34,41,50,37,40,45,52,61,72,50,53,58,
%T 65,74,85,98,65,68,73,80,89,100,113,128,82,85,90,97,106,117,130,145,
%U 162,101,104,109,116,125,136,149,164,181,200,122,125,130,137,146,157
%N Triangle T(n, k) = n^2 + k^2, 1 <= k <= n, read by rows.
%C The formula yields squares of hypotenuses of right triangles having integer side lengths (A000404), but with duplicates (cf. A024508) and not in increasing order. - _M. F. Hasler_, Apr 05 2016
%H Reinhard Zumkeller, <a href="/A070216/b070216.txt">Rows n = 1..120 of triangle, flattened</a>
%F a(n, k) = n^2 + k^2, 1 <= k <= n.
%F T(n,k) = (A215630(n,k) + A215631(n,k)) / 2, 1 <= k <=n. - _Reinhard Zumkeller_, Nov 11 2012
%F T(n,k) = A002024(n,k)^2 + A002260(n,k)^2. - _David Rabahy_, Mar 24 2016
%e a(3,2)=13 because 3^2+2^2=13.
%e Triangle begins:
%e 2;
%e 5, 8;
%e 10, 13, 18;
%e 17, 20, 25, 32;
%e 26, 29, 34, 41, 50;
%e 37, 40, 45, 52, 61, 72;
%e 50, 53, 58, 65, 74, 85, 98;
%e 65, 68, 73, 80, 89, 100, 113, 128;
%e 82, 85, 90, 97, 106, 117, 130, 145, 162;
%e 101, 104, 109, 116, 125, 136, 149, 164, 181, 200; ...
%e - _Vincenzo Librandi_, Apr 30 2014
%t t[n_,k_]:=n^2 + k^2; Table[t[n, k], {n, 11}, {k, n}]//Flatten (* _Vincenzo Librandi_, Apr 30 2014 *)
%o (Haskell)
%o a070216 n k = a070216_tabl !! (n-1) !! (k-1)
%o a070216_row n = a070216_tabl !! (n-1)
%o a070216_tabl = zipWith (zipWith (\u v -> (u + v) `div` 2))
%o a215630_tabl a215631_tabl
%o -- _Reinhard Zumkeller_, Nov 11 2012
%o (Magma) [n^2+k^2: k in [1..n], n in [1..15]]; // _Vincenzo Librandi_, Apr 30 2014
%o (PARI) T(n, k) = n^2+k^2;
%o for (n=1, 10, for(k=1, n, print1(T(n, k), ", "))) \\ _Altug Alkan_, Mar 24 2016
%Y Not a permutation of sequence A000404 (which has no duplicates).
%Y Cf. A002522 (left edge), A001105 (right edge), A219054 (row sums).
%K easy,nonn,tabl
%O 1,1
%A Charles Northup (cnorthup(AT)esc6.net), May 07 2002
%E More terms from Larry Reeves (larryr(AT)acm.org), Sep 25 2002
%E Edited and corrected by _M. F. Hasler_, Apr 05 2016