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

A337318 Total number of nodes summed over 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

1, 2, 6, 16, 45, 131, 393, 1218, 3887, 12736, 42707, 146113, 508610, 1796848, 6428953, 23253209, 84893617, 312435085, 1157899672, 4317354453, 16183476500, 60947573729, 230481995102, 874810511970, 3331322503398, 12723257204883, 48722782351656, 187028551724723
Offset: 0

Views

Author

Alois P. Heinz, Oct 12 2020

Keywords

Crossrefs

Programs

  • Maple
    b:= proc(x, y) option remember; `if`(x=0, [1$2],
          add(add((p-> p+[0, p[1]])(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, 1},
        Sum[Sum[Function[p, p + {0, p[[1]]}][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]];
    a /@ Range[0, 30] (* Jean-François Alcover, Dec 22 2020, after Alois P. Heinz *)

Formula

a(n) ~ c * 4^n / sqrt(n), where c = 0.028711801689489498782112731663771630297082311282971968906589032765122715... - 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 *)

A348202 Number of nonnegative lattice paths from (0,0) to (n,0) using steps in {(1,-4), (1,-1), (1,0), (1,1)}.

Original entry on oeis.org

1, 1, 2, 4, 9, 22, 57, 155, 435, 1249, 3645, 10770, 32143, 96747, 293359, 895373, 2748803, 8483035, 26302248, 81896176, 255967640, 802790415, 2525691721, 7968972542, 25209580699, 79942927651, 254077293876, 809192984902, 2582113984084, 8254273128869
Offset: 0

Views

Author

Alois P. Heinz, Oct 06 2021

Keywords

Crossrefs

Programs

  • Maple
    b:= proc(x, y) option remember; `if`(y<0 or y>x, 0,
         `if`(x=0, 1, add(b(x-1, y-j), j=[-4, -1, 0, 1])))
        end:
    a:= n-> b(n, 0):
    seq(a(n), n=0..31);
  • Mathematica
    b[x_, y_] := b[x, y] = If[y < 0 || y > x, 0, If[x == 0, 1, Sum[b[x - 1, y - j], {j, {-4, -1, 0, 1}}]]];
    a[n_] := b[n, 0];
    Table[a[n], {n, 0, 31}] (* Jean-François Alcover, Dec 28 2022, after Alois P. Heinz *)

Formula

a(n) ~ c * d^n / n^(3/2), where d = 3.3640233336410979391691803264403704977... is the root of the equation 256*d^5 - 1280*d^4 + 960*d^3 + 2267*d^2 - 1324*d - 4112 = 0 and c = 0.710307351107763693658610320440791667652705027171696102847138... - Vaclav Kotesovec, Oct 24 2021
Showing 1-3 of 3 results.