%I #14 Sep 08 2022 08:45:42
%S 1,1,1,1,2,1,1,4,4,1,1,6,8,6,1,1,8,12,12,8,1,1,10,16,18,16,10,1,1,12,
%T 20,24,24,20,12,1,1,14,24,30,32,30,24,14,1,1,16,28,36,40,40,36,28,16,
%U 1,1,18,32,42,48,50,48,42,32,18,1
%N Triangle read by rows: T(n, k) = 2*k*(n - k) with T(n, 0) = T(n, n) = 1.
%H G. C. Greubel, <a href="/A157528/b157528.txt">Rows n = 0..50 of the triangle, flattened</a>
%F T(n, k) = 2*k*(n - k) with T(n, 0) = T(n, n) = 1.
%F Sum_{k=0..n} T(n, k) = (n+2)*(n^2 - 2*n + 3)/3 - [n=0].
%e Triangle begins
%e 1;
%e 1, 1;
%e 1, 2, 1;
%e 1, 4, 4, 1;
%e 1, 6, 8, 6, 1;
%e 1, 8, 12, 12, 8, 1;
%e 1, 10, 16, 18, 16, 10, 1;
%e 1, 12, 20, 24, 24, 20, 12, 1;
%e 1, 14, 24, 30, 32, 30, 24, 14, 1;
%e 1, 16, 28, 36, 40, 40, 36, 28, 16, 1;
%e 1, 18, 32, 42, 48, 50, 48, 42, 32, 18, 1;
%p A157528 := proc(n,k) if k=0 or k=n then 1; else 2*k*(n-k) ; end if; end proc: # _R. J. Mathar_, Sep 14 2011
%t T[n_, k_] = With[{m=2}, If[k*(n-k)==0, 1, n^m - (k^m + (n-k)^m)]];
%t Table[T[n, k], {n,0,10}, {k,0,n}]//Flatten
%o (Magma) [k eq 0 or k eq n select 1 else 2*k*(n-k): k in [0..n], n in [0..12]]; // _G. C. Greubel_, Jan 14 2022
%o (Sage) flatten([[1 if (k==0 or k==n) else 2*k*(n-k) for k in (0..n)] for n in (0..12)]) # _G. C. Greubel_, Jan 14 2022
%K nonn,tabl,easy
%O 0,5
%A _Roger L. Bagula_, Mar 02 2009