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.

A278392 Number of positive meanders (walks starting at the origin and ending at any altitude > 0 that never touch or go below the x-axis in between) with n steps from {-3,-2,-1,0,1,2,3}.

Original entry on oeis.org

1, 3, 15, 87, 530, 3329, 21316, 138345, 906853, 5989967, 39804817, 265812731, 1782288408, 11991201709, 80911836411, 547334588037, 3710610424765, 25204313298581, 171492983631249, 1168638213247713, 7974592724571446, 54484621312318007, 372671912259214487
Offset: 0

Views

Author

David Nguyen, Nov 20 2016

Keywords

Comments

By convention, the empty walk (corresponding to n=0) is considered to be a positive meander.

Crossrefs

Programs

  • Mathematica
    frac[ex_] := Select[ex, Exponent[#, x] < 0&];
    seq[n_] := Module[{v, m, p}, v = Table[0, n]; m = Sum[x^i, {i, -3, 3}]; p = 1/x; v[[1]] = 1; For[i = 2, i <= n, i++, p = p*m // Expand; p = p - frac[p]; v[[i]] = p /. x -> 1]; v];
    seq[23] (* Jean-François Alcover, Jul 01 2018, after Andrew Howroyd *)
  • PARI
    seq(n)={my(v=vector(n), m=sum(i=-3, 3, x^i), p=1/x); v[1]=1; for(i=2, n, p*=m; p-=frac(p); v[i]=subst(p,x,1)); v} \\ Andrew Howroyd, Jun 27 2018