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.

A152880 Number of Dyck paths of semilength n having exactly one peak of maximum height.

Original entry on oeis.org

1, 1, 3, 8, 23, 71, 229, 759, 2566, 8817, 30717, 108278, 385509, 1384262, 5006925, 18225400, 66711769, 245400354, 906711758, 3363516354, 12522302087, 46773419089, 175232388955, 658295899526, 2479268126762, 9359152696924, 35406650450001, 134215036793130
Offset: 1

Views

Author

Emeric Deutsch, Jan 02 2009

Keywords

Comments

Also number of peaks of maximum height in all Dyck paths of semilength n-1. Example: a(3)=3 because in (UD)(UD) and U(UD)D we have three peaks of maximum height (shown between parentheses).

Examples

			a(3)=3 because we have UU(UD)DD, UDU(UD)D, U(UD)DUD, where U=(1,1), D=(1,-1), with the peak of maximum height shown between parentheses; the path UUDUDD does not qualify because it has two peaks of maximum height.
		

Crossrefs

Column k=1 of A371928.

Programs

  • Maple
    f[0] := 1: f[1] := 1: for i from 2 to 35 do f[i] := sort(expand(f[i-1]-z*f[i-2])) end do; g := sum(z^j/f[j]^2, j = 1 .. 34): gser := series(g, z = 0, 30): seq(coeff(gser, z, n), n = 1 .. 27);
    # second Maple program:
    b:= proc(x, y, h, c) option remember; `if`(y<0 or y>x, 0,
         `if`(x=0, c, add(b(x-1, y-i, max(h, y), `if`(h=y, 0,
         `if`(h b(2*n, 0$3):
    seq(a(n), n=1..28);  # Alois P. Heinz, Jul 25 2023
  • Mathematica
    b[x_, y_, h_, c_] := b[x, y, h, c] = If[y<0 || y>x, 0, If[x==0, c, Sum[b[x-1, y-i, Max[h, y], If[h==y, 0, If[hJean-François Alcover, Sep 17 2024, after Alois P. Heinz *)

Formula

G.f.: g(z) = Sum_{j>=1} z^j/f(j)^2, where the f(j)'s are the Fibonacci polynomials (in z) defined by f(0)=f(1)=1, f(j)=f(j-1)-zf(j-2), j>=2.
a(n) = A152879(n,1).
a(n) = Sum_{k=1..n} k*A152879(n-1,k).

A372014 T(n,k) is the total number of levels in all Motzkin paths of length n containing exactly k path nodes; triangle T(n,k), n>=0, 1<=k<=n+1, read by rows.

Original entry on oeis.org

1, 0, 1, 1, 1, 1, 2, 2, 2, 1, 4, 6, 4, 3, 1, 8, 14, 12, 7, 4, 1, 18, 32, 33, 21, 11, 5, 1, 44, 74, 84, 64, 34, 16, 6, 1, 113, 180, 208, 181, 111, 52, 22, 7, 1, 296, 457, 520, 485, 344, 179, 76, 29, 8, 1, 782, 1195, 1334, 1273, 1000, 599, 274, 107, 37, 9, 1
Offset: 0

Views

Author

Alois P. Heinz, Apr 15 2024

Keywords

Comments

A Motzkin path of length n has n+1 nodes.

Examples

			In the A001006(3) = 4 Motzkin paths of length 3 there are 2 levels with 1 node, 2 levels with 2 nodes, 2 levels with 3 nodes, and 1 level with 4 nodes.
  2  _     1        1
  2 / \    3 /\_    3 _/\    4 ___    .
  So row 3 is [2, 2, 2, 1].
Triangle T(n,k) begins:
    1;
    0,    1;
    1,    1,    1;
    2,    2,    2,    1;
    4,    6,    4,    3,    1;
    8,   14,   12,    7,    4,   1;
   18,   32,   33,   21,   11,   5,   1;
   44,   74,   84,   64,   34,  16,   6,   1;
  113,  180,  208,  181,  111,  52,  22,   7,  1;
  296,  457,  520,  485,  344, 179,  76,  29,  8, 1;
  782, 1195, 1334, 1273, 1000, 599, 274, 107, 37, 9, 1;
  ...
		

Crossrefs

Columns k=1-2 give: A088457, A051485.
Row sums give A372033 = A001006 + A333498.

Programs

  • Maple
    g:= proc(x, y, p) (h-> `if`(x=0, add(z^coeff(h, z, i)
              , i=0..degree(h)), b(x, y, h)))(p+z^y) end:
    b:= proc(x, y, p) option remember; `if`(y+2<=x, g(x-1, y+1, p), 0)
          +`if`(y+1<=x, g(x-1, y, p), 0)+`if`(y>0, g(x-1, y-1, p), 0)
        end:
    T:= n-> (p-> seq(coeff(p, z, i), i=1..n+1))(g(n, 0$2)):
    seq(T(n), n=0..10);

Formula

Sum_{k=1..n+1} k * T(n,k) = A005717(n+1) = (n+1) * A001006(n).

A261003 a(n) = A136439(n) + Catalan(n).

Original entry on oeis.org

1, 2, 5, 15, 48, 160, 549, 1924, 6851, 24700, 89945, 330239, 1220884, 4540128, 16968958, 63701573, 240059998, 907760348, 3443048256, 13094812968, 49925646786, 190772846082, 730451716847, 2802033270234, 10767028435468, 41438212118088, 159711845145544, 616393788920923, 2381898673172602
Offset: 0

Views

Author

N. J. A. Sloane, Aug 12 2015

Keywords

Comments

This is the quantity S_{n-1} as given by a literal reading of Dershowitz and Rinderknecht (2015), Equations (1) and (2). If the lower limit in the right-hand sum in Eq. (1) is changed to "h >= 2", we obtain A136439.
a(n) is the total number of levels visited by all Dyck paths of semilength n. - Alois P. Heinz, Apr 14 2024

Crossrefs

Row sums of A371928.

Programs

  • Maple
    # Maple code for Equations (1) and (2) of Dershowitz and Rinderknecht (2015).
    H:=proc(n,h) local b,k; b:=binomial; add(b(2*n,n+1-k*h)-2*b(2*n,n-k*h)+b(2*n,n-1-k*h),k=1..n+1); end;
    S1:=n->add(H(n,h),h=1..n+1); [seq(S1(n),n=0..30)];
  • Mathematica
    b[x_, y_, h_] := b[x, y, h] = If[x == 0, h, Sum[If[x+j > y, b[x-1, y-j, Max[h, y-j]], 0], {j, Range[-1, Min[1, y]]~Complement~{0}}]];
    a[n_] :=  b[2n, 0, 0] + CatalanNumber[n];
    Table[a[n], {n, 0, 30}] (* Jean-François Alcover, Apr 15 2023, after Alois P. Heinz in A136439 *)

Formula

a(n) = A000108(n) + A136439(n).

A371903 Total number of levels in all Dyck paths of semilength n containing exactly 2 path nodes.

Original entry on oeis.org

0, 1, 3, 5, 15, 44, 134, 427, 1408, 4753, 16321, 56812, 200046, 711425, 2551886, 9222147, 33544682, 122712465, 451169747, 1666248405, 6178586630, 22994275870, 85859249486, 321562877934, 1207665205311, 4547078084804
Offset: 0

Views

Author

Alois P. Heinz, Apr 13 2024

Keywords

Examples

			a(3) = 3 + 2 + 0 + 0 + 0 = 5:
   1
  _2   /\      _2           1           1
  _2  /  \      3  /\/\     3  /\       3    /\     3
  _2 /    \    _2 /    \    3 /  \/\    3 /\/  \    4 /\/\/\    .
		

Crossrefs

Column k=2 of A371928.

Programs

  • Maple
    g:= proc(x, y, p) (h-> `if`(x=0, add(`if`(coeff(h, z, i)=2, 1, 0),
          i=0..degree(h)), b(x, y, h)))(p+`if`(coeff(p, z, y)<3, z^y, 0))
        end:
    b:= proc(x, y, p) option remember; `if`(y+2<=x,
          g(x-1, y+1, p), 0)+`if`(y>0, g(x-1, y-1, p), 0)
        end:
    a:= n-> g(2*n, 0$2):
    seq(a(n), n=0..18);
Showing 1-4 of 4 results.