%I #22 Sep 08 2022 08:45:52
%S 1,1,1,1,5,1,1,21,13,1,1,85,125,29,1,1,341,1085,589,61,1,1,1365,9021,
%T 10509,2541,125,1,1,5461,73533,177165,91821,10541,253,1,1,21845,
%U 593725,2908173,3115437,766445,42925,509,1,1,87381,4771645,47124493,102602157,52167917,6260845,173229,1021,1
%N Triangle read by rows, T(n, 1) = 1 and T(n,k) = q^k*T(n-1, k) + T(n-1, k-1) for 2 <= k <= n, n >= 1, with q=2.
%C Row sums are: {1, 2, 7, 36, 241, 2078, 23563, 358776, 7449061, 213188690, ...}.
%D Steve Roman, The Umbral Calculus, Dover Publications, New York (1984), page 176
%H G. C. Greubel, <a href="/A176242/b176242.txt">Rows n = 1..100 of triangle, flattened</a>
%F T(n,k) = T(n-1, k-1) + q^k*T(n-1, k), with q=2.
%e Triangle begins as:
%e 1;
%e 1, 1;
%e 1, 5, 1;
%e 1, 21, 13, 1;
%e 1, 85, 125, 29, 1;
%e 1, 341, 1085, 589, 61, 1;
%e 1, 1365, 9021, 10509, 2541, 125, 1;
%e 1, 5461, 73533, 177165, 91821, 10541, 253, 1;
%e 1, 21845, 593725, 2908173, 3115437, 766445, 42925, 509, 1;
%p T:= proc(n, k) option remember;
%p q:=2;
%p if k=1 or k=n then 1
%p else T(n-1, k-1) + q^k*T(n-1, k)
%p fi; end:
%p seq(seq(T(n, k), k=1..n), n=1..12); # _G. C. Greubel_, Nov 22 2019
%t q:=2; T[n_, k_]:= T[n, k]= If[k==1 || k==n, 1, q^k*T[n-1, k] + T[n-1, k-1]]; Table[T[n, k], {n,12}, {k,n}]//Flatten (* modified by _G. C. Greubel_, Nov 22 2019 *)
%o (PARI) T(n,k) = my(q=2); if(k==1 || k==n, 1, q^k*T(n-1,k) + T(n-1,k-1)); \\ _G. C. Greubel_, Nov 22 2019
%o (Magma)
%o function T(n,k)
%o q:=2;
%o if k eq 1 or k eq n then return 1;
%o else return T(n-1,k-1) + q^k*T(n-1,k);
%o end if; return T; end function;
%o [T(n,k): k in [1..n], n in [1..12]]; // _G. C. Greubel_, Nov 22 2019
%o (Sage)
%o @CachedFunction
%o def T(n, k):
%o q=2;
%o if (k==1 or k==n): return 1
%o else: return q^k*T(n-1, k) + T(n-1, k-1)
%o [[T(n, k) for k in (1..n)] for n in (1..12)] # _G. C. Greubel_, Nov 22 2019
%Y Cf. this sequence (q=2), A176243 (q=3), A176244 (q=4).
%K nonn,tabl,easy
%O 1,5
%A _Roger L. Bagula_, Apr 12 2010
%E Edited by _G. C. Greubel_, Nov 22 2019
%E Definition clarified by _Georg Fischer_, Nov 12 2021