login
Triangle T(n,k) (0<= k <=n) read by rows. Left edge is 1, 0, 0, ... Otherwise each entry is sum of entry to left, entries immediately above it to left and right and entry directly above it 2 rows back.
8

%I #10 Oct 11 2013 04:31:00

%S 1,0,1,0,2,3,0,2,8,11,0,2,14,36,47,0,2,20,78,172,219,0,2,26,138,424,

%T 862,1081,0,2,32,216,856,2314,4476,5557,0,2,38,312,1522,5116,12768,

%U 23882,29439,0,2,44,426,2476,9970,30168,71294,130172,159611,0,2,50,558

%N Triangle T(n,k) (0<= k <=n) read by rows. Left edge is 1, 0, 0, ... Otherwise each entry is sum of entry to left, entries immediately above it to left and right and entry directly above it 2 rows back.

%H Reinhard Zumkeller, <a href="/A059283/b059283.txt">Rows n = 0..120 of triangle, flattened</a>

%F 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

%F 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).

%e 1; 0,1; 0,2,3; 0,2,8,11; 0,2,14,36,47; ... [36 = 14 + 8 + 11 + 3 for example].

%t 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 *)

%o (Haskell)

%o a059283 n k = a059283_tabl !! n !! k

%o a059283_row n = a059283_tabl !! n

%o a059283_tabl = [1] : [0,1] : f [1] [0,1] where

%o f us vs = ws : f vs ws where

%o ws = scanl1 (+) $ zipWith (+)

%o ([0]++us++[0]) $ zipWith (+) ([0]++vs) (vs++[0])

%o -- _Reinhard Zumkeller_, Apr 17 2013

%Y Right edge is A059284. Cf. A059226.

%Y Cf. A224729 (central terms), A122542.

%K nonn,tabl,easy,nice

%O 0,5

%A _N. J. A. Sloane_, Jan 24 2001

%E More terms from Larry Reeves (larryr(AT)acm.org), Jan 25 2001