OFFSET
0,2
COMMENTS
a(n,k) is the number of one-sided n-step prudent walks, avoiding k or more consecutive east steps; k=4 in this sequence.
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..1000
Shanzhen Gao and Keh-Hsun Chen, Tackling Sequences From Prudent Self-Avoiding Walks, FCS'14, The 2014 International Conference on Foundations of Computer Science.
S. Gao and H. Niederhausen, Sequences Arising From Prudent Self-Avoiding Walks, 2010.
Index entries for linear recurrences with constant coefficients, signature (2, 1, 0, 0, -1).
FORMULA
G.f.: (1+t-t^k)/(1-2*t-t^2+t^(k+1)), (k=4 in this sequence).
MAPLE
b:= proc(n, i) option remember; `if`(n<0, 0,
`if`(n=0, 1, b(n-1, 0) +`if`(i<=0, b(n-1, -1), 0)+
`if`(i>=0 and i<3, b(n-1, i+1), 0)))
end:
a:= n-> b(n, 0):
seq(a(n), n=0..30); # Alois P. Heinz, Jun 04 2011
MATHEMATICA
(1+t-t^k)/(1-2*t-t^2+t^(k+1)) /. k -> 4 + O[t]^25 // CoefficientList[#, t]& (* Jean-François Alcover, Oct 24 2016 *)
CROSSREFS
KEYWORD
nonn,walk
AUTHOR
Shanzhen Gao, May 09 2011
STATUS
approved