login
Triangular array T read by rows: T(n,0) = T(n,n) = 1 for all n >= 0, T(n,k) = T(n-1,k-1) + T(n-1,k) for odd n and 1< = k <= n-1, T(n,k) = T(n-1,k-1) + T(n-1,k) + T(n-2,k-1) for even n and 1 <= k <= n-1.
18

%I #35 Jun 13 2019 04:15:02

%S 1,1,1,1,3,1,1,4,4,1,1,6,11,6,1,1,7,17,17,7,1,1,9,30,45,30,9,1,1,10,

%T 39,75,75,39,10,1,1,12,58,144,195,144,58,12,1,1,13,70,202,339,339,202,

%U 70,13,1,1,15,95,330,685,873,685,330,95,15,1

%N Triangular array T read by rows: T(n,0) = T(n,n) = 1 for all n >= 0, T(n,k) = T(n-1,k-1) + T(n-1,k) for odd n and 1< = k <= n-1, T(n,k) = T(n-1,k-1) + T(n-1,k) + T(n-2,k-1) for even n and 1 <= k <= n-1.

%C T(n,k) is number of lattice paths from (0,0) to (n,n-2k) using steps U=(1,1), D=(1,-1) and, at levels ...,-4,-2,0,2,4,..., also H=(2,0). Example: T(4,1)=6 because we have the following paths from (0,0) to (4,2): UUUD, UUH, UUDU, UDUU, HUU and DUUU. Row sums yield A026383. Column 1 is A032766, column 2 is A026381, column 3 is A026382. - _Emeric Deutsch_, Jan 25 2004

%H Reinhard Zumkeller, <a href="/A026374/b026374.txt">Rows n = 0..125 of triangle, flattened</a>

%H Paul Barry, <a href="https://cs.uwaterloo.ca/journals/JIS/VOL19/Barry/barry321.html">Jacobsthal Decompositions of Pascal's Triangle, Ternary Trees, and Alternating Sign Matrices</a>, Journal of Integer Sequences, 19, 2016, #16.3.5.

%F T(n, k) = number of integer strings s(0), ..., s(n) such that s(0)=0, s(n) = n-2k, where, for 1 <= i <= n, s(i) is even if i is even and |s(i) - s(i-1)| <= 1.

%F From _Emeric Deutsch_, Jan 25 2004: (Start)

%F T(2n, k) = Sum_{j=ceiling(k/2)..k} 3^(2j-k)*binomial(n, j)*binomial(j, k-j);

%F T(2n+1, k) = T(2n, k-1) + T(2n, k).

%F G.f.: (1 + z + t*z)/(1 - (1+3*t+t^2)*z^2) = 1 + (1+t)*z + (1+3*t+t^2)*z^2+ ... .

%F Generating polynomial for row 2n is (1 + 3*t + t^2)^n;

%F Generating polynomial for row 2n+1 it is (1+t)*(1 + 3*t + t^2)^n. (End)

%F From _Emeric Deutsch_, Jan 30 2004: (Start)

%F T(2n, k) = Sum_{j=ceiling(k/2)..k} 3^(2j-k)*binomial(n, j)*binomial(j, k-j);

%F T(2n+1, k) = T(2n, k-1) + T(2n, k). (End)

%e Triangle starts:

%e 1;

%e 1, 1;

%e 1, 3, 1;

%e 1, 4, 4, 1;

%e 1, 6, 11, 6, 1;

%e 1, 7, 17, 17, 7, 1;

%e 1, 9, 30, 45, 30, 9, 1;

%e 1, 10, 39, 75, 75, 39, 10, 1;

%e 1, 12, 58, 144, 195, 144, 58, 12, 1;

%e 1, 13, 70, 202, 339, 339, 202, 70, 13, 1;

%e 1, 15, 95, 330, 685, 873, 685, 330, 95, 15, 1;

%e 1, 16, 110, 425, 1015, 1558, 1558, 1015, 425, 110, 16, 1;

%e (End)

%t p[x, 1] := 1;

%t p[x_, n_] := p[x, n] = If[Mod[n, 2] == 0, (x + 1)*p[x, n - 1], (x^2 + 1)^Floor[n/2]];

%t a = Table[CoefficientList[p[x, n], x], {n, 1, 12}];

%t Flatten[a] (* _Roger L. Bagula_ and _Gary W. Adamson_, Dec 04 2009 *)

%o (Haskell)

%o a026374 n k = a026374_tabl !! n !! k

%o a026374_row n = a026374_tabl !! n

%o a026374_tabl = [1] : map fst (map snd $ iterate f (1, ([1, 1], [1]))) where

%o f (0, (us, vs)) = (1, (zipWith (+) ([0] ++ us) (us ++ [0]), us))

%o f (1, (us, vs)) = (0, (zipWith (+) ([0] ++ vs ++ [0]) $

%o zipWith (+) ([0] ++ us) (us ++ [0]), us))

%o -- _Reinhard Zumkeller_, Feb 22 2014

%Y Cf. A026383, A051159,A169623, A007318

%Y Cf. A026375 (central terms).

%K nonn,tabl

%O 0,5

%A _Clark Kimberling_