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

A333498 Sum of the heights of all Motzkin paths of length n.

Original entry on oeis.org

0, 0, 1, 3, 9, 25, 70, 196, 552, 1560, 4423, 12573, 35826, 102310, 292786, 839554, 2411945, 6941593, 20011328, 57779038, 167069317, 483739961, 1402413161, 4070537585, 11827842021, 34403798725, 100167396088, 291903951462, 851380987390, 2485175809878
Offset: 0

Views

Author

Alois P. Heinz, Mar 24 2020

Keywords

Crossrefs

Programs

  • Maple
    b:= proc(x, y, h) option remember; `if`(x=0, h, add(
          b(x-1, y+j, max(h, y)), j=-min(1, y)..min(1, x-y-1)))
        end:
    a:= n-> b(n, 0$2):
    seq(a(n), n=0..35);
  • Mathematica
    b[x_, y_, h_] := b[x, y, h] = If[x == 0, h, Sum[b[x - 1, y + j, Max[h, y]], {j, -Min[1, y], Min[1, x - y - 1]}]];
    a[n_] := b[n, 0, 0];
    a /@ Range[0, 35] (* Jean-François Alcover, May 10 2020, after Maple *)

Formula

a(n) = Sum_{k=1..floor(n/2)} k * A097862(n,k).

A333069 Number of lattice paths from (0,0) to (n,0) that do not go below the x-axis, and at (x,y) only allow steps (1,v) with v in {-1,0,1,...,y+1}.

Original entry on oeis.org

1, 1, 2, 4, 9, 22, 57, 155, 439, 1287, 3886, 12035, 38100, 122943, 403410, 1343321, 4531710, 15465414, 53325680, 185575269, 651191826, 2302247822, 8194892393, 29350405663, 105713021575, 382717065800, 1392121894189, 5085836001166, 18654616951435, 68678029247822
Offset: 0

Views

Author

Alois P. Heinz, Mar 06 2020

Keywords

Crossrefs

Programs

  • Maple
    b:= proc(x, y) option remember; `if`(x=0, 1, add(
         `if`(x+j>y, b(x-1, y-j), 0), j=-1-y..min(1, y)))
        end:
    a:= n-> b(n, 0):
    seq(a(n), n=0..33);
  • Mathematica
    b[x_, y_] := b[x, y] = If[x == 0, 1, Sum[If[x + j > y, b[x - 1, y - j], 0], {j, -1 - y, Min[1, y]}]];
    a[n_] := b[n, 0];
    a /@ Range[0, 33] (* Jean-François Alcover, Dec 19 2020, after Alois P. Heinz *)

Formula

a(n) = A196161(n) for n = 1..8.
a(n) ~ c * 4^n / n^(3/2), where c = 0.0131789402414023971902275212293294628834887666310830183578424168829... - Vaclav Kotesovec, Mar 25 2020

A333608 Sum of the heights of all nonnegative lattice paths from (0,0) to (n,0) where the allowed steps at (x,y) are (1,v) with v in {-1,0,...,max(y,1)}.

Original entry on oeis.org

0, 0, 1, 3, 9, 25, 70, 200, 584, 1742, 5304, 16471, 52120, 167885, 549856, 1828897, 6170108, 21087458, 72923515, 254880303, 899454849, 3201729220, 11486266036, 41497996004, 150879471934, 551723923040, 2027990653855, 7489507917594, 27777837416779, 103427750936183
Offset: 0

Views

Author

Alois P. Heinz, Mar 28 2020

Keywords

Comments

The maximal height in all paths of length n is A103354(n-1).

Crossrefs

Programs

  • Maple
    b:= proc(x, y, h) option remember;
         `if`(x=0, h, add(b(x-1, y+j, max(y, h)),
          j=-min(1, y)..min(max(1, y), x-y-1)))
        end:
    a:= n-> b(n, 0$2):
    seq(a(n), n=0..29);
  • Mathematica
    b[x_, y_, h_] := b[x, y, h] = If[x == 0, h, Sum[b[x - 1, y + j, Max[y, h]], {j, -Min[1, y], Min[Max[1, y], x - y - 1]}]];
    a[n_] := b[n, 0, 0];
    a /@ Range[0, 29] (* Jean-François Alcover, May 12 2020, after Maple *)

A333070 Total number of nodes summed over all lattice paths from (0,0) to (n,0) that do not go below the x-axis, and at (x,y) only allow steps (1,v) with v in {-1,0,1,...,y+1}.

Original entry on oeis.org

1, 2, 6, 16, 45, 132, 399, 1240, 3951, 12870, 42746, 144420, 495300, 1721202, 6051150, 21493136, 77039070, 278377452, 1013187920, 3711505380, 13675028346, 50649452084, 188482525039, 704409735912, 2642825539375, 9950643710800, 37587291143103, 142403408032648
Offset: 0

Views

Author

Alois P. Heinz, Mar 06 2020

Keywords

Crossrefs

Programs

  • Maple
    b:= proc(x, y) option remember; `if`(x=0, 1, add(
         `if`(x+j>y, b(x-1, y-j), 0), j=-1-y..min(1, y)))
        end:
    a:= n-> (n+1)*b(n, 0):
    seq(a(n), n=0..30);
  • Mathematica
    b[x_, y_] := b[x, y] = If[x == 0, 1, Sum[
         If[x + j > y, b[x - 1, y - j], 0], {j, -1 - y, Min[1, y]}]];
    a[n_] := (n+1) b[n, 0];
    a /@ Range[0, 30] (* Jean-François Alcover, Apr 05 2021, after Alois P. Heinz *)

Formula

a(n) = (n+1) * A333069(n).
a(n) ~ c * 4^n / sqrt(n), where c = 0.0131789402414023971902275212293294628834887666310830183578424168829... - Vaclav Kotesovec, Oct 24 2021

A333071 Total area under all lattice paths from (0,0) to (n,0) that do not go below the x-axis, and at (x,y) only allow steps (1,v) with v in {-1,0,1,...,y+1}.

Original entry on oeis.org

0, 0, 1, 4, 16, 63, 239, 895, 3343, 12503, 46905, 176620, 667664, 2533699, 9650737, 36887383, 141448958, 544022417, 2098082719, 8111788699, 31434420426, 122068414186, 474932563378, 1851059631879, 7226108097869, 28250493771358, 110594307388370, 433488248791630
Offset: 0

Views

Author

Alois P. Heinz, Mar 06 2020

Keywords

Crossrefs

Programs

  • Maple
    b:= proc(x, y) option remember; `if`(x=0, [1, 0],
          add(`if`(x+j>y, (p-> p+[0, p[1]*(y-j/2)])(
            b(x-1, y-j)), 0), j=-1-y..min(1, y)))
        end:
    a:= n-> b(n, 0)[2]:
    seq(a(n), n=0..30);
  • Mathematica
    b[x_, y_] := b[x, y] = If[x == 0, {1, 0},
         Sum[If[x + j > y, With[{p = b[x - 1, y - j]}, p +
         {0, p[[1]] (y - j/2)}], 0], {j, -1 - y, Min[1, y]}]];
    a[n_] := b[n, 0][[2]];
    a /@ Range[0, 30] (* Jean-François Alcover, Apr 05 2021, after Alois P. Heinz *)
Showing 1-5 of 5 results.