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

A271942 Triangle read by rows: T(n,k) is the number of bargraphs of semiperimeter n having width k (n>=2, k>=1).

Original entry on oeis.org

1, 1, 1, 1, 3, 1, 1, 5, 6, 1, 1, 7, 16, 10, 1, 1, 9, 31, 40, 15, 1, 1, 11, 51, 105, 85, 21, 1, 1, 13, 76, 219, 295, 161, 28, 1, 1, 15, 106, 396, 771, 721, 280, 36, 1, 1, 17, 141, 650, 1681, 2331, 1582, 456, 45, 1, 1, 19, 181, 995, 3235, 6083, 6244, 3186, 705, 55, 1, 1, 21, 226, 1445, 5685, 13663, 19348, 15156, 5985, 1045, 66, 1, 1, 23, 276, 2014, 9325, 27483, 50464, 55308, 33903, 10615, 1496, 78, 1
Offset: 2

Views

Author

Emeric Deutsch, May 21 2016

Keywords

Comments

Sum of entries in row n = A082582(n).
Sum(k*T(n,k), k>=1) = A271943(n).
Connection with A145904 should be explored.

Examples

			Row 4 is 1,3,1 because the 5 (=A082582(4)) bargraphs of semiperimeter 4 correspond to the compositions [1,1,1], [1,2], [2,1], [2,2], [3] which, clearly, have widths 3,2,2,2,1.
Triangle starts:
                               1
                              1, 1
                            1, 3, 1
                           1, 5, 6, 1
                        1, 7, 16, 10, 1
                      1, 9, 31, 40, 15, 1
                   1, 11, 51, 105, 85, 21, 1
                1, 13, 76, 219, 295, 161, 28, 1
             1, 15, 106, 396, 771, 721, 280, 36, 1
         1, 17, 141, 650, 1681, 2331, 1582, 456, 45, 1
		

Crossrefs

Programs

  • Maple
    eq := x*z*G^2-(1-x*z-z-x*z^2)*G+x*z^2 = 0: G := RootOf(eq, G): Gser := simplify(series(G, z = 0, 23)): for n from 2 to 20 do P[n] := sort(expand(coeff(Gser, z, n))) end do: for n from 2 to 20 do seq(coeff(P[n], x, j), j = 1 .. degree(P[n])) end do; # yields sequence in triangular form
    # second Maple program:
    b:= proc(n, y, t) option remember; expand(`if`(n=0, (1-t),
          `if`(t<0, 0, b(n-1, y+1, 1))+`if`(t>0 or y<2, 0,
           b(n, y-1, -1))+`if`(y<1, 0, b(n-1, y, 0)*z)))
        end:
    T:= n-> (p-> seq(coeff(p, z, i), i=1..n-1))(b(n, 0$2)):
    seq(T(n), n=2..20);  # Alois P. Heinz, Jun 06 2016
    # Alternative, (assuming offset (0,0)):
    T := (n, k) -> simplify(hypergeom([-k, k + 3, k - n], [1, 2], 1)):
    seq(seq(T(n, k), k=0..n), n=0..9); # Peter Luschny, Oct 18 2020
  • Mathematica
    b[n_, y_, t_] := b[n, y, t] = Expand[If[n == 0, {1 - t}, If[t < 0, 0, b[n - 1, y + 1, 1]] + If[t > 0 || y < 2, 0, b[n, y - 1, -1]] + If[y < 1, 0, b[n - 1, y, 0]*z]]];
    T[n_] := Function[p, Table[Coefficient[p, z, i], {i, 1, n-1}]][b[n, 0, 0] ];
    Table[T[n], {n, 2, 20}] // Flatten (* Jean-François Alcover, Jul 21 2016, after Alois P. Heinz *)
    T[n_, k_] := Sum[(Binomial[n - k - 1, j]*Binomial[n - k, j]*Binomial[2*n - k - 2*j, 2*n - 2*k])/(j + 1), {j, 0, n - k}]; Flatten[Table[T[n, k], {n, 0, 12}, {k, 0, n}]] (* , provided one bases the offset in (0, 0). Detlef Meya, Jan 07 2023 *)

Formula

G.f.: G(x,z) satisfies xzG^2-(1-xz-z-xz^2)G+xz^2=0 (z marks semiperimeter, x marks width).
T(n, k) = hypergeom([-k, k + 3, k - n], [1, 2], 1), provided one bases the offset in (0, 0). - Peter Luschny, Oct 18 2020
T(n, k) = Sum_{j=0..n - k} (binomial(n - k - 1, j)*binomial(n - k, j)*binomial(2*n - k - 2*j, 2*n - 2*k))/(j + 1), provided one bases the offset in (0, 0). - Detlef Meya, Jan 07 2023

A273714 Number of doublerises in all bargraphs having semiperimeter n (n>=2). A doublerise in a bargraph is any pair of adjacent up steps.

Original entry on oeis.org

0, 1, 4, 14, 47, 155, 508, 1662, 5438, 17809, 58395, 191732, 630373, 2075221, 6840140, 22571800, 74564874, 246568051, 816099650, 2703492238, 8963064935, 29738123605, 98735734915, 328034119098, 1090509180192, 3627343273885, 12072071392105, 40197107361740, 133910579452363
Offset: 2

Views

Author

Emeric Deutsch, May 28 2016

Keywords

Comments

a(n) appears to be the number of 021-avoiding ascent sequences (A022493) with exactly one repeated nonzero entry, where repeated means two consecutive equal entries. For example, a(4) = 4 counts 0011, 0110, 0112, 0122, and a(5) = 14 counts 00011, 00110, 00112, 00122, 01011, 01022, 01100, 0110 1, 01102, 01120, 01123, 0122 0, 01223, 01233. - David Callan, Nov 21 2021

Examples

			a(4) = 4 because the 5 (=A082582(4)) bargraphs of semiperimeter 4 correspond to the compositions [1,1,1], [1,2], [2,1], [2,2], [3] and the corresponding drawings show that they have 0, 0, 1, 1, 2 doublerises.
		

Crossrefs

Programs

  • Maple
    g := ((1-2*z-z^2-sqrt(1-4*z+2*z^2+z^4))*(1/2))/sqrt(1-4*z+2*z^2+z^4): gser := series(g, z = 0, 40): seq(coeff(gser, z, n), n = 2 .. 35);
  • Mathematica
    F[k_] := DifferenceRoot[Function[{y, n}, {(2 + n) y[n] + (6 + 2 n) y[2 + n] + (-14 - 4 n) y[3 + n] + (4 + n) y[4 + n] == 0, y[0] == 1, y[1] == 2, y[2] == 5, y[3] == 14}]][k]; Table[1/2 (-F[n] - 2 F[n + 1] + F[n + 2]), {n, 0, 20}] (* Benedict W. J. Irwin, May 29 2016 *)

Formula

G.f.: g = (1 - 2z - z^2 - Q)/(2Q), where Q = sqrt(1 - 4z + 2z^2 + z^4).
a(n) = Sum_{k>0} k*A273713(n,k).
From Benedict W. J. Irwin, May 29 2016: (Start)
Let y(0)=1, y(1)=2, y(2)=5, y(3)=14,
Let (n+2)*y(n) + (2*n+6)*y(n+2) - (4*n+14)*y(n+3) + (n+4)*y(n+4)=0,
a(n) = (y(n+2)-2*y(n+1)-y(n))/2.
(End)
D-finite with recurrence n*a(n) +6*(-n+1)*a(n-1) +9*(n-2)*a(n-2) -6*a(n-3) +(-n+8) * a(n-4) +2*(-n+4)*a(n-5) +(-n+6)*a(n-6)=0. - R. J. Mathar, Jun 06 2016

A273349 Triangle read by rows: T(n,k) is the number of bargraphs of semiperimeter n having k level steps (n>=2,k>=0). A level step in a bargraph is any pair of adjacent horizontal steps at the same height.

Original entry on oeis.org

1, 1, 1, 3, 1, 1, 6, 5, 1, 1, 14, 12, 7, 1, 1, 33, 34, 19, 9, 1, 1, 79, 95, 61, 27, 11, 1, 1, 194, 261, 193, 95, 36, 13, 1, 1, 482, 728, 585, 333, 136, 46, 15, 1, 1, 1214, 2022, 1797, 1091, 521, 184, 57, 17, 1, 1, 3090, 5634, 5439, 3629, 1821, 763, 239, 69, 19, 1, 1
Offset: 2

Views

Author

Emeric Deutsch, Jun 03 2016

Keywords

Comments

Number of entries in row n is n-1.
Sum of entries in row n = A082582(n).
T(n,0) = A025243(n+1).
Sum(k*T(n,k),k>=0) = A271943(n-1). This implies that the number of level steps in all bargraphs of semiperimeter n is equal to the sum of the widths of all bargraphs of semiperimeter n-1.

Examples

			Row 4 is 3,1,1 because the 5 (=A082582(4)) bargraphs of semiperimeter 4 correspond to the compositions [1,1,1], [1,2], [2,1], [2,2], [3] which, clearly, have 2,0,0,1,0 level steps.
Triangle starts
1;
1,1;
3,1,1;
6,5,1,1;
14,12,7,1,1
		

References

  • A. Blecher, C. Brennan, and A. Knopfmacher, Combinatorial parameters in bargraphs (preprint).

Crossrefs

Programs

  • Maple
    G:=((1-t*z-z-2*z^2+t*z^2-sqrt((1-t*z-z-2*z^2+t*z^2)^2-4*z^3))*(1/2))/z: Gser:=simplify(series(G,z=0,21)): for n from 2 to 18 do P[n] := sort(coeff(Gser, z, n)) end do: for n from 2 to 18 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, t, w) option remember; expand(
          `if`(n=0, (1-t), `if`(t<0, 0, b(n-1, y+1, 1, 0))+
          `if`(t>0 or y<2, 0, b(n, y-1, -1, 0))+ `if`(y<1, 0,
          `if`(w=1, z, 1)*b(n-1, y, 0, min(w+1, 1)))))
        end:
    T:= n-> (p-> seq(coeff(p, z, i), i=0..degree(p)))(b(n, 0$3)):
    seq(T(n), n=2..18);  # Alois P. Heinz, Jun 04 2016
  • Mathematica
    b[n_, y_, t_, w_] := b[n, y, t, w] = Expand[If[n == 0, 1 - t, If[t < 0, 0, b[n - 1, y + 1, 1, 0]] + If[t > 0 || y < 2, 0, b[n, y - 1, -1, 0]] + If[y < 1, 0, If[w == 1, z, 1]*b[n - 1, y, 0, Min[w + 1, 1]]]]];
    T[n_] := Function [p, Table[Coefficient[p, z, i], {i, 0, Exponent[p, z]}]][ b[n, 0, 0, 0]];
    Table[T[n], {n, 2, 18}] // Flatten (* Jean-François Alcover, Jul 29 2016, after Alois P. Heinz *)

Formula

G.f.: G(t,z) = (1-tz-z-2z^2+tz^2-sqrt((1-z)(1-z-2tz-4z^2+t^2z^2+2tz^2-4z^3-t^2z^3+4tz^3)))/(2z) (z marks semiperimeter, t marks level steps; obtained from the expression for F in the Blecher et al. reference (Section 7.1) by setting x=z, y=z, w=t).
Showing 1-3 of 3 results.