cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-10 of 13 results. Next

A247321 Rectangular array read upwards by columns: T = T(n,k) = number of paths from (0,0) to (n,k), where 0 <= k <= 3, consisting of segments given by the vectors (1,1), (1,2), (1,-1).

Original entry on oeis.org

1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 2, 1, 2, 4, 2, 2, 5, 5, 6, 5, 7, 13, 10, 7, 18, 22, 20, 18, 29, 45, 40, 29, 63, 87, 74, 63, 116, 166, 150, 116, 229, 329, 282, 229, 445, 627, 558, 445, 856, 1232, 1072, 856, 1677, 2373, 2088, 1677, 3229, 4621, 4050, 3229
Offset: 0

Views

Author

Clark Kimberling, Sep 13 2014

Keywords

Comments

Also, T(n,k) = number of strings s(0)..s(n) of integers such that s(0) = 0, s(n) = k, 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.

Examples

			First 10 columns:
0 .. 0 .. 2 .. 2 .. 6 .. 10 .. 20 .. 40 .. 74 .. 150
0 .. 1 .. 1 .. 4 .. 5 .. 13 .. 22 .. 45 .. 87 .. 166
0 .. 1 .. 1 .. 2 .. 5 .. 7 ... 18 .. 29 .. 63 .. 116
1 .. 0 .. 1 .. 1 .. 2 .. 5 ... 7 ... 18 .. 29 .. 63
T(3,2) counts these 4 paths, given as vector sums applied to (0,0):
(1,2) + (1,1) + (1, -1)
(1,1) + (1,2) + (1,-1)
(1,2) + (1,-1) + (1,1)
(1,1) + (1,-1) + (1,2)
Partial sums of second components in each vector sum give the 3 integer strings described in Comments:  (0,2,3,2), (0,1,3,2), (0,2,1,2), (0,1,0,2).
		

Crossrefs

Programs

  • 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 *)
    Table[t[n, 0], {n, 0, z}]   (* A247323, row 0 *)
    Table[t[n, 1], {n, 0, z}]   (* A247323 shifted, row 1 *)
    Table[t[n, 2], {n, 0, z}]   (* A247325, row 2 *)
    Table[t[n, 3], {n, 0, z}]   (* A247326, row 3 *)

Formula

The four rows and the column sums all empirically satisfy the linear recurrence r(n) = 3*r(n-2) + 2*r(n-3) - r(n-4), with g.f. of the form p(x)/q(x), where q(x) = 1 - 3 x^2 - 2 x^3 + x^4. Initial terms and p(x) follow:
(row 0, the bottom row): 1,0,1,1; 1 - 2*x^2 - x^3
(row 1): 0,1,1,2; x + x^2 - x^3
(row 2): 0,1,1,4; x + x^2 + x^3
(row 3): 0,0,1,1; 2x^2 + 2x^3
(n-th column sum) = 1,2,5,9; 1 + 2*x + 2*x^2 + x^3.

A247322 Number of paths from (0,0) to the line x = n, each consisting of segments given by the vectors (1,1), (1,2), (1,-1), with vertices (i,k) satisfying 0 <= k <= 3.

Original entry on oeis.org

1, 2, 5, 9, 18, 35, 67, 132, 253, 495, 956, 1859, 3605, 6994, 13577, 26333, 51114, 99159, 192431, 373372, 724497, 1405819, 2727804, 5293079, 10270553, 19929026, 38670013, 75035105, 145597538, 282516315, 548192811, 1063708916, 2064013525, 4004996055
Offset: 0

Views

Author

Clark Kimberling, Sep 13 2014

Keywords

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.

Examples

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

Crossrefs

Programs

  • 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 *)

Formula

A247322(n) = A247323(n) + A247323(n+1) + A247325(n) + A247326(n).
Empirically, a(n) = 3*a(n-2) + 2*a(n-3) - a(n-4) and g.f. = (1 + 2*x + 2*x^2 + x^3)/(1 - 3 x^2 - 2 x^3 + x^4).

A247325 Number of paths from (0,0) to (n,2), with vertices (i,k) satisfying 0 <= k <= 3, consisting of segments given by the vectors (1,1), (1,2), (1,-1).

Original entry on oeis.org

0, 1, 1, 4, 5, 13, 22, 45, 87, 166, 329, 627, 1232, 2373, 4621, 8956, 17377, 33737, 65422, 127009, 246363, 478134, 927685, 1800119, 3492960, 6777593, 13151433, 25518580, 49516525, 96081013, 186435302, 361757509, 701951407, 1362062118, 2642933937, 5128331659
Offset: 0

Views

Author

Clark Kimberling, Sep 13 2014

Keywords

Comments

Also, a(n) = number of strings s(0)..s(n) of integers such that s(0) = 0, s(n) = 2, 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) = row 2 of the array at A247321.

Examples

			a(4) counts these 4 paths, each represented by a vector sum applied to (0,0):
(1,2) + (1,1) + (1,-1);
(1,1) + (1,2) + (1,-1);
(1,2) + (1,-1) + (1,1);
(1,1) + (1,-1) + (1,2).
		

Crossrefs

Programs

  • 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];
    Table[t[n, 2], {n, 0, z}];  (* A247325 *)

Formula

Empirically, a(n) = 3*a(n-2) + 2*a(n-3) - a(n-4) and g.f. = (x + x^2 + x^3)/(1 - 3 x^2 - 2 x^3 + x^4).

A247326 Number of paths from (0,0) to (n,3), with vertices (i,k) satisfying 0 <= k <= 3, consisting of segments given by the vectors (1,1), (1,2), (1,-1).

Original entry on oeis.org

0, 0, 2, 2, 6, 10, 20, 40, 74, 150, 282, 558, 1072, 2088, 4050, 7850, 15254, 29562, 57412, 111344, 216106, 419294, 813594, 1578750, 3063264, 5944144, 11533698, 22380210, 43426118, 84263882, 163505076, 317263672, 615616874, 1194537286, 2317872890, 4497581934
Offset: 0

Views

Author

Clark Kimberling, Sep 13 2014

Keywords

Comments

Also, a(n) = number of strings s(0)..s(n) of integers such that s(0) = 0, s(n) = 3, 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) = row 3 of the array at A247321.

Examples

			a(4) counts these 6 paths, each represented by a vector sum applied to (0,0):
(1,2) + (1,1) + (1,-1) + (1,1);
(1,1) + (1,2) + (1,-1) + (1,1);
(1,2) + (1,-1) + (1,1) + (1,1);
(1,1) + (1,-1) + (1,2) + (1,1);
(1,1) + (1,-1) + (1,1) + (1,2);
(1,1) + (1,1) + (1,-1) + (1,2).
		

Crossrefs

Programs

  • 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];
    Table[t[n, 3], {n, 0, z}];  (* A247326 *)

Formula

Empirically, a(n) = 3*a(n-2) + 2*a(n-3) - a(n-4) and g.f. = (2*x^2 + x^3)/(1 - 3 x^2 - 2 x^3 + x^4).

A247050 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).

Original entry on oeis.org

0, 1, 0, 1, 0, 1, 0, 2, 1, 2, 1, 2, 1, 4, 3, 4, 4, 5, 4, 9, 8, 9, 12, 13, 12, 22, 21, 22, 33, 34, 33, 56, 55, 56, 88, 89, 88, 145, 144, 145, 232, 233, 232, 378, 377, 378, 609, 610, 609, 988, 987, 988, 1596, 1597, 1596, 2585, 2584, 2585, 4180, 4181, 4180
Offset: 0

Views

Author

Clark Kimberling, Sep 11 2014

Keywords

Comments

Also, T(n,k) = number of strings s(0)..s(n) of integers such that s(0) = 1, s(n) = k, and if i > 0, then s(i) is in {0,1,2} and s(i) - s(i-1) is in {1,2,-1}. The column sums form the Fibonacci sequence (A000045).
This is a 3-rowed array read upwards by columns. - N. J. A. Sloane, Sep 14 2014

Examples

			First 10 columns:
0 .. 1 .. 1 .. 2 .. 3 .. 5 .. 8 .. 13 .. 21 .. 34
1 .. 0 .. 2 .. 1 .. 4 .. 4 .. 9 .. 12 .. 22 .. 33
0 .. 1 .. 0 .. 2 .. 1 .. 4 .. 4 .. 9 ... 12 .. 22
T(4,1) counts these 4 paths, given as vector sums applied to (0,1):
(1,1) + (1,-1) + (1,1) + (1,-1);
(1,-1) + (1,1) + (1,1) + (1,-1);
(1,1) + (1,-1) + (1,-1) + (1,1);
(1,-1) + (1,1) + (1,-1) + (1,1)
Partial sums of second components in each vector sum give the 4 integer strings described in Comments: (1,2,1,2,1), (1,0,1,2,1), (1,2,1,0,1), (1,0,1,0,1).
		

Crossrefs

Programs

  • Mathematica
    t[0, 0] = 0; t[0, 1] = 1; t[0, 2] = 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]; TableForm[ Reverse[Transpose[Table[t[n, k], {n, 0, 12}, {k, 0, 2}]]]] (* array *)
    u = Flatten[Table[t[n, k], {n, 0, 20}, {k, 0, 2}]] (* sequence *)

Formula

Let F = A000045, the Fibonacci numbers. Then (row 0, the bottom row) = F(n-1) - (-1)^n for n >= 0; (row 1, the middle row) = F(n) + (-1)^n for n >=0; (row 2, the top row) = F.
Conjectures from Chai Wah Wu, Apr 16 2025: (Start)
a(n) = 2*a(n-6) + a(n-9) for n > 8.
G.f.: (-x^8 - x^5 - x^3 - x)/(x^9 + 2*x^6 - 1). (End)

A247309 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,0), (1,-1), (1,-2).

Original entry on oeis.org

1, 0, 0, 1, 1, 1, 2, 3, 3, 5, 8, 8, 13, 21, 21, 34, 55, 55, 89, 144, 144, 233, 377, 377, 610, 987, 987, 1597, 2584, 2584, 4181, 6765, 6765, 10946, 17711, 17711, 28657, 46368, 46368, 75025, 121393, 121393, 196418, 317811, 317811, 514229, 832040, 832040
Offset: 0

Views

Author

Clark Kimberling, Sep 12 2014

Keywords

Comments

Every member of T is a Fibonacci number, and the sum of the numbers in column n is A000045(2n+2).

Examples

			First 10 columns:
0 .. 1 .. 3 .. 8 .. 21 .. 55 .. 144 .. 377 .. 987 ... 2584
0 .. 1 .. 3 .. 8 .. 21 .. 55 .. 144 .. 377 .. 987 ... 2584
1 .. 1 .. 2 .. 5 .. 13 .. 34 .. 89 ... 233 .. 610 ... 1597
T(2,2) counts these 3 paths, given as vector sums applied to (0,0):
(1,2) + (1,0); (1,1) + (1,1); (1,0) + (1,2).
		

Crossrefs

Programs

  • Mathematica
    t[0, 0] = 1; t[0, 1] = 0; t[0, 2] = 0; t[1, 2] = 1;
    t[n_, 0] := t[n, 0] = t[n - 1, 0] + t[n - 1, 1];
    t[n_, 1] := t[n, 1] = t[n - 1, 0] + t[n - 1, 1] + t[n - 1, 2];
    t[n_, 2] := t[n, 2] = t[n - 1, 0] + t[n - 1, 1] + t[n - 1, 2]
    TableForm[Reverse[Transpose[Table[t[n, k], {n, 0, 12}, {k, 0, 2}]]]] (*  array *)
    Flatten[Table[t[n, k], {n, 0, 20}, {k, 0, 2}]] (*  A247309 *)

Formula

Let F = A000045 (Fibonacci numbers); then
(row 0, the bottom row) = (F(2n)), n >= 0;
(row 1, the middle row) = (F(2n)), n >= 0;
(row 2, the top row) = (F(2n-1)), n >= 0.
(n-th column sum) = (F(2n+2)), n >= 0.

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.

Original entry on oeis.org

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

Views

Author

Clark Kimberling, Sep 12 2014

Keywords

Comments

Also, T(n,k) = number of strings s(0)..s(n) of integers such that s(0) = 0, s(n) = k, s(i) is in {0,1,2} for i = 0..n, and for i > 0, s(i) - s(i-1) is in {1,2} if i is odd, and s(i) - s(i-1) is in {-1,-2} if i is even. Every row of T consists of Fibonacci numbers, and (sum of numbers in column n) = A000045(n+1).

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

Crossrefs

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, ...

A247352 Rectangular array read by upwards by columns: T = T(n,k) = number of paths from (0,1) to (n,k), where 0 <= k <= 3, consisting of segments given by the vectors (1,1), (1,2), (1,-1).

Original entry on oeis.org

0, 1, 0, 0, 1, 0, 1, 1, 0, 2, 2, 1, 2, 2, 3, 4, 2, 5, 8, 5, 5, 10, 12, 13, 10, 17, 28, 22, 17, 38, 49, 45, 38, 66, 100, 87, 66, 138, 191, 166, 138, 257, 370, 329, 257, 508, 724, 627, 508, 981, 1392, 1232, 981, 1900, 2721, 2373, 1900, 3702, 5254, 4621, 3702
Offset: 0

Views

Author

Clark Kimberling, Sep 15 2014

Keywords

Comments

Also, T(n,k) = number of strings s(0)..s(n) of integers such that s(0) = 1, s(n) = k, 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.

Examples

			First 10 columns:
0 .. 1 .. 1 .. 4 .. 5 .. 13 .. 22 .. 45 .. 87 ... 166
0 .. 1 .. 2 .. 3 .. 8 .. 12 .. 28 .. 49 .. 100 .. 191
1 .. 0 .. 2 .. 2 .. 5 .. 10 .. 17 .. 38 .. 66 ... 138
0 .. 1 .. 0 .. 2 .. 2 .. 5 ... 10 .. 17 .. 38 ... 66
T(5,0) counts these 5 paths, given as vector sums applied to (0,1):
(1,1) + (1,1) + (1,-1) + (1,-1) + (1 -1)
(1,1) + (1,-1) + (1,1) + (1,-1) + (1,-1)
(1,-1) + (1,1) + (1,1) + (1,-1) + (1,-1)
(1,1) + (1,-1) + (1,-1) + (1,1) + (1,-1)
(1,-1) + (1,1) + (1,-1) + (1,1) + (1,-1)
Partial sums of second components in each vector sum give the 3 integer strings described in comments:
(1,2,3,2,1,0),
(1,2,1,2,1,0),
(1,0,1,2,1,0),
(1,2,1,0,1,0),
(1,0,1,0,1,0).
		

Crossrefs

Programs

  • Mathematica
    z = 50; t[0, 0] = 0; t[0, 1] = 1; t[0, 2] = 0; t[0, 3] = 0;
    t[1, 3] = 1; 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}]] (* A247352 *)
    TableForm[Reverse[Transpose[Table[t[n, k], {n, 0, 12}, {k, 0, 3}]]]] (* array  *)
    v = Map[Total, u1]  (* A247353 *)
    Table[t[n, 0], {n, 0, z}]   (* row 0, A247354*)
    Table[t[n, 1], {n, 0, z}]   (* row 1, cf. row 0 *)
    Table[t[n, 2], {n, 0, z}]   (* row 2, A247355 *)
    Table[t[n, 3], {n, 0, z}]   (* row 3, A247325 *)

Formula

The four rows and column sums all empirically satisfy the linear recurrence r(n) = 3*r(n-2) + 2*r(n-3) - r(n-4), with g.f. of the form p(x)/q(x), where q(x) = 1 - 3 x^2 - 2 x^3 + x^4. Initial terms and p(x) follow:
(row 0, the bottom row): 0,1,0,2; x - x^3
(row 1): 1,0,0,2; 1 - x^2
(row 2): 0,1,2,3; x +2*x^2
(row 3): 0,1,1,4; x + x^2 + x^3
(n-th column sum) = 1,3,5,11; 1 + 3*x + 2*x^2.

A247323 Number of paths from (0,0) to (n,0), with vertices (i,k) satisfying 0 <= k <= 3, consisting of segments given by the vectors (1,1), (1,2), (1,-1).

Original entry on oeis.org

1, 0, 1, 1, 2, 5, 7, 18, 29, 63, 116, 229, 445, 856, 1677, 3229, 6298, 12185, 23675, 45922, 89097, 172931, 335460, 651065, 1263145, 2451184, 4756105, 9228777, 17907538, 34747357, 67424063, 130828370, 253859365, 492585879, 955810772, 1854647997, 3598744709
Offset: 0

Views

Author

Clark Kimberling, Sep 13 2014

Keywords

Comments

Also, a(n) = number of strings s(0)..s(n) of integers such that s(0) = 0, s(n) = 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) = row 0 (the bottom row) of the array at A247321, and a(n+1) = row 1 of the same array.

Examples

			a(5) counts these 5 paths, each represented by a vector sum applied to (0,0):
(1,2) + (1,1) + (1,-1) + (1,-1) + (1,-1);
(1,1) + (1,2) + (1,-1) + (1,-1) + (1,-1);
(1,2) + (1,-1) + (1,1) + (1,-1) + (1,-1);
(1,1) + (1,-1) + (1,2) + (1,-1) + (1,-1);
(1,2) + (1,-1) + (1,-1) + (1,1) + (1,-1).
		

Crossrefs

Programs

  • 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];
    Table[t[n, 0], {n, 0, z}];  (* A247323 *)

Formula

Empirically, a(n) = 3*a(n-2) + 2*a(n-3) - a(n-4) and g.f. = (1 + 2*x^2 - x^3)/(1 - 3 x^2 - 2 x^3 + x^4).

A247051 Rectangular array read upwards by columns: T = T(n,k) = number of paths from (0,2) to (n,k), where 0 <= k <= 2, consisting of segments given by the vectors (1,1), (1,2), (1,-1).

Original entry on oeis.org

0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 2, 1, 2, 1, 2, 1, 4, 3, 4, 4, 5, 4, 9, 8, 9, 12, 13, 12, 22, 21, 22, 33, 34, 33, 56, 55, 56, 88, 89, 88, 145, 144, 145, 232, 233, 232, 378, 377, 378, 609, 610, 609, 988, 987, 988, 1596, 1597, 1596, 2585, 2584, 2585, 4180, 4181
Offset: 0

Views

Author

Clark Kimberling, Sep 11 2014

Keywords

Comments

Also, T(n,k) = number of strings s(0)..s(n) of integers such that s(0) = 2, s(n) = k, and if i > 0, then s(i) is in {0,1,2} and s(i) - s(i-1) is in {1,2,-1}. The column sums form the Fibonacci sequence (A000045).
This is a 3-rowed array read upwards by columns. - N. J. A. Sloane, Sep 14 2014

Examples

			First 10 columns:
1 .. 0 .. 1 .. 1 .. 2 .. 3 .. 5 .. 8 .. 13 .. 21
0 .. 1 .. 0 .. 2 .. 1 .. 4 .. 4 .. 9 .. 12 .. 22
0 .. 0 .. 1 .. 0 .. 2 .. 1 .. 4 .. 4 .. 9 ... 12
T(3,1) counts these 2 paths, given as vector sums applied to (0,2): (1,-1) + (1,1) + (1,-1) and (1,-1) + (1,-1) + (1,1).
Partial sums of second components in each vector sum give the 2 integer strings described in Comments:  (2,1,2,1), (2,1,0,1).
		

Crossrefs

Programs

  • Mathematica
    t[0, 0] = 0; t[0, 1] = 0; t[0, 2] = 1; 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]; TableForm[ Reverse[Transpose[Table[t[n, k], {n, 0, 12}, {k, 0, 2}]]]]   (* array *)
    Flatten[Table[t[n, k], {n, 0, 20}, {k, 0, 2}]]   (* sequence *)

Formula

Let F = A000045, the Fibonacci numbers. Then (row 0, the bottom row) = F(n-2) + (-1)^n for n >= 1; (row 1, the middle row) = F(n-1) - (-1)^n for n >=0; (row 2, the top row) = F(n+1) for n >= 1.
Showing 1-10 of 13 results. Next