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.

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