OFFSET
0,5
LINKS
Reinhard Zumkeller, Rows n = 0..150 of triangle, flattened
László Németh, Tetrahedron trinomial coefficient transform, Integers (2019) Vol. 19, Article A41.
FORMULA
After the 3rd row, use Pascal's rule.
From Ralf Stephan, Jan 31 2005: (Start)
T(n, k) = C(n, k) + C(n-2, k-1).
G.f.: (1 + x^2*y)/(1 - x*(1+y)). (End)
Sum_{k=0..n} T(n,k) = (n+1)*[n<2] + 5*2^(n-2)*[n>=2]. - G. C. Greubel, Apr 28 2021
EXAMPLE
Triangle begins:
1;
1 1;
1 3 1;
1 4 4 1;
1 5 8 5 1;
...
MATHEMATICA
T[n_, k_]:= If[n==1, 1, Binomial[n, k] + Binomial[n-2, k-1]]; Table[T[n, k], {n, 0, 11}, {k, 0, n}]//Flatten (* Jean-François Alcover, Jan 28 2015 *)
PROG
(Haskell)
a028262 n k = a028262_tabl !! n !! k
a028262_row n = a028262_tabl !! n
a028262_tabl = [1] : [1, 1] : iterate
(\row -> zipWith (+) ([0] ++ row) (row ++ [0])) [1, 3, 1]
-- Reinhard Zumkeller, Aug 02 2012
(Magma)
T:= func< n, k | n lt 2 select 1 else Binomial(n, k) + Binomial(n-2, k-1) >;
[T(n, k): k in [0..n], n in [0..12]]; # G. C. Greubel, Apr 28 2021
(Sage)
def T(n, k): return 1 if n<2 else binomial(n, k) + binomial(n-2, k-1)
flatten([[T(n, k) for k in (0..n)] for n in (0..12)]) # G. C. Greubel, Apr 28 2021
CROSSREFS
KEYWORD
AUTHOR
EXTENSIONS
More terms from James A. Sellers
STATUS
approved