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

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

Original entry on oeis.org

0, 1, 2, 7, 28, 121, 560, 2677, 13230, 66742, 343092, 1788681, 9439870, 50321865, 270594896, 1465941763, 7993664588, 43839212778, 241650560756, 1338084935826, 7439615051328, 41516113036777, 232452845782308, 1305500166481715, 7352433083806020, 41514430735834714
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}] + Sum[walks[n - 1, k + x, h], {x, h}];
    (* walks represents the number of positive walks with n steps {-h, -h+1, ... -1, 1, ..., h} that end at altitude k *)
    A276852[n_] := (Do[walks[m, k, 3], {m, n}, {k, 3 m}]; walks[n, 1, 3]) (* Davin Park, Oct 10 2016 *)

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

Original entry on oeis.org

0, 1, 3, 12, 56, 284, 1526, 8530, 49106, 289149, 1733347, 10542987, 64904203, 403632551, 2531971729, 16002136283, 101795589297, 651286316903, 4188174878517, 27055199929042, 175488689467350, 1142479579205721, 7462785088260791, 48896570201100002
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 *)
    A276902[n_] := (Do[walks[m, k, 3], {m, n}, {k, 3 m}]; walks[n, 1, 3]) (* Davin Park, Oct 10 2016 *)

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 *)

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

Original entry on oeis.org

0, 1, 3, 14, 68, 358, 1966, 11172, 65104, 387029, 2337919, 14309783, 88555917, 553171371, 3483277785, 22087378303, 140913963221, 903876307075, 5825742149049, 37710582868464, 245052827645474, 1598017940728401, 10454217006683855, 68591382498826168
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 *)
    A276904[n_] := (Do[walks[m, k, 3], {m, n}, {k, 3 m}]; walks[n, 2, 3]) (* Davin Park, Oct 10 2016 *)

Extensions

More terms from Alois P. Heinz, Oct 10 2016

A111160 G.f.: C - Z; where C is the g.f. for the Catalan numbers (A000108) and Z is the g.f. for A055113 with offset 0.

Original entry on oeis.org

0, 1, 1, 4, 9, 31, 91, 309, 1009, 3481, 11956, 42065, 148655, 532039, 1915369, 6950452, 25357233, 93034813, 342888250, 1269246437, 4715945712, 17583623988, 65766726906, 246694006971, 927801717255, 3497918129001, 13217196871126, 50046561077947
Offset: 0

Views

Author

N. J. A. Sloane, Oct 22 2005

Keywords

Comments

Expressible in terms of ballot numbers.
Number of positive walks with n steps {-2,-1,1,2} starting at the origin, ending at altitude 2, and staying strictly above the x-axis. - David Nguyen, Dec 16 2016

Crossrefs

Programs

  • Magma
    I:=[1,1,4]; [0] cat [n le 3 select I[n] else (n*(115*n^3 - 344*n^2 + 299*n - 82)*Self(n-1) + 4*(2*n-3)*(5*n^3 + 27*n^2 - 74*n + 30)*Self(n-2) - 36*(n-2)*(2*n-5)*(2*n-3)*(5*n-3)*Self(n-3))/(2*n*(n+1)*(2*n+1)*(5*n-8)): n in [1..30]]; // Vincenzo Librandi, Oct 06 2015
  • Maple
    a := n -> (-1)^(n+1)*binomial(2*n+1,n)*hypergeom([-n-1,n/2+1/2,n/2],[n,n+1],4)/ (2*n+1);
    [0, op([seq(round(evalf(a(n),32)), n=1..27)])]; # Peter Luschny, Oct 06 2015
  • Mathematica
    CoefficientList[ Series[ -((-3 + Sqrt[1 - 4*x] + Sqrt[2]*Sqrt[1 + Sqrt[1 - 4x] + 6x])/(4x)), {x, 0, 10}], x] (* Robert G. Wilson v *)
  • PARI
    a(n) = if(n==0, 0, sum(k=0, (n+1)/2, binomial(n-k,n-2*k+1)*binomial(2*n+1,k))/(2*n+1)); \\ Altug Alkan, Oct 05 2015
    

Formula

Let C := (1 - sqrt(1 - 4*x)) / (2*x), Z := (- 1/4 - (1/4)*(1 - 4*x)^(1/2) + (1/4)*(2 + 2*(1 - 4*x)^(1/2) + 12*x)^(1/2))/x; g.f. is W := C - Z.
G.f.: -((-3 + sqrt(1 - 4x) + sqrt(2)*sqrt(1 + sqrt(1 - 4x) + 6x))/(4x)).
a(n) = sum(j=0..n+1, binomial(n+2*j-1,j)*(-1)^(n+j+1)*binomial(2*n+1,j+n))/(2*n+1). [Vladimir Kruchinin, Feb 15 2013]
a(n) ~ (1+1/sqrt(5))*2^(2*n-1)/(sqrt(Pi)*n^(3/2)). - Vaclav Kotesovec, Aug 13 2013
Recurrence: 2*n*(n+1)*(2*n+1)*(5*n-8)*a(n) = n*(115*n^3 - 344*n^2 + 299*n - 82)*a(n-1) + 4*(2*n-3)*(5*n^3 + 27*n^2 - 74*n + 30)*a(n-2) - 36*(n-2)*(2*n-5)*(2*n-3)*(5*n-3)*a(n-3). - Vaclav Kotesovec, Aug 13 2013
a(n) = Sum_{j=0..(n+1)/2}(binomial(n-j,n-2*j+1)*binomial(2*n+1,j))/(2*n+1). - Vladimir Kruchinin, Oct 05 2015
a(n) = (-1)^(n+1)*C(2*n+1,n)*hypergeom([-n-1,n/2+1/2,n/2],[n,n+1],4)/(2*n+1) for n>0. - Peter Luschny, Oct 06 2015

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

Original entry on oeis.org

0, 1, 4, 20, 120, 780, 5382, 38638, 285762, 2162033, 16655167, 130193037, 1030117023, 8234025705, 66391916397, 539360587341, 4410492096741, 36274113675369, 299864297741292, 2490192142719336, 20764402240048267, 173784940354460219, 1459360304511145146
Offset: 0

Views

Author

David Nguyen, Nov 04 2016

Keywords

Crossrefs

Programs

  • Maple
    b:= proc(n, y) option remember; `if`(n=0, `if`(y=1, 1, 0),
          add((h-> `if`(h<1, 0, b(n-1, h)))(y+d), d=-4..4))
        end:
    a:= n-> b(n, 0):
    seq(a(n), n=0..23);  # Alois P. Heinz, Nov 12 2016
  • Mathematica
    b[n_, y_] := b[n, y] = If[n == 0, If[y == 1, 1, 0], Sum[Function[h, If[h < 1, 0, b[n - 1, h]]][y + d], {d, -4, 4}]];
    a[n_] := b[n, 0];
    Table[a[n], {n, 0, 23}] (* Jean-François Alcover, Apr 03 2017, after Alois P. Heinz *)

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

Original entry on oeis.org

0, 1, 4, 23, 142, 950, 6662, 48420, 361378, 2753687, 21334313, 167551836, 1330894754, 10673486660, 86306300366, 702872359332, 5759986152740, 47463395965108, 393027545388119, 3268814565684836, 27294209365111429, 228718165320327356, 1922825557218427271
Offset: 0

Views

Author

David Nguyen, Nov 04 2016

Keywords

Crossrefs

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

Original entry on oeis.org

0, 1, 3, 13, 71, 405, 2501, 15923, 104825, 704818, 4827957, 33549389, 235990887, 1676907903, 12019875907, 86804930199, 630999932585, 4613307289260, 33900874009698, 250257489686870, 1854982039556397, 13800559463237465, 103017222722691145, 771348369563479705
Offset: 0

Views

Author

David Nguyen, Nov 04 2016

Keywords

Crossrefs

Programs

  • Maple
    b:= proc(n, y) option remember; `if`(n=0, `if`(y=1, 1, 0), add
         ((h-> `if`(h<1, 0, b(n-1, h)))(y+d), d=[$-4..-1, $1..4]))
        end:
    a:= n-> b(n, 0):
    seq(a(n), n=0..23);  # Alois P. Heinz, Nov 12 2016
  • Mathematica
    b[n_, y_] := b[n, y] = If[n == 0, If[y == 1, 1, 0], Sum[Function[h, If[h < 1, 0, b[n - 1, h]]][y + d], {d, Join[Range[-4, -1], Range[4]]}]];
    a[n_] := b[n, 0];
    Table[a[n], {n, 0, 23}] (* Jean-François Alcover, Apr 03 2017, after Alois P. Heinz *)

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

Original entry on oeis.org

0, 1, 3, 16, 84, 505, 3121, 20180, 133604, 904512, 6224305, 43432093, 306524670, 2184389874, 15695947669, 113595885023, 827299204132, 6058526521135, 44586954104578, 329579179316696, 2445858862779018, 18216235711289695, 136113075865844577, 1020074492384232296
Offset: 0

Views

Author

David Nguyen, Nov 04 2016

Keywords

Crossrefs

Showing 1-9 of 9 results.