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

A273344 Triangle read by rows: T(n,k) is the number of bargraphs of semiperimeter n having k levels. A level in a bargraph is a maximal sequence of two or more adjacent horizontal steps; it is preceded and followed by either an up step or a down step.

Original entry on oeis.org

1, 1, 1, 3, 2, 6, 7, 14, 19, 2, 33, 53, 11, 79, 148, 47, 1, 194, 409, 181, 10, 482, 1137, 639, 69, 1214, 3159, 2166, 360, 6, 3090, 8793, 7110, 1646, 66, 7936, 24515, 22831, 6868, 490, 2, 20544, 68443, 72145, 26893, 2918, 44, 53545, 191367, 225138, 100598, 15085, 486, 140399, 535762, 695798, 363360, 70847, 3825
Offset: 2

Views

Author

Emeric Deutsch, May 21 2016

Keywords

Comments

Sum of entries in row n = A082582(n).

Examples

			Row 4 is 3,2 because the 5 (=A082582(4)) bargraphs of semiperimeter 4 correspond to the compositions [1,1,1], [1,2], [2,1], [2,2], [3] having 1, 0, 0, 1, 0 levels, respectively.
Triangle starts
1;
1,1;
3,2;
6,7;
14,19,2.
		

Crossrefs

Programs

  • Maple
    G := (1-2*z-z^2+2*z^3-2*t*z^3-sqrt((1-z)*(1-3*z-z^2+3*z^3-4*t*z^3+4*z^4 -4*t*z^4-4*z^5+8*t*z^5-4*t^2*z^5)))/(2*z*(1-z+t*z)): Gser := simplify(series(G, z = 0, 25)): for n from 2 to 20 do P[n] := sort(coeff(Gser, z, n)) end do: for n from 2 to 20 do seq(coeff(P[n], t, j), j = 0 .. degree(P[n])) 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, 2)))))
        end:
    T:= n-> (p-> seq(coeff(p, z, i), i=0..degree(p)))(b(n, 0$3)):
    seq(T(n), n=2..20);  # 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, 2]]]]]; T[n_] := Function[p, Table[Coefficient[p, z, i], {i, 0, Exponent[p, z]}]][b[n, 0, 0, 0]]; Table[T[n], {n, 2, 20}] // Flatten (* Jean-François Alcover, Nov 29 2016 after Alois P. Heinz *)

Formula

T(n,0) = A025243(n+1).
Sum(k*T(n,k), k>=1) = A273345(n).
G.f.: G(t,z) = (1-2z-z^2+2z^3-2tz^3-sqrt((1-z)(1-3z-z^2+3z^3-4tz^3+4z^4-4tz^4-4z^5+8tz^5-4t^2z^5)))/(2z(1-z+tz)); z marks semiperimeter, t marks levels. See eq. (2.4) in the Blecher et al. Ars. Math. Contemp. reference (set x = z, y = z, w = t).

A277973 Sum of horizontal positions of the first peak in all bargraphs of semiperimeter n.

Original entry on oeis.org

0, 0, 0, 1, 6, 25, 91, 311, 1029, 3346, 10778, 34544, 110444, 352785, 1126885, 3601617, 11521648, 36899528, 118322448, 379908707, 1221423149, 3932113059, 12675055399, 40909511880, 132200481507, 427718677728, 1385419058692, 4492446685542, 14582927712740, 47385785436719
Offset: 1

Views

Author

Arnold Knopfmacher, Nov 07 2016

Keywords

Comments

Horizontal position is x-coordinate of the start of the leftmost horizontal step of the first peak.

Examples

			For n = 4, a(4) = 1, as only the bargraph with first column of height one and second column of height two has horizontal position 1, all other cases are zero.
		

Crossrefs

Programs

  • PARI
    seq(n) = my(r=sqrt((1 - x)*(1 - 3*x - x^2 - x^3) + O(x^(n-2)))); Vec(2*x^3*(1 + x^2 - r) / ((1 - x)*(1 - 2*x - x^2 + r)^2), -n) \\ Andrew Howroyd, Jan 12 2024

Formula

G.f.: (2*x^3*(x^2-sqrt(x^4+2*x^2-4*x+1)+1)) / ((1-x)*(-x^2+sqrt(x^4+2*x^2-4*x+1)-2*x+1)^2).

A274486 Triangle read by rows: T(n,k) is the number of bargraphs of semiperimeter n having k horizontal segments (n>=2, k>=1). A horizontal segment is a maximal sequence of adjacent horizontal steps (1,0).

Original entry on oeis.org

1, 2, 3, 2, 4, 8, 1, 5, 20, 10, 6, 40, 45, 6, 7, 70, 140, 56, 2, 8, 112, 350, 280, 44, 9, 168, 756, 1008, 366, 20, 10, 240, 1470, 2940, 1920, 320, 5, 11, 330, 2640, 7392, 7590, 2552, 190, 12, 440, 4455, 16632, 24684, 13904, 2445, 70
Offset: 2

Views

Author

Emeric Deutsch and Sergi Elizalde, Jun 27 2016

Keywords

Comments

Sum of entries in row n = A082582(n).
Sum(k*T(n,k), k>=0) = A273345(n+1).

Examples

			Row 4 is 3,2 because the 5 (=A082582(4)) bargraphs of semiperimeter 4 correspond to the compositions [1,1,1],[1,2],[2,1],[2,2],[3] and, clearly, they have 1,2,2,1,1 horizontal segments.
Triangle starts
1;
2;
3,2;
4,8,1;
5,20,10;
6,40,45,6.
		

Crossrefs

Programs

  • Maple
    G := ((1-2*z+z^2-2*t*z^2-sqrt((1-z)*((1-z)^3-4*t*z^2*(1-z+t*z))))*(1/2))/(t*z): Gser := simplify(series(G,z = 0,23)): for n from 2 to 18 do P[n] := sort(expand(coeff(Gser,z,n))) end do: for n from 2 to 18 do seq(coeff(P[n],t,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)*`if`(t=0, 1, z))))
        end:
    T:= n-> (p-> seq(coeff(p, z, i), i=1..degree(p)))(b(n, 0$2)):
    seq(T(n), n=2..20);  # Alois P. Heinz, Jun 27 2016
  • 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]*If[t == 0, 1, z]]]]; T[n_] := Function[p, Table[Coefficient[p, z, i], {i, 1, Exponent[p, z]}]][b[n, 0, 0]]; Table[T[n], {n, 2, 20}] // Flatten (* Jean-François Alcover, Dec 02 2016, after Alois P. Heinz *)

Formula

G.f.: G = (1-2z+z^2-2tz^2-sqrt((1-z)((1-z)^3-4tz^2*(1-z+tz))))/(2tz).

A277999 Sum of distances between leftmost and rightmost peaks in all bargraphs of semiperimeter n.

Original entry on oeis.org

0, 0, 0, 0, 0, 1, 9, 53, 261, 1165, 4887, 19642, 76519, 291095, 1086946, 3998430, 14530223, 52272218, 186467253, 660449671, 2325124444, 8143334776, 28393762841, 98621419068, 341403900888, 1178425064256, 4057244213071, 13937739553781, 47786215201214, 163554669548711
Offset: 1

Views

Author

Arnold Knopfmacher, Nov 08 2016

Keywords

Examples

			a(6)=1 since the bargraph with column heights 2,1,2 has a distance of 1 between first and last peak. All other bargraphs of semiperimeter 6 have at most one peak, hence 0 difference.
		

Crossrefs

Programs

  • PARI
    my(x = 'x + O('x^30)); sqx = sqrt(x^4+2*x^2-4*x+1); concat(vector(5), Vec(-(4*x^6*(3-2*x^3+3*x^4 - sqx + x^2*(4-3*sqx) + 2*x*(sqx - 4))/((x^2-3*x+1)*sqx*(-1+2*x+x^2-sqx)^3)))) \\ Michel Marcus, Feb 25 2019

Formula

G.f.: -(4*x^6*(3-2*x^3+3*x^4 - sqx + x^2*(4-3*sqx) + 2*x*(sqx - 4))/((x^2-3*x+1)*sqx*(-1+2*x+x^2-sqx)^3)) where sqx = sqrt(x^4+2*x^2-4*x+1).
Showing 1-4 of 4 results.