OFFSET
0,2
COMMENTS
Reverse of A029618. - Philippe Deléham, Nov 21 2006
Triangle T(n,k), read by rows, given by (2,-1,0,0,0,0,0,0,0,...) DELTA (3,-2,0,0,0,0,0,0,0,...) where DELTA is the operator defined in A084938. - Philippe Deléham, Oct 10 2011
Row n: expansion of (2+3x)*(1+x)^(n-1), n>0. - Philippe Deléham, Oct 10 2011.
For a closed-form formula for generalized Pascal's triangle see A228576. - Boris Putievskiy, Sep 04 2013
For n>0, row sums = 5*2^(n-1). Generally, for all (a,b)-Pascal triangles, row sums are (a+b)*2^(n-1), n>0. - Bob Selcoe, Mar 28 2015
LINKS
Reinhard Zumkeller, Rows n=0..150 of triangle, flattened
FORMULA
T(n,k) = T(n-1,k-1) + T(n-1,k) with T(0,0)=1, T(n,0)=2, T(n,n)=3; n, k > 0. - Boris Putievskiy, Sep 04 2013
G.f.: (-1-2*x*y-x)/(-1+x*y+x). - R. J. Mathar, Aug 11 2015
EXAMPLE
First few rows are:
1;
2, 3;
2, 5, 3;
2, 7, 8, 3;
2, 9, 15, 11, 3;
...
MAPLE
T:= proc(n, k) option remember;
if k=0 and n=0 then 1
elif k=0 then 2
elif k=n then 3
else T(n-1, k-1) + T(n-1, k)
fi
end:
seq(seq(T(n, k), k=0..n), n=0..12); # G. C. Greubel, Nov 12 2019
MATHEMATICA
T[n_, k_]:= T[n, k]= If[n==0 && k==0, 1, If[k==0, 2, If[k==n, 3, T[n-1, k-1] + T[n-1, k] ]]]; Table[T[n, k], {n, 0, 12}, {k, 0, n}]//Flatten (* G. C. Greubel, Nov 12 2019 *)
PROG
(Haskell)
a029600 n k = a029600_tabl !! n !! k
a029600_row n = a029600_tabl !! n
a029600_tabl = [1] : iterate
(\row -> zipWith (+) ([0] ++ row) (row ++ [0])) [2, 3]
-- Reinhard Zumkeller, Apr 08 2012
(PARI) T(n, k) = if(n==0 && k==0, 1, if(k==0, 2, if(k==n, 3, T(n-1, k-1) + T(n-1, k) ))); \\ G. C. Greubel, Nov 12 2019
(Sage)
@CachedFunction
def T(n, k):
if (n==0 and k==0): return 1
elif (k==0): return 2
elif (k==n): return 3
else: return T(n-1, k-1) + T(n-1, k)
[[T(n, k) for k in (0..n)] for n in (0..12)] # G. C. Greubel, Nov 12 2019
(GAP)
T:= function(n, k)
if n=0 and k=0 then return 1;
elif k=0 then return 2;
elif k=n then return 3;
else return T(n-1, k-1) + T(n-1, k);
fi;
end;
Flat(List([0..12], n-> List([0..n], k-> T(n, k) ))); # G. C. Greubel, Nov 12 2019
CROSSREFS
KEYWORD
AUTHOR
EXTENSIONS
More terms from James A. Sellers
STATUS
approved