login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo

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 56th year, we are closing in on 350,000 sequences, and we’ve crossed 9,700 citations (which often say “discovered thanks to the OEIS”).

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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 (list; table; graph; refs; listen; history; text; internal format)
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

Cf. A028262.

Sequence in context: A174949 A174861 A110522 * A297915 A298508 A298328

Adjacent sequences:  A146984 A146985 A146986 * A146988 A146989 A146990

KEYWORD

nonn,tabl

AUTHOR

Roger L. Bagula, Nov 04 2008

EXTENSIONS

Edited by G. C. Greubel, Jan 09 2020

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified December 2 07:16 EST 2021. Contains 349437 sequences. (Running on oeis4.)