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.

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

Original entry on oeis.org

1, 2, 5, 13, 34, 1, 89, 8, 233, 42, 610, 183, 1, 1597, 717, 13, 4181, 2622, 102, 10946, 9134, 624, 1, 28657, 30691, 3275, 19, 75025, 100284, 15473, 205, 196418, 320466, 67684, 1650, 1, 514229, 1005630, 279106, 11020, 26, 1346269, 3108324, 1098402, 64553, 366, 3524578, 9485551, 4161750, 342867, 3716, 1
Offset: 2

Views

Author

Emeric Deutsch, May 20 2016

Keywords

Comments

Sum of entries in row n = A082582(n).
Diagonal sums (obtained by fixing n - k) give the Catalan numbers [Deutsch and Elizalde]. - Eric M. Schmidt, Nov 01 2017

Examples

			Row 4 is 5 because all 5 bargraphs of semiperimeter 4 (corresponding to the compositions [1,1,1], [1,2], [2,1], [2,2], [3]) have only 1 peak.
T(6,2) = 1 because among the A082582(6)=35 bargraphs of semiperimeter 6 only the one corresponding to the composition [2,1,2] has 2 peaks.
Table begins:
      1
      2
      5
     13
     34    1
     89    8
    233   42
    610  183   1
   1597  717  13
   4181 2622 102
  10946 9134 624 1
		

Crossrefs

Programs

  • Maple
    b := 1-3*z+z^2+t*z^3: G := ((-b+sqrt(b^2-4*t*z^3*(z-1)^2))*(1/2))/(z*(z-1)): Gser := simplify(series(G, z = 0, 23)): 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 = 1 .. degree(P[n])) end do; # yields sequence in triangular form
    # second Maple program:
    b:= proc(n, y, t, h) option remember; expand(
          `if`(n=0, (1-t)*z^h, `if`(t<0, 0, b(n-1, y+1, 1, 0))+
          `if`(t>0 or y<2, 0, b(n, y-1, -1, 0)*z^h)+
          `if`(y<1, 0, b(n-1, y, 0, `if`(t>0, 1, h)))))
        end:
    T:= n-> (p-> seq(coeff(p, z, i), i=1..degree(p)))(b(n, 0$3)):
    seq(T(n), n=2..20);  # Alois P. Heinz, Jun 06 2016
  • Mathematica
    b[n_, y_, t_, h_] := b[n, y, t, h] = Expand[If[n == 0, (1 - t)*z^h, If[t < 0, 0, b[n - 1, y + 1, 1, 0]] + If[t > 0 || y < 2, 0, b[n, y - 1, -1, 0]*z^h] + If[y < 1, 0, b[n - 1, y, 0, If[t > 0, 1, h]]]]]; T[n_] := Function [p, Table[Coefficient[p, z, i], {i, 1, 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

Sum_{k>1} k*T(n,k) = A271941(n).
G.f.: (-b + sqrt(b^2 - 4tz^3(z - 1)^2))/(2z(z - 1)), where b = 1 - 3z + z^2 + tz^3 (in eq. (5) of the Blecher et al. 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).

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