login
Triangle read by rows: T(n, k) = 2^k - binomial(n, k+1) + 2^(n-k) - binomial(n, n-k+1).
1

%I #6 Sep 08 2022 08:45:41

%S 2,2,2,3,2,3,6,2,2,6,13,3,0,3,13,28,7,-3,-3,7,28,59,18,-6,-14,-6,18,

%T 59,122,44,-6,-32,-32,-6,44,122,249,101,4,-58,-80,-58,4,101,249,504,

%U 221,39,-90,-162,-162,-90,39,221,504,1015,468,130,-119,-292,-356,-292,-119,130,468,1015

%N Triangle read by rows: T(n, k) = 2^k - binomial(n, k+1) + 2^(n-k) - binomial(n, n-k+1).

%C Row sums are 2^(n+1): {2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, ...}.

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

%F T(n, k) = 2^k - binomial(n, k+1) + 2^(n-k) - binomial(n, n-k+1).

%e Triangle begins as:

%e 2;

%e 2, 2;

%e 3, 2, 3;

%e 6, 2, 2, 6;

%e 13, 3, 0, 3, 13;

%e 28, 7, -3, -3, 7, 28;

%e 59, 18, -6, -14, -6, 18, 59;

%e 122, 44, -6, -32, -32, -6, 44, 122;

%e 249, 101, 4, -58, -80, -58, 4, 101, 249;

%e 504, 221, 39, -90, -162, -162, -90, 39, 221, 504;

%e 1015, 468, 130, -119, -292, -356, -292, -119, 130, 468, 1015;

%p f(n,m):= 2^m - binomial(n, m+1); seq(seq( f(n,k) + f(n,n-k), k=0..n), n=0..10); # _G. C. Greubel_, Dec 01 2019

%t f[n_, m_]:= 2^m - Binomial[n, m+1]; T[n_,k_]:= f[n,k] + f[n,n-k]; Table[T[n, k], {n, 0, 10}, {k, 0, n}]//Flatten

%o (PARI) T(n,k) = my(f(n,m)=2^m - binomial(n, m+1)); f(n,k) + f(n,n-k); \\ _G. C. Greubel_, Dec 01 2019

%o (Magma)

%o f:= func< n, m | 2^m - Binomial(n, m+1) >;

%o [f(n,k)+f(n,n-k): k in [0..n], n in [0..10]]; // _G. C. Greubel_, Dec 01 2019

%o (Sage)

%o def f(n,m): return 2^m - binomial(n, m+1)

%o def T(n,k): return f(n,k) + f(n,n-k)

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

%o (GAP) Flat(List([0..10], n-> List([0..n], k-> 2^k - Binomial(n,k+1) + 2^(n-k) - Binomial(n,n-k+1) ))); # _G. C. Greubel_, Dec 01 2019

%K sign,tabl

%O 0,1

%A _Roger L. Bagula_, Feb 17 2009