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-5 of 5 results.

A162984 Number of Dyck paths with no UUU's and no DDD's of semilength n and having k UUDUDD's (0<=k<=floor(n/3); U=(1,1), D=(1,-1)).

Original entry on oeis.org

1, 1, 2, 3, 1, 6, 2, 12, 5, 25, 11, 1, 53, 26, 3, 114, 62, 9, 249, 148, 25, 1, 550, 355, 69, 4, 1227, 853, 189, 14, 2760, 2057, 509, 46, 1, 6253, 4973, 1359, 145, 5, 14256, 12050, 3600, 446, 20, 32682, 29256, 9484, 1334, 75, 1, 75293, 71154, 24870, 3914, 265, 6
Offset: 0

Views

Author

Emeric Deutsch, Oct 11 2009

Keywords

Comments

T(n,k) is the number of weighted lattice paths in B(n) having k peaks. The members of B(n) are paths of weight n that start at (0,0), end on but never go below the horizontal axis, and whose steps are of the following four kinds: an (1,0)-step with weight 1, an (1,0)-step with weight 2, a (1,1)-step with weight 2, and a (1,-1)-step with weight 1. The weight of a path is the sum of the weights of its steps. A peak is a (1,1)-step followed by a (1,-1)-step. Example: T(7,2)=3. Indeed, denoting by h (H) the (1,0)-step of weight 1 (2), and U=(1,1), D=(1,-1), we have hUDUD, UDhUD, and UDUDh.
Number of entries in row n is 1+floor(n/3).

Examples

			T(4,1) = 2 because we have UDUUDUDD and UUDUDDUD.
Triangle starts:
1;
1;
2;
3,   1;
6,   2;
12,  5;
25, 11, 1;
53, 26, 3;
		

Crossrefs

Programs

  • Maple
    G := ((1-z-z^2+z^3-t*z^3-sqrt(1-2*z-z^2-2*t*z^3-z^4-2*z^5+z^6+2*t*z^4+2*t*z^5-2*t*z^6+t^2*z^6))*1/2)/z^3: Gser := simplify(series(G, z = 0, 20)): for n from 0 to 16 do P[n] := sort(coeff(Gser, z, n)) end do: for n from 0 to 16 do seq(coeff(P[n], t, j), j = 0 .. floor((1/3)*n)) end do; # yields sequence in triangular form
    # second Maple program:
    b:= proc(x, y, t) option remember; `if`(y<0 or y>x or t=9, 0,
         `if`(x=0, 1, expand(b(x-1, y+1, [2, 3, 9, 5, 3, 2, 2, 2][t])+
         `if`(t=6, z, 1) *b(x-1, y-1, [8, 8, 4, 7, 6, 7, 9, 7][t]))))
        end:
    T:= n-> (p-> seq(coeff(p, z, i), i=0..degree(p)))(b(2*n, 0, 1)):
    seq(T(n), n=0..20);  # Alois P. Heinz, Jun 10 2014
  • Mathematica
    b[x_, y_, t_] := b[x, y, t] = If[y<0 || y>x || t == 9, 0, If[x == 0, 1, Expand[b[x-1, y+1, {2, 3, 9, 5, 3, 2, 2, 2}[[t]] ] + If[t == 6, z, 1]*b[x-1, y-1, {8, 8, 4, 7, 6, 7, 9, 7}[[t]] ]]]]; T[n_] := Function[{p}, Table[Coefficient[p, z, i], {i, 0, Exponent[p, z]}]][b[2*n, 0, 1]]; Table[T[n], {n, 0, 20}] // Flatten (* Jean-François Alcover, May 27 2015, after Alois P. Heinz *)

Formula

G.f.: G=G(t,z) satisfies G = 1 + zG + z^2*G + z^3*(G-1+t)G.
Sum of entries in row n = A004148(n+1).
T(n,0) = A162985(n).
Sum(k*T(n,k), k=0..floor(n/3)) = A110320(n-2).

A246179 Triangle read by rows: T(n,k) is the number of weighted lattice paths in B(n) having k returns to the horizontal axis (i.e., (1,-1)-steps ending on the horizontal axis). The members of B(n) are paths of weight n that start in (0,0), end on but never go below the horizontal axis, and whose steps are of the following four kinds: a (1,0)-step with weight 1; a (1,0)-step with weight 2; a (1,1)-step with weight 2; a (1,-1)-step with weight 1. The weight of a path is the sum of the weights of its steps.

Original entry on oeis.org

1, 1, 2, 3, 1, 5, 3, 8, 9, 13, 23, 1, 21, 56, 5, 34, 131, 20, 55, 300, 67, 1, 89, 678, 204, 7, 144, 1523, 581, 35, 233, 3416, 1580, 143, 1, 377, 7677, 4155, 517, 9, 610, 17329, 10663, 1716, 54, 987, 39353, 26880, 5352, 259, 1, 1597, 90000, 66891, 15924, 1079
Offset: 0

Views

Author

Emeric Deutsch, Aug 23 2014

Keywords

Comments

Number of entries in row n is 1+floor(n/3).
Sum of entries in row n is A004148(n+1) (the 2ndary structure numbers).
T(n,0)=A000045(n+1) (the Fibonacci numbers).

Examples

			Row 3 is 3,1. Indeed, denoting by h (H) the (1,0)-step of weight 1 (2), and u=(1,1), d=(1,-1), the four paths of weight 3 are: ud, hH, Hh, and hhh, having 1, 0, 0, and 0 returns to the horizontal axis, respectively.
Triangle starts:
1;
1;
2;
3,1;
5,3;
8,9;
13,23,1;
		

Crossrefs

Programs

  • Maple
    eq := g = 1+z*g+z^2*g+z^3*g^2: g := RootOf(eq, g): G := 1/(1-z-z^2-t*z^3*g): Gser := simplify(series(G, z = 0, 20)): for n from 0 to 18 do P[n] := sort(coeff(Gser, z, n)) end do: for n from 0 to 18 do seq(coeff(P[n], t, k), k = 0 .. floor((1/3)*n)) end do; # yields sequence in triangular form
    # second Maple program:
    b:= proc(n, y) option remember; `if`(y<0 or y>n, 0,
          `if`(n=0, 1, expand(b(n-1, y)+`if`(n>1, b(n-2, y)+
           b(n-2, y+1), 0) +b(n-1, y-1)*`if`(y=1, x, 1))))
        end:
    T:= n-> (p-> seq(coeff(p, x, i), i=0..degree(p)))(b(n, 0)):
    seq(T(n), n=0..20); # Alois P. Heinz, Aug 24 2014
  • Mathematica
    b[n_, y_] := b[n, y] = If[y<0 || y>n, 0, If[n==0, 1, Expand[b[n-1, y] + If[n>1, b[n-2, y] + b[n-2, y+1], 0] + b[n-1, y-1]*If[y==1, x, 1]]]]; T[n_] := Function[ {p}, Table[Coefficient[p, x, i], {i, 0, Exponent[p, x]}]][b[n, 0]]; Table[T[n], {n, 0, 20}] // Flatten (* Jean-François Alcover, Jun 29 2015, after Alois P. Heinz *)

Formula

G.f. G=G(t,z) satisfies G = 1 + z*G + z^2*G + t*z^3*g*G, where g=1+z*g+z^2*g+z^3*g^2.

A246181 Triangle read by rows: T(n,k) is the number of weighted lattice paths B(n) having k (1,0)-steps of weight 1. B(n) is the set of lattice paths of weight n that start in (0,0), end on the horizontal axis and never go below this axis, whose steps are of the following four kinds: a (1,0)-step of weight 1; a (1,0)-step of weight 2; a (1,1)-step of weight 2; a (1,-1)-step of weight 1. The weight of a path is the sum of the weights of its steps.

Original entry on oeis.org

1, 0, 1, 1, 0, 1, 1, 2, 0, 1, 1, 3, 3, 0, 1, 3, 3, 6, 4, 0, 1, 3, 12, 6, 10, 5, 0, 1, 6, 14, 30, 10, 15, 6, 0, 1, 11, 30, 40, 60, 15, 21, 7, 0, 1, 15, 65, 90, 90, 105, 21, 28, 8, 0, 1, 31, 95, 225, 210, 175, 168, 28, 36, 9, 0, 1, 50, 216, 350, 595, 420, 308, 252, 36, 45, 10, 0, 1
Offset: 0

Views

Author

Emeric Deutsch, Aug 23 2014

Keywords

Comments

Number of entries in row n is n+1.
Sum of entries in row n is A004148(n+1) (the 2ndary structure numbers).
T(n,0) = A025250(n+3).
Sum(k*T(n,k), k>=0) = A110320(n) (n>=1).

Examples

			Row 3 is 1,2,0,1. Indeed, denoting by h (H) the (1,0)-step of weight 1 (2), and u=(1,1), d=(1,-1), the four paths of weight 3 are: ud, hH, Hh, and hhh, having 0, 1, 1, and 3 (1,0)-steps of weight 1, respectively.
Triangle starts:
1;
0,1;
1,0,1;
1,2,0,1;
1,3,3,0,1;
3,3,6,4,0,1;
		

Crossrefs

Programs

  • Maple
    eq := G = 1+t*z*G+z^2*G+z^3*G^2: G := RootOf(eq, G): Gser := simplify(series(G, z = 0, 22)): for n from 0 to 17 do P[n] := sort(coeff(Gser, z, n)) end do: for n from 0 to 15 do seq(coeff(P[n], t, k), k = 0 .. n) end do; # yields sequence in triangular form
    # second Maple program:
    b:= proc(n, y) option remember; `if`(y<0 or y>n, 0,
          `if`(n=0, 1, expand(b(n-1, y)*x+ `if`(n>1,
           b(n-2, y)+b(n-2, y+1), 0) +b(n-1, y-1))))
        end:
    T:= n-> (p-> seq(coeff(p, x, i), i=0..degree(p)))(b(n, 0)):
    seq(T(n), n=0..12); # Alois P. Heinz, Aug 24 2014
  • Mathematica
    b[n_, y_] := b[n, y] = If[y<0 || y>n, 0, If[n==0, 1, Expand[b[n-1, y]*x + If[n>1, b[n-2, y] + b[n-2, y+1], 0] + b[n-1, y-1]]]]; T[n_] := Function[{p}, Table[ Coefficient[p, x, i], {i, 0, Exponent[p, x]}]][b[n, 0]]; Table[T[n], {n, 0, 12}] // Flatten (* Jean-François Alcover, Jun 29 2015, after Alois P. Heinz *)

Formula

G.f. G=G(t,z) satisfies G = 1 + t*z*G + z^2*G + z^3*G^2.

A246182 Triangle read by rows: T(n,k) is the number of weighted lattice paths B(n) having k hh's. B(n) is the set of lattice paths of weight n that start in (0,0), end on the horizontal axis and never go below this axis, whose steps are of the following four kinds: a (1,0)-step h of weight 1; a (1,0)-step H of weight 2; a (1,1)-step u of weight 2; a (1,-1)-step d of weight 1. The weight of a path is the sum of the weights of its steps.

Original entry on oeis.org

1, 1, 1, 1, 3, 0, 1, 5, 2, 0, 1, 9, 5, 2, 0, 1, 19, 9, 6, 2, 0, 1, 39, 21, 12, 7, 2, 0, 1, 79, 53, 27, 15, 8, 2, 0, 1, 167, 118, 74, 34, 18, 9, 2, 0, 1, 357, 269, 180, 96, 42, 21, 10, 2, 0, 1, 763, 639, 419, 254, 119, 51, 24, 11, 2, 0, 1, 1651, 1486, 1045, 605, 340, 143, 61, 27, 12, 2, 0, 1
Offset: 0

Views

Author

Emeric Deutsch, Aug 23 2014

Keywords

Comments

Number of entries in row n is n (n>=1).
Sum of entries in row n is A004148(n+1) (the 2ndary structure numbers).
Sum(k*T(n,k), k>=0) = A110320(n-1) (n>=1).

Examples

			Row 3 is 3,0,1. Indeed, the four paths of weight 3 are: ud, hH, Hh, and hhh, having 0, 0, 0, and 2 hh's, respectively.
Triangle starts:
1;
1;
1,1;
3,0,1;
5,2,0,1;
9,5,2,0,1;
		

Crossrefs

Programs

  • Maple
    eq := z^3*(1+z-t*z)*G^2-(-z^3+1-z^2-t*z+t*z^3)*G+1+z-t*z = 0: g := RootOf(eq, G): gser := simplify(series(g, z = 0, 18)): for j from 0 to 15 do P[j] := coeff(gser, z, j) end do: 1; for j to 13 do seq(coeff(P[j], t, q), q = 0 .. j-1) end do; # yields sequence in triangular form
    # second Maple program:
    b:= proc(n, y, t) option remember; `if`(y<0 or y>n, 0, `if`(n=0, 1,
          expand(b(n-1, y, 1)*`if`(t=1, x, 1)+ `if`(n>1, b(n-2, y, 0)+
          b(n-2, y+1, 0), 0) +b(n-1, y-1, 0))))
        end:
    T:= n-> (p-> seq(coeff(p, x, i), i=0..degree(p)))(b(n, 0$2)):
    seq(T(n), n=0..12); # Alois P. Heinz, Aug 24 2014
  • Mathematica
    b[n_, y_, t_] := b[n, y, t] = If[y<0 || y>n, 0, If[n==0, 1, Expand[b[n-1, y, 1] * If[t==1, x, 1] + If[n>1, b[n-2, y, 0] + b[n-2, y+1, 0], 0] + b[n-1, y-1, 0]]]]; T[n_] := Function[{p}, Table[Coefficient[p, x, i], {i, 0, Exponent[p, x]}]][b[n, 0, 0]]; Table[T[n], {n, 0, 12}] // Flatten (* Jean-François Alcover, Jun 29 2015, after Alois P. Heinz *)

Formula

G.f. G=G(t,z) satisfies z^3*(1+z-t*z)*G^2 - (1-t*z-z^2+t*z^3-z^3)*G+1+z-t*z=0.

A246185 Triangle read by rows: T(n,k) is the number of weighted lattice paths B(n) for which the area between the path and the lines y=0 and y=1 is equal to k. B(n) is the set of lattice paths of weight n that start in (0,0), end on the horizontal axis and never go below this axis, whose steps are of the following four kinds: an (1,0)-step of weight 1; an (1,0)-step of weight 2; a (1,1)-step of weight 2; a (1,-1)-step of weight 1. The weight of a path is the sum of the weights of its steps.

Original entry on oeis.org

1, 1, 2, 3, 1, 5, 2, 1, 8, 5, 3, 1, 13, 10, 8, 5, 1, 21, 20, 18, 14, 8, 1, 34, 38, 39, 35, 26, 12, 1, 55, 71, 80, 80, 70, 49, 17, 1, 89, 130, 160, 174, 169, 142, 90, 23, 1, 144, 235, 312, 365, 385, 363, 290, 158, 30, 1, 233, 420, 598, 745, 840, 861, 785, 588, 264, 38, 1
Offset: 0

Views

Author

Emeric Deutsch, Aug 28 2014

Keywords

Comments

Number of entries in row n is n-1 (n>=2).
Sum of entries in row n is A004148(n+1) (the 2ndary structure numbers).
T(n,0) = A000045(n+1) (the Fibonacci numbers).
T(n,1) = A001629(n-1). - Robert Israel, Aug 28 2014

Examples

			Row 3 is 3, 1. Indeed, denoting by h (H) the (1,0)-step of weight 1 (2), and u=(1,1), d=(1,-1), the four paths of weight 3 are ud, hH, Hh, and hhh; the areas to be considered are 1, 0, 0, and 0, respectively.
Triangle starts:
1;
1;
2;
3, 1;
5, 2,  1;
8, 5,  3, 1;
13,10, 8, 5, 1;
...
		

Crossrefs

Programs

  • Maple
    eq := (t*z^3+z^2-t*z^2+z-t*z-1+t)*g^2+(t*z^2+t*z+1-2*t)*g+t = 0: g := RootOf(eq, g,1): gser := simplify(series(g, z = 0, 20)): for n from 0 to 17 do P[n] := sort(coeff(gser, z, n)) end do: 1; 1; for n from 2 to 17 do seq(coeff(P[n], t, j), j = 0 .. n-2) end do; # yields sequence in triangular form
    # second Maple program:
    b:= proc(n, y) option remember; `if`(y<0 or y>n, 0, `if`(n=0, 1,
          expand(b(n-1, y)*x^min(1, y)+`if`(n>1, b(n-2, y)*x^min(1, y)+
          b(n-2, y+1)*x^min(y+1/2, 1), 0)+b(n-1, y-1)*x^min(y-1/2, 1))))
        end:
    T:= n-> (p-> seq(coeff(p, x, i), i=0..degree(p)))(b(n, 0)):
    seq(T(n), n=0..20);  # Alois P. Heinz, Aug 28 2014
  • Mathematica
    b[n_, y_] := b[n, y] = If[y<0 || y>n, 0, If[n==0, 1, Expand[b[n-1, y] * x^Min[1, y] + If[n>1, b[n-2, y]*x^Min[1, y] + b[n-2, y+1]*x^Min[y+1/2, 1], 0] + b[n-1, y-1]*x^Min[y-1/2, 1]]]]; T[n_] := Function[p, Table[ Coefficient[p, x, i], {i, 0, Exponent[p, x]}]][b[n, 0]]; Table[T[n], {n, 0, 20}] // Flatten (* Jean-François Alcover, Feb 08 2017, after Alois P. Heinz *)

Formula

G.f. g = g(t,z) satisfies (t*z^3 + z^2 - t*z^2 + z - t*z - 1 + t)*g^2 +(1 - 2*t + t*z + t*z^2)*g + t = 0.
The above equation for g = G(t,1,z) follows from the trivariate g.f. G(t,w,z), where z marks weight, t marks the considered area, and w marks the length of the path (= number of steps) and which satisfies G(t,w,z) = 1 + w*z*G(t,w,z) + w*z^2*G(t,w,z) + t*w^2*z^3*G(t,w,z)*G(1,tw,z).
Showing 1-5 of 5 results.