OFFSET
0,2
COMMENTS
Also, a(n) = number of strings s(0)..s(n) of integers such that s(0) = 0, and for i > 0, s(i) is in {0,1,2,3} and s(i) - s(i-1) is in {-1,1,2} for 1 <= i <= n; also, a(n) = n-th column sum of the array at A247321.
LINKS
Clark Kimberling, Table of n, a(n) for n = 0..1000
FORMULA
EXAMPLE
a(2) counts these 5 paths, each represented by a vector sum applied to (0,0): (0,2) + (0,1); (0,1) + (0,2); (0,1) + (0,1); (0,2) + (0,-1), (0,1) + (0,-1).
MATHEMATICA
z = 25; t[0, 0] = 1; t[0, 1] = 0; t[0, 2] = 0; t[0, 3] = 0;
t[1, 3] = 0; t[n_, 0] := t[n, 0] = t[n - 1, 1];
t[n_, 1] := t[n, 1] = t[n - 1, 0] + t[n - 1, 2];
t[n_, 2] := t[n, 2] = t[n - 1, 0] + t[n - 1, 1] + t[n - 1, 3];
t[n_, 3] := t[n, 3] = t[n - 1, 1] + t[n - 1, 2];
u = Flatten[Table[t[n, k], {n, 0, z}, {k, 0, 3}]] (* A247321 *)
TableForm[Reverse[Transpose[Table[t[n, k], {n, 0, 12}, {k, 0, 3}]]]]
u1 = Table[t[n, k], {n, 0, z}, {k, 0, 3}];
v = Map[Total, u1] (* A247322 column sums *)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Clark Kimberling, Sep 13 2014
STATUS
approved