A247310 Rectangular array read upwards by columns: T = T(n,k) = number of paths from (0,1) to (n,k), where 0 <= k <= 2, consisting of segments given by the vectors (1,1), (1,2), (1,-1), (1,-2), where no segment is followed by a segment in the same direction.
1, 0, 0, 0, 1, 1, 2, 1, 0, 0, 2, 3, 5, 3, 0, 0, 5, 8, 13, 8, 0, 0, 13, 21, 34, 21, 0, 0, 34, 55, 89, 55, 0, 0, 89, 144, 233, 144, 0, 0, 233, 377, 610, 377, 0, 0, 610, 987, 1597, 987, 0, 0, 1597, 2584, 4181, 2584, 0, 0, 4181, 6765, 10946, 6765, 0, 0, 10946
Offset: 0
Examples
First 10 columns: 0 .. 1 .. 0 .. 3 .. 0 .. 8 .. 0 ... 21 .. 0 ... 55 0 .. 1 .. 1 .. 2 .. 3 .. 5 .. 8 ... 13 .. 21 .. 34 1 .. 0 .. 2 .. 0 .. 5 .. 0 .. 13 .. 0 ... 34 .. 0 T(3,2) counts these 3 paths, given as vector sums applied to (0,0): (1,2) + (1,-1) + (1,1); (1,1) + (1,-1) + (1,2); (1,2) + (1,-2) + (1,2).
Links
- Clark Kimberling, Table of n, a(n) for n = 0..1000
Programs
-
Mathematica
t[0, 0] = 1; t[0, 1] = 0; t[0, 2] = 0; t[1, 0] = 0; t[1, 1] = 1; t[1, 2] = 1; t[2, 0] = 2; t[2, 1] = 1; t[2, 2] = 0; t[n_, 0] := If[OddQ[n], 0 , t[n - 1, 1] + t[n - 1, 2]] t[n_, 1] := If[OddQ[n], t[n - 1, 0] , t[n - 1, 2]] t[n_, 2] := If[OddQ[n], t[n - 1, 0] + t[n - 1, 1], 0] TableForm[Reverse[Transpose[Table[t[n, k], {n, 0, 12}, {k, 0, 2}]]]] (* array *) u = Flatten[Table[t[n, k], {n, 0, 25}, {k, 0, 2}]] (* A247310 *)
Formula
Let F = A000045 (Fibonacci numbers); then
(row 0, the bottom row): F(1), 0 , F(3), 0 , F(5), 0, ...
(row 1, the middle row): F(0), F(1), F(2), F(3), F(4), F(5), ...
(row 2, the top row): 0, F(2), 0, F(4), 0, F(6) , 0, ...
Comments