OFFSET
0,5
LINKS
G. C. Greubel, Rows n = 0..50 of the triangle, flattened
FORMULA
T(n, k) = 2*k*(n - k) with T(n, 0) = T(n, n) = 1.
Sum_{k=0..n} T(n, k) = (n+2)*(n^2 - 2*n + 3)/3 - [n=0].
EXAMPLE
Triangle begins
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, 20, 24, 24, 20, 12, 1;
1, 14, 24, 30, 32, 30, 24, 14, 1;
1, 16, 28, 36, 40, 40, 36, 28, 16, 1;
1, 18, 32, 42, 48, 50, 48, 42, 32, 18, 1;
MAPLE
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
MATHEMATICA
T[n_, k_] = With[{m=2}, If[k*(n-k)==0, 1, n^m - (k^m + (n-k)^m)]];
Table[T[n, k], {n, 0, 10}, {k, 0, n}]//Flatten
PROG
(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
(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
CROSSREFS
KEYWORD
AUTHOR
Roger L. Bagula, Mar 02 2009
STATUS
approved