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

A337067 Number of nonnegative lattice paths from (0,0) to (n,0) where the allowed steps at (x,y) are (h,v) with h in {1..max(1,y)} and v in {-1,0,1}.

Original entry on oeis.org

1, 1, 2, 4, 9, 22, 57, 156, 447, 1332, 4103, 12999, 42176, 139638, 470353, 1607861, 5566543, 19484810, 68859862, 245404650, 881081082, 3184214751, 11575346316, 42300703150, 155316289004, 572725968326, 2120154235114, 7876449597257, 29356608044002
Offset: 0

Views

Author

Alois P. Heinz, Oct 12 2020

Keywords

Crossrefs

Programs

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

Formula

a(n) ~ c * 4^n / n^(3/2), where c = 0.03828240225265266504281697555169550706277641504396262520878537702016362... - Vaclav Kotesovec, Oct 24 2020

A337863 Twice the total area of all nonnegative lattice paths from (0,0) to (n,0) where the allowed steps at (x,y) are (h,v) with h in {1..max(1,y)} and v in {-1,0,1}.

Original entry on oeis.org

0, 0, 2, 8, 32, 123, 459, 1715, 6432, 24256, 91993, 350817, 1344559, 5176106, 20003683, 77567894, 301667089, 1176204195, 4596267116, 17995972170, 70581437130, 277244854010, 1090484851145, 4294324521033, 16929104620229, 66801975748076, 263827090563129
Offset: 0

Views

Author

Alois P. Heinz, Oct 12 2020

Keywords

Crossrefs

Programs

  • Maple
    b:= proc(x, y) option remember; `if`(x=0, [1, 0],
          add(add((p-> p+[0, p[1]*h*(2*y-v)])(b(x-h, y-v)),
          h=1..min(x-y+v, max(1, y-v))), v=-1..min(y, 1)))
        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[Sum[Function[p, p + {0, p[[1]]*h*(2*y - v)}][b[x - h, y - v]],
         {h, 1, Min[x - y + v, Max[1, y - v]]}], {v, -1, Min[y, 1]}]];
    a[n_] := b[n, 0][[2]];
    Table[a[n], {n, 0, 30}] (* Jean-François Alcover, Mar 24 2022, after Alois P. Heinz *)
Showing 1-2 of 2 results.