[go: up one dir, main page]

login
A028262
Elements in 3-Pascal triangle (by row).
22
1, 1, 1, 1, 3, 1, 1, 4, 4, 1, 1, 5, 8, 5, 1, 1, 6, 13, 13, 6, 1, 1, 7, 19, 26, 19, 7, 1, 1, 8, 26, 45, 45, 26, 8, 1, 1, 9, 34, 71, 90, 71, 34, 9, 1, 1, 10, 43, 105, 161, 161, 105, 43, 10, 1, 1, 11, 53, 148, 266, 322, 266, 148, 53, 11, 1, 1, 12, 64, 201, 414, 588, 588, 414, 201, 64, 12, 1
OFFSET
0,5
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)
T(n+2,k+1) = A007318(n,k) - A007318(n+2,k+1); 0 < k < n. - Reinhard Zumkeller, Aug 02 2012
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
nonn,nice,tabl
EXTENSIONS
More terms from James A. Sellers
STATUS
approved