[go: up one dir, main page]

login
Triangle generated by T(n,k) = q^k*T(n-1, k) + T(n-1, k-1), with q=3.
3

%I #15 Jun 10 2023 17:55:11

%S 1,1,1,1,10,1,1,91,37,1,1,820,1090,118,1,1,7381,30250,10648,361,1,1,

%T 66430,824131,892738,98371,1090,1,1,597871,22317967,73135909,24796891,

%U 892981,3277,1,1,5380840,603182980,5946326596,6098780422,675780040,8059780,9838,1

%N Triangle generated by T(n,k) = q^k*T(n-1, k) + T(n-1, k-1), with q=3.

%C Row sums are: {1, 2, 12, 130, 2030, 48642, 1882762, 121744898, 13337520498, 2503662940162, ...}.

%D Steve Roman, The Umbral Calculus, Dover Publications, New York (1984), page 176

%H G. C. Greubel, <a href="/A176243/b176243.txt">Rows n = 1..75 of triangle, flattened</a>

%F T(n,k) = T(n-1, k-1) + q^k*T(n-1, k), with q=3.

%e Triangle begins as:

%e 1;

%e 1, 1;

%e 1, 10, 1;

%e 1, 91, 37, 1;

%e 1, 820, 1090, 118, 1;

%e 1, 7381, 30250, 10648, 361, 1;

%e 1, 66430, 824131, 892738, 98371, 1090, 1;

%e 1, 597871, 22317967, 73135909, 24796891, 892981, 3277, 1;

%p T:= proc(n, k) option remember;

%p q:=3;

%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:=3; 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=3); 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:=3;

%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=3;

%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. A176242 (q=2), this sequence (q=3), A176244 (q=4).

%K nonn,tabl

%O 1,5

%A _Roger L. Bagula_, Apr 12 2010

%E Edited by _G. C. Greubel_, Nov 22 2019