login
Triangle read by rows: T(n,k) = t(n-k, k); t(n,m) = f(m)*t(n-1,m) + f(n)*t(n,m-1), where f(x) = 2*x + 2.
13

%I #17 Mar 22 2022 03:11:27

%S 1,2,2,4,16,4,8,88,88,8,16,416,1056,416,16,32,1824,9664,9664,1824,32,

%T 64,7680,76224,154624,76224,7680,64,128,31616,549504,1999232,1999232,

%U 549504,31616,128,256,128512,3739648,22587904,39984640,22587904,3739648,128512,256

%N Triangle read by rows: T(n,k) = t(n-k, k); t(n,m) = f(m)*t(n-1,m) + f(n)*t(n,m-1), where f(x) = 2*x + 2.

%H G. C. Greubel, <a href="/A257609/b257609.txt">Rows n = 0..50 of the triangle, flattened</a>

%F T(n,k) = t(n-k, k); t(0,0) = 1, t(n,m) = 0 if n < 0 or m < 0, else t(n,m) = f(m)*t(n-1,m) + f(n)*t(n,m-1), where f(x) = 2*x + 2.

%F Sum_{k=0..n} T(n, k) = A002866(n).

%F From _G. C. Greubel_, Mar 21 2022: (Start)

%F T(n, k) = (a*k + b)*T(n-1, k) + (a*(n-k) + b)*T(n-1, k-1), with T(n, 0) = 1, a = 2, and b = 2.

%F T(n, n-k) = T(n, k).

%F T(n, 0) = A000079(n).

%F T(n, 1) = 2*A100575(n+1). (End)

%e Triangle begins as:

%e 1;

%e 2, 2;

%e 4, 16, 4;

%e 8, 88, 88, 8;

%e 16, 416, 1056, 416, 16;

%e 32, 1824, 9664, 9664, 1824, 32;

%e 64, 7680, 76224, 154624, 76224, 7680, 64;

%e 128, 31616, 549504, 1999232, 1999232, 549504, 31616, 128;

%e 256, 128512, 3739648, 22587904, 39984640, 22587904, 3739648, 128512, 256;

%t T[n_, k_, a_, b_]:= T[n, k, a, b]= If[k<0 || k>n, 0, If[n==0, 1, (a*(n-k)+b)*T[n-1, k-1, a, b] + (a*k+b)*T[n-1, k, a, b]]];

%t Table[T[n,k,2,2], {n,0,12}, {k,0,n}]//Flatten (* _G. C. Greubel_, Mar 21 2022 *)

%o (Magma)

%o function T(n,k,a,b)

%o if k lt 0 or k gt n then return 0;

%o elif k eq 0 or k eq n then return 1;

%o else return (a*k+b)*T(n-1,k,a,b) + (a*(n-k)+b)*T(n-1,k-1,a,b);

%o end if; return T;

%o end function;

%o [T(n,k,2,2): k in [0..n], n in [0..12]]; // _G. C. Greubel_, Mar 21 2022

%o (Sage)

%o def T(n,k,a,b): # A257609

%o if (k<0 or k>n): return 0

%o elif (n==0): return 1

%o else: return (a*k+b)*T(n-1,k,a,b) + (a*(n-k)+b)*T(n-1,k-1,a,b)

%o flatten([[T(n,k,2,2) for k in (0..n)] for n in (0..12)]) # _G. C. Greubel_, Mar 21 2022

%Y Cf. A000079, A002866 (row sums), A060187, A100575, A257611, A257613, A257615.

%Y Cf. A038208, A256890, A257610, A257612, A257614, A257616, A257617, A257618, A257619.

%Y Cf. similar sequences listed in A256890.

%K nonn,tabl

%O 0,2

%A _Dale Gerdemann_, May 03 2015