|
|
A278394
|
|
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 {-2,-1,1,2}.
|
|
7
|
|
|
1, 2, 5, 17, 58, 209, 761, 2823, 10557, 39833, 151147, 576564, 2208163, 8486987, 32714813, 126430229, 489685674, 1900350201, 7387530575, 28763059410, 112142791763, 437774109384, 1710883748796, 6693281604018, 26210038447737, 102724200946467, 402925631267151
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,2
|
|
COMMENTS
|
By convention, the empty walk (corresponding to n=0) is considered to be a positive meander.
|
|
LINKS
|
|
|
MATHEMATICA
|
frac[ex_] := Select[ex, Exponent[#, x] < 0&];
seq[n_] := Module[{v, m, p}, v = Table[0, n]; m = Sum[x^i, {i, -2, 2}] - 1; 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];
|
|
PROG
|
(PARI) seq(n)={my(v=vector(n), m=sum(i=-2, 2, x^i)-1, 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
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,walk
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|