OFFSET
1,5
LINKS
G. C. Greubel, Rows n = 1..50 of the triangle, flattened
FORMULA
T(n, k) = (m*n-m*k+1)*T(n-1,k-1) + (m*k-m+1)*T(n-1,k), with T(n, 1) = T(n, n) = 1, and m = -2.
Sum_{k=1..n} T(n, k) = A130706(n-1). - G. C. Greubel, Mar 17 2022
EXAMPLE
Triangle begins:
1;
1, 1;
1, -2, 1;
1, -1, -1, 1;
1, -4, 6, -4, 1;
1, -3, 2, 2, -3, 1;
1, -6, 15, -20, 15, -6, 1;
1, -5, 9, -5, -5, 9, -5, 1;
1, -8, 28, -56, 70, -56, 28, -8, 1;
1, -7, 20, -28, 14, 14, -28, 20, -7, 1;
MAPLE
T:=proc(n, k, l) option remember;
if (n=1 or k=1 or k=n) then 1 else
(l*n-l*k+1)*T(n-1, k-1, l)+(l*k-l+1)*T(n-1, k, l); fi; end;
for n from 1 to 14 do lprint([seq(T(n, k, -2), k=1..n)]); od;
MATHEMATICA
T[n_, k_, l_] := T[n, k, l] = If[n == 1 || k == 1 || k == n, 1, (l*n-l*k+1)*T[n-1, k-1, l]+(l*k-l+1)*T[n-1, k, l]]; Table[T[n, k, -2], {n, 1, 14}, {k, 1, n}] // Flatten (* Jean-François Alcover, Jan 09 2014, translated from Maple *)
PROG
(Magma)
function T(n, k, m)
if k eq 1 or k eq n then return 1;
else return (m*(n-k)+1)*T(n-1, k-1, m) + (m*k-m+1)*T(n-1, k, m);
end if; return T;
end function;
A225372:= func< n, k | T(n, k, -2) >;
[A225372(n, k): k in [1..n], n in [1..12]]; // G. C. Greubel, Mar 17 2022
(Sage)
@CachedFunction
def T(n, k, m):
if (k==1 or k==n): return 1
else: return (m*(n-k)+1)*T(n-1, k-1, m) + (m*k-m+1)*T(n-1, k, m)
def A225372(n, k): return T(n, k, -2)
flatten([[ A225372(n, k) for k in (1..n)] for n in (1..15)]) # G. C. Greubel, Mar 17 2022
CROSSREFS
KEYWORD
sign,tabl
AUTHOR
N. J. A. Sloane and Roger L. Bagula, May 08 2013
STATUS
approved