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.

A191521 Triangle read by rows: T(n,k) is the number of left factors of Dyck paths of length n that have k valleys (i.e., a (1,-1)-step followed by a (1,1)-step).

Original entry on oeis.org

1, 1, 2, 2, 1, 3, 3, 3, 6, 1, 4, 12, 4, 4, 18, 12, 1, 5, 30, 30, 5, 5, 40, 60, 20, 1, 6, 60, 120, 60, 6, 6, 75, 200, 150, 30, 1, 7, 105, 350, 350, 105, 7, 7, 126, 525, 700, 315, 42, 1, 8, 168, 840, 1400, 840, 168, 8, 8, 196, 1176, 2450, 1960, 588, 56, 1, 9, 252, 1764, 4410, 4410, 1764, 252, 9
Offset: 0

Views

Author

Emeric Deutsch, Jun 05 2011

Keywords

Comments

Row n>=1 contains ceiling(n/2) entries.
Sum of entries in row n is binomial(n, floor(n/2)) = A001405(n).
Sum_{k>=0} k*T(n,k) = A191522(n).

Examples

			T(4,1)=3 because we have U(DU)D, U(DU)U, and UU(DU), where U=(1,1) and D=(1,-1) (the valleys are shown between parentheses).
Triangle starts:
  1;
  1;
  2;
  2,  1;
  3,  3;
  3,  6,  1;
  4, 12,  4;
  4, 18, 12,  1;
  ...
		

Crossrefs

Programs

  • Maple
    Q := sqrt(((1-z)^2-t*z^2)*((1+z)^2-t*z^2)): G := (1+t*z^2-z^2-Q)/(t*z*(t*z^2-1+2*z-z^2+Q)): Gser := simplify(series(G, z = 0, 19)): for n from 0 to 16 do P[n] := sort(coeff(Gser, z, n)) end do: 1; for n to 16 do seq(coeff(P[n], t, k), k = 0 .. ceil((1/2)*n)-1) end do; # yields sequence in triangular form
    # second Maple program:
    b:= proc(x, y, t) option remember; expand(`if`(x=0, 1,
         `if`(y>0, b(x-1, y-1, z), 0)+b(x-1, y+1, 1)*t))
        end:
    T:= n-> (p-> seq(coeff(p, z, i), i=0..degree(p)))(b(n, 0, 1)):
    seq(T(n), n=0..30);  # Alois P. Heinz, Mar 29 2017
  • Mathematica
    T[n_, m_] := If [n == 0 && m == 0, 1, If[n == 0, 0, If[OddQ[n-1], (2* Binomial[n/2, m]*Binomial[n/2, m+1]*(n/2 + 1))/n, Binomial[(n+1)/2, m+1]*Sum[(-1)^(k-1)*Binomial[(n+1)/2, m-k+1], {k, 1, (n+1)/2}]]]];
    Table[T[n, m], {n, 0, 16}, {m, 0, If[n <= 2, 0, Quotient[n-1, 2]]}] // Flatten (* Jean-François Alcover, Feb 16 2021, after Vladimir Kruchinin *)
  • Maxima
    T(n,m):=if n=0 and m=0 then 1 else if n=0 then 0 else if oddp(n-1) then (2*binomial(n/2,m)*binomial(n/2,m+1)*(n/2+1))/n else binomial((n+1)/2,m+1)*sum((-1)^(k-1)*binomial((n+1)/2,m-k+1),k,1,(n+1)/2);
    /* Vladimir Kruchinin, Jul 24 2019 */

Formula

G.f.: G(t,z) = (1+t*z^2-z^2-Q)/(t*z*(t*z^2-1+2*z-z^2+Q)), where Q = sqrt(((1-z)^2-t*z^2)*((1+z)^2-t*z^2)).
T(n,k) = 2*C(n/2,k)*C(n/2,k+1)*(n/2+1)/n, for even n, C((n+1)/2,k+1)*Sum_{j=1..(n+1)/2} (-1)^(j-1)*C((n+1)/2,k-j+1), for odd n, T(0,0)=1. - Vladimir Kruchinin, Jul 24 2019