login
A173076
Triangle T(n, k, q) = binomial(n, k) - 1 + q^(floor(n/2))*binomial(n-2, k-1) with T(n, 0, q) = T(n, n, q) = 1 and q = 2, read by rows.
3
1, 1, 1, 1, 3, 1, 1, 4, 4, 1, 1, 7, 13, 7, 1, 1, 8, 21, 21, 8, 1, 1, 13, 46, 67, 46, 13, 1, 1, 14, 60, 114, 114, 60, 14, 1, 1, 23, 123, 295, 389, 295, 123, 23, 1, 1, 24, 147, 419, 685, 685, 419, 147, 24, 1, 1, 41, 300, 1015, 2001, 2491, 2001, 1015, 300, 41, 1
OFFSET
0,5
FORMULA
T(n, k, q) = binomial(n, k) - 1 + q^floor(n/2)*binomial(n-2, k-1) with T(n, 0, q) = T(n, n, q) = 1 and q = 2.
EXAMPLE
Triangle begins as:
1;
1, 1;
1, 3, 1;
1, 4, 4, 1;
1, 7, 13, 7, 1;
1, 8, 21, 21, 8, 1;
1, 13, 46, 67, 46, 13, 1;
1, 14, 60, 114, 114, 60, 14, 1;
1, 23, 123, 295, 389, 295, 123, 23, 1;
1, 24, 147, 419, 685, 685, 419, 147, 24, 1;
1, 41, 300, 1015, 2001, 2491, 2001, 1015, 300, 41, 1;
MATHEMATICA
T[n_, k_, q_]:= If[k==0 || k==n, 1, Binomial[n, k] - 1 + q^(Floor[n/2])*Binomial[n-2, k-1]];
Table[T[n, k, 2], {n, 0, 10}, {k, 0, n}]//Flatten
PROG
(Magma)
T:= func< n, k, q | k eq 0 or k eq n select 1 else Binomial(n, k) + q^(Floor(n/2))*Binomial(n-2, k-1) -1 >;
[T(n, k, 2): k in [0..n], n in [0..12]]; // G. C. Greubel, Jul 09 2021
(Sage)
def T(n, k, q): return 1 if (k==0 or k==n) else binomial(n, k) + q^(n//2)*binomial(n-2, k-1) -1
flatten([[T(n, k, 1) for k in (0..n)] for n in (0..12)])
CROSSREFS
Cf. A132044 (q=0), A173075 (q=1), this sequence (q=2), A173077 (q=3).
Sequence in context: A174032 A180979 A102716 * A134510 A335322 A171145
KEYWORD
nonn,tabl
AUTHOR
Roger L. Bagula, Feb 09 2010
EXTENSIONS
Edited by G. C. Greubel, Jul 09 2021
STATUS
approved