login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A146987
Triangle, read by rows, T(n, k) = binomial(n, k) for n < 2 and binomial(n, k) + 3^(n-1)*binomial(n-2, k -1) otherwise.
3
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, 1, 736, 3666, 7325, 7325, 3666, 736, 1, 1, 2195, 13150, 32861, 43810, 32861, 13150, 2195, 1, 1, 6570, 45963, 137865, 229761, 229761, 137865, 45963, 6570, 1
OFFSET
0,5
COMMENTS
Row sums are: {1, 2, 7, 26, 124, 680, 3952, 23456, 140224, 840320, 5039872}.
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
Cf. A028262.
Sequence in context: A174949 A174861 A110522 * A297915 A298508 A298328
KEYWORD
nonn,tabl
AUTHOR
Roger L. Bagula, Nov 04 2008
EXTENSIONS
Edited by G. C. Greubel, Jan 09 2020
STATUS
approved