OFFSET
0,5
LINKS
Reinhard Zumkeller, Rows n = 0..120 of triangle, flattened
FORMULA
T(0, 0)=1; T(n, 0)=0, n>0; T(n, k)=T(n, k-1)+T(n-1, k-1)+T(n-1, k)+T(n-2, k-1), n, k>0
G.f. for T(n, k): ((1+2*w+w^2)*z^2+(-1-2*w-w^2)*z-w*(-3*w^2-6*w+1)^(1/2)+2*w)/(1+w)^2/((1+w)*z^2+(w-1)*z+w) (expand first as series in z, then in w).
EXAMPLE
1; 0,1; 0,2,3; 0,2,8,11; 0,2,14,36,47; ... [36 = 14 + 8 + 11 + 3 for example].
MATHEMATICA
t[0, 0] = 1; t[_, 0] = 0; t[n_, k_] /; 0 <= k <= n := t[n, k] = t[n, k-1] + t[n-1, k-1] + t[n-1, k] + t[n-2, k-1]; t[_, _] = 0; Table[t[n, k], {n, 0, 10}, {k, 0, n}] // Flatten (* Jean-François Alcover, Oct 11 2013 *)
PROG
(Haskell)
a059283 n k = a059283_tabl !! n !! k
a059283_row n = a059283_tabl !! n
a059283_tabl = [1] : [0, 1] : f [1] [0, 1] where
f us vs = ws : f vs ws where
ws = scanl1 (+) $ zipWith (+)
([0]++us++[0]) $ zipWith (+) ([0]++vs) (vs++[0])
-- Reinhard Zumkeller, Apr 17 2013
CROSSREFS
KEYWORD
AUTHOR
N. J. A. Sloane, Jan 24 2001
EXTENSIONS
More terms from Larry Reeves (larryr(AT)acm.org), Jan 25 2001
STATUS
approved