login
Triangle, read by rows, T(n, k) = binomial(n-1,k-1)*n!/k! + binomial(n-1, n-k)* n!/(n-k+1)! - n!.
1

%I #14 Sep 08 2022 08:45:49

%S 1,1,1,1,6,1,1,24,24,1,1,140,120,140,1,1,1110,780,780,1110,1,1,10122,

%T 8190,3360,8190,10122,1,1,100856,101976,30240,30240,101976,100856,1,1,

%U 1088712,1332576,512064,60480,512064,1332576,1088712,1,1,12700890

%N Triangle, read by rows, T(n, k) = binomial(n-1,k-1)*n!/k! + binomial(n-1, n-k)* n!/(n-k+1)! - n!.

%C Row sums are: {1, 2, 8, 50, 402, 3782, 39986, 466146, 5927186, 81594182, ...}.

%C The first negative terms are T(11,6) = -11975040, T(12,6) = T(12,7) = -127733760, T(13,7) = -3943779840, T(14,7) = T(14,8) = -53785892160. - _Hugo Pfoertner_, Jul 16 2020

%H G. C. Greubel, <a href="/A169660/b169660.txt">Rows n = 1..100 of triangle, flattened</a>

%F T(n, k) = binomial(n-1,k-1)*n!/k! + binomial(n-1, n-k)*n!/(n-k+1)! - n!.

%e Triangle begins as:

%e 1;

%e 1, 1;

%e 1, 6, 1;

%e 1, 24, 24, 1;

%e 1, 140, 120, 140, 1;

%e 1, 1110, 780, 780, 1110, 1;

%e 1, 10122, 8190, 3360, 8190, 10122, 1;

%e 1, 100856, 101976, 30240, 30240, 101976, 100856, 1;

%e 1, 1088712, 1332576, 512064, 60480, 512064, 1332576, 1088712, 1;

%p b:=binomial; seq(seq( b(n-1,k-1)*n!/k! + b(n-1, n-k)*n!/(n-k+1)! -n!, k=1..n), n=1..10); # _G. C. Greubel_, Nov 28 2019

%t T[n_, k_]:= Binomial[n-1, k-1]*n!/k! +Binomial[n-1,n-k]*n!/(n-k+1)! -n!; Table[T[n, m], {n,10}, {k,n}]//Flatten (* modified by _G. C. Greubel_, Nov 28 2019 *)

%o (PARI) T(n, k) = binomial(n-1,k-1)*n!/k! + binomial(n-1, n-k)*n!/(n-k+1)! - n!; \\ _G. C. Greubel_, Nov 28 2019

%o (Magma) F:=Factorial; B:=Binomial; [B(n-1,k-1)*F(n)/F(k) + B(n-1,n-k)*F(n)/F(n - k+1) - F(n): k in [1..n], n in [1..10]]; // _G. C. Greubel_, Nov 28 2019

%o (Sage) f=factorial; b=binomial; [[b(n-1,k-1)*f(n)/f(k) + b(n-1,n-k)*f(n)/f(n - k+1) - f(n) for k in (1..n)] for n in (1..10)] # _G. C. Greubel_, Nov 28 2019

%o (GAP) F:=Factorial;; B:=Binomial;; Flat(List([1..10], n-> List([1..n], k->

%o B(n-1,k-1)*F(n)/F(k) + B(n-1,n-k)*F(n)/F(n - k+1) - F(n) ))); # _G. C. Greubel_, Nov 28 2019

%K sign,tabl

%O 1,5

%A _Roger L. Bagula_, Apr 05 2010