cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A070216 Triangle T(n, k) = n^2 + k^2, 1 <= k <= n, read by rows.

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