%I #39 Nov 07 2024 20:40:01
%S 1,4,4,9,9,9,16,16,16,16,25,25,25,25,25,36,36,36,36,36,36,49,49,49,49,
%T 49,49,49,64,64,64,64,64,64,64,64,81,81,81,81,81,81,81,81,81,100,100,
%U 100,100,100,100,100,100,100,100,121,121,121,121,121,121,121,121,121,121,121
%N n^2 repeated n times, triangle read by rows.
%C Row sums give A000578.
%C Triangle sums give A000537.
%H Reinhard Zumkeller, <a href="/A093995/b093995.txt">Rows n = 1..120 of triangle, flattened</a>
%F T(n, k) = n^2, 1<=k<=n.
%F a(n) = floor(sqrt(2*n - 1) + 1/2)^2. - _Ridouane Oudra_, Jun 18 2019
%F From _G. C. Greubel_, Dec 27 2021: (Start)
%F T(n, n-k) = T(n, k).
%F Sum_{k=1..floor(n/2)} T(n, k) = [n=1] + A265645(n+1).
%F Sum_{k=1..floor(n/2)} T(n-k, k) = (1/48)*n*(n-1)*(7*(2*n-1) + 3*(-1)^n).
%F T(2*n-1, n) = A016754(n).
%F T(2*n, n) = A016742(n). (End)
%e First few rows of the triangle are:
%e 1;
%e 4, 4;
%e 9, 9, 9;
%e 16, 16, 16, 16;
%e 25, 25, 25, 25, 25;
%e 36, 36, 36, 36, 36, 36;
%e 49, 49, 49, 49, 49, 49, 49;
%e ...
%p seq(seq(n^2, i=1..n), n=1..20); # _Ridouane Oudra_, Jun 18 2019
%t Flatten[Table[Table[n^2,{n}],{n,11}]] (* _Harvey P. Dale_, Feb 18 2011 *)
%t Table[PadRight[{},n,n^2],{n,12}]//Flatten (* _Harvey P. Dale_, Jun 28 2023 *)
%o (Haskell)
%o a093995 n k = a093995_tabl !! (n-1) !! (k-1)
%o a093995_row n = a093995_tabl !! (n-1)
%o a093995_tabl = zipWith replicate [1..] $ tail a000290_list
%o a093995_list = concat a093995_tabl
%o -- _Reinhard Zumkeller_, Nov 11 2012, Mar 18 2011, Oct 17 2010
%o (Magma) [n^2: k in [1..n], n in [1..13]]; // _G. C. Greubel_, Dec 27 2021
%o (Sage) flatten([[n^2 for k in (1..n)] for n in (1..13)]) # _G. C. Greubel_, Dec 27 2021
%o (Python)
%o from math import isqrt
%o def A093995(n): return ((m:=isqrt(k:=n<<1))+(k>m*(m+1)))**2 # _Chai Wah Wu_, Nov 07 2024
%Y Cf. A000290, A000537, A000578, A016742, A016754, A127733, A199332, A265645.
%K nonn,tabl,changed
%O 1,2
%A _Reinhard Zumkeller_, May 24 2004
%E Edited by _N. J. A. Sloane_, Jul 03 2008 at the suggestion of _R. J. Mathar_