login
Triangle T(n,k) = Sum_{j=0..k} Stirling1(n, n-j)*binomial(n,j) + Sum_{j=0..n-k} Stirling1(n, n-j)*binomial(n,j), read by rows.
5

%I #19 Sep 08 2022 08:45:52

%S 2,2,2,0,-2,0,-1,-10,-10,-1,20,-4,86,-4,20,-78,-128,102,102,-128,-78,

%T 77,-13,1982,-6628,1982,-13,77,2641,2494,1129,12448,12448,1129,2494,

%U 2641,-36944,-37168,12168,-463496,745726,-463496,12168,-37168,-36944

%N Triangle T(n,k) = Sum_{j=0..k} Stirling1(n, n-j)*binomial(n,j) + Sum_{j=0..n-k} Stirling1(n, n-j)*binomial(n,j), read by rows.

%H G. C. Greubel, <a href="/A176154/b176154.txt">Rows n = 0..100 of triangle, flattened</a>

%F T(n, k) = Sum_{j=0..k} Stirling1(n, n-j)*binomial(n,j) + Sum_{j=0..n-k} Stirling1(n, n-j)*binomial(n,j).

%e Triangle begins as:

%e 2;

%e 2, 2;

%e 0, -2, 0;

%e -1, -10, -10, -1;

%e 20, -4, 86, -4, 20;

%e -78, -128, 102, 102, -128, -78;

%e 77, -13, 1982, -6628, 1982, -13, 77;

%e 2641, 2494, 1129, 12448, 12448, 1129, 2494, 2641;

%p with(combinat);

%p T:= proc(n, k) option remember; add(stirling1(n, n-j)*binomial(n, j), j=0..k) + add(stirling1(n, n-j)* binomial(n, j), j=0..n-k); end;

%p seq(seq(T(n,k), k=0..n), n=0..10); # _G. C. Greubel_, Nov 26 2019

%t T[n_, k_]:= Sum[StirlingS1[n, n-j]*Binomial[n, j], {j, 0, k}] + Sum[StirlingS1[n, n-j]*Binomial[n, j], {j, 0, n-k}];

%t Table[T[n, k], {n,0,10}, {k,0,n}]//Flatten

%o (PARI) T(n,k) = sum(j=0,k, stirling(n,n-j,1)*binomial(n,j)) + sum(j=0,n-k, stirling(n, n-j,1)*binomial(n,j)); \\ _G. C. Greubel_, Nov 26 2019

%o (Magma)

%o T:= func< n,k | (&+[StirlingFirst(n,n-j)*Binomial(n,j): j in [0..k]]) + (&+[StirlingFirst(n,n-j)*Binomial(n,j): j in [0..n-k]]) >;

%o [T(n,k): k in [0..n], n in [0..10]]; // _G. C. Greubel_, Nov 26 2019

%o (Sage)

%o def T(n, k): return sum((-1)^j*stirling_number1(n,n-j)*binomial(n,j) for j in (0..k)) + sum((-1)^j*stirling_number1(n, n-j)*binomial(n,j) for j in (0..n-k))

%o [[T(n, k) for k in (0..n)] for n in (0..10)] # _G. C. Greubel_, Nov 26 2019

%o (GAP)

%o T:= function(n,k) return Sum([0..k], j-> (-1)^j*Stirling1(n,n-j)*Binomial(n,j)) + Sum([0..n-k], j-> (-1)^j*Stirling1(n, n-j)*Binomial(n,j)); end;

%o Flat(List([0..10], n-> List([0..n], k-> T(n, k) ))); # _G. C. Greubel_, Nov 26 2019

%Y Cf. A048994, A132393, A176153, A176155, A176156, A176157.

%K sign,tabl

%O 0,1

%A _Roger L. Bagula_, Apr 10 2010

%E Name edited by _G. C. Greubel_, Nov 27 2019