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.

A276903 Number of positive walks with n steps {-2,-1,0,1,2} starting at the origin, ending at altitude 2, and staying strictly above the x-axis.

Original entry on oeis.org

0, 1, 2, 7, 25, 96, 382, 1567, 6575, 28096, 121847, 534953, 2373032, 10619922, 47890013, 217395690, 992640367, 4555957948, 21007405327, 97266928685, 452046424465, 2108022305795, 9860773604035, 46256877824220, 217555982625385, 1025667805621986, 4846240583558277
Offset: 0

Views

Author

Michael Wallner, Sep 21 2016

Keywords

Crossrefs

Programs

  • Mathematica
    walks[n_, k_, h_] = 0;
    walks[1, k_, h_] := Boole[0 < k <= h];
    walks[n_, k_, h_] /; n >= 2 && k > 0 := walks[n, k, h] = Sum[walks[n - 1, k + x, h], {x, -h, h}];
    (* walks represents the number of positive walks with n steps {-h, -h+1, ... , h} that end at altitude k *)
    A276903[n_] := (Do[walks[m, k, 2], {m, n}, {k, 2 m}]; walks[n, 2, 2]) (* Davin Park, Oct 10 2016 *)