OFFSET
0,5
LINKS
G. C. Greubel, Rows n = 0..50 of the triangle, flattened
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 = 3.
EXAMPLE
Triangle starts:
1;
1, 1;
1, 4, 1;
1, 5, 5, 1;
1, 12, 23, 12, 1;
1, 13, 36, 36, 13, 1;
1, 32, 122, 181, 122, 32, 1;
1, 33, 155, 304, 304, 155, 33, 1;
1, 88, 513, 1270, 1689, 1270, 513, 88, 1;
1, 89, 602, 1784, 2960, 2960, 1784, 602, 89, 1;
1, 252, 1988, 6923, 13817, 17261, 13817, 6923, 1988, 252, 1;
...
Row sums: 1, 2, 6, 12, 49, 100, 491, 986, 5433, 10872, 63223, ...
MATHEMATICA
T[n_, k_]:= If[k==0 || k==n, 1, Binomial[n, k] - 1 + 3^Floor[n/2] Binomial[n-2, k- 1]];
Table[T[n, k], {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, 3): 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, 3) for k in (0..n)] for n in (0..12)]) # G. C. Greubel, Jul 09 2021
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Roger L. Bagula, Feb 09 2010
STATUS
approved