OFFSET
0,5
COMMENTS
Row sums are: {1, 2, 7, 26, 124, 680, 3952, 23456, 140224, 840320, 5039872}.
LINKS
G. C. Greubel, Rows n = 0..100 of triangle, flattened
FORMULA
T(n, k) = binomial(n, k) for n < 2 and binomial(n, k) + 3^(n-1)*binomial(n-2, k -1) otherwise.
EXAMPLE
Triangle begins as:
1;
1, 1;
1, 5, 1;
1, 12, 12, 1;
1, 31, 60, 31, 1;
1, 86, 253, 253, 86, 1;
1, 249, 987, 1478, 987, 249, 1;
MAPLE
q:=3; seq(seq( `if`(n<2, binomial(n, k), binomial(n, k) + q^(n-1)*binomial(n-2, k-1)), k=0..n), n=0..10); # G. C. Greubel, Jan 09 2020
MATHEMATICA
Table[If[n<2, Binomial[n, m], Binomial[n, m] + 3^(n-1)*Binomial[n-2, m-1]], {n, 0, 10}, {m, 0, n}]//Flatten
PROG
(PARI) T(n, k) = if(n<2, binomial(n, k), binomial(n, k) + 3^(n-1)*binomial(n-2, k-1) ); \\ G. C. Greubel, Jan 09 2020
(Magma) T:= func< n, k, q | n lt 2 select Binomial(n, k) else Binomial(n, k) + q^(n-1)*Binomial(n-2, k-1) >;
[T(n, k, 3): k in [0..n], n in [0..10]]; // G. C. Greubel, Jan 09 2020
(Sage)
@CachedFunction
def T(n, k, q):
if (n<2): return binomial(n, k)
else: return binomial(n, k) + q^(n-1)*binomial(n-2, k-1)
[[T(n, k, 3) for k in (0..n)] for n in (0..10)] # G. C. Greubel, Jan 09 2020
(GAP)
T:= function(n, k, q)
if n<2 then return Binomial(n, k);
else return Binomial(n, k) + q^(n-1)*Binomial(n-2, k-1);
fi; end; Flat(List([0..10], n-> List([0..n], k-> T(n, k, 3) ))); # G. C. Greubel, Jan 09 2020
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Roger L. Bagula, Nov 04 2008
EXTENSIONS
Edited by G. C. Greubel, Jan 09 2020
STATUS
approved