The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A191826 Number of n-step three-sided prudent self-avoiding walks ending on the left side of their box. 6
1, 3, 7, 18, 45, 114, 286, 721, 1812, 4558, 11449, 28757, 72172, 181074, 454043, 1138082, 2851369, 7141220, 17878222, 44743249, 111939780, 279966725, 700000634, 1749720020, 4372423409, 10923598469, 27283760095, 68130718351, 170093054202 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,2
LINKS
Mireille Bousquet-Mélou, Families of prudent self-avoiding walks, DMTCS proc. AJ, 2008, 167-180.
Mireille Bousquet-Mélou, Families of prudent self-avoiding walks, arXiv:0804.4843 [math.CO], 2008-2009.
Enrica Duchi, On some classes of prudent walks, in: FPSAC'05, Taormina, Italy, 2005.
EXAMPLE
a(3) = 18: ENW, NNN, NNW, NWN, NWW, NWS, WNN, WNW, WWN, WWW, WWS, WSW, WSS, SWN, SWW, SWS, SSW, SSS.
MAPLE
b:= proc(d, i, n, x, y, w) option remember;
`if`(w>n, 0, `if`(n=0, `if`(w=0, 1, 0),
`if`(d in [0, 1] or d<>3 and x=0 or d=2 and i,
b(1, evalb(x=0), n-1, max(x-1, 0), y, w+1), 0) +
`if`(d in [0, 2] or d<>4 and (y=0 or i),
b(2, evalb(y=0), n-1, x, max(y-1, 0), w), 0) +
`if`(d in [0, 3] or d<>1 and w=0 or d=2 and i,
b(3, evalb(w=0), n-1, x+1, y, max(w-1, 0)), 0) +
`if`(d in [0, 4] or d<>2 and i,
b(4, false, n-1, x, y+1, w), 0)))
end:
a:= n-> b(0, true, n, 0, 0, 0):
seq(a(n), n=0..30);
MATHEMATICA
b[d_, i_, n_, x_, y_, w_] := b[d, i, n, x, y, w] = If[w > n, 0, If[n == 0, If[w == 0, 1, 0], If[MatchQ[d, 0|1] || d != 3 && x == 0 || d == 2 && i, b[1, x == 0, n-1, Max[x-1, 0], y, w+1], 0] + If[MatchQ[d, 0|2] || d != 4 && (y == 0 || i), b[2, y == 0, n-1, x, Max[y-1, 0], w], 0]+ If[MatchQ[d, 0|3] || d != 1 && w == 0 || d == 2 && i, b[3, w == 0, n-1, x+1, y, Max[w-1, 0]], 0] + If[MatchQ[d, 0|4] || d != 2 && i, b[4, s == 0, n-1, x, y+1, w], 0]]]; a[n_] := b[0, True, n, 0, 0, 0]; Table[a[n], {n, 0, 30}] (* Jean-François Alcover, Dec 22 2014, after Alois P. Heinz *)
CROSSREFS
Sequence in context: A036883 A247296 A191652 * A318899 A114713 A078058
KEYWORD
nonn,walk
AUTHOR
Alois P. Heinz, Jun 17 2011
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 29 04:26 EDT 2024. Contains 372921 sequences. (Running on oeis4.)