login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A191756 Number of n-step four-sided prudent self-avoiding walks. 3
1, 4, 12, 36, 100, 276, 748, 2012, 5356, 14172, 37276, 97604, 254508, 661364, 1713292, 4426428, 11408300, 29339324, 75305596, 192945124, 493554916, 1260643868, 3215551292, 8191635220, 20843850764, 52980214316, 134527157780, 341268196780 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,2

REFERENCES

E. Duchi, On some classes of prudent walks, in: FPSAC'05, Taormina, Italy, 2005.

LINKS

Alois P. Heinz, Table of n, a(n) for n = 0..192

M. Bousquet-Mélou, Families of prudent self-avoiding walks, DMTCS proc. AJ, 2008, 167-180.

MAPLE

b:= proc(n, x, y, w, s, i) option remember;

      `if`(n=0, 1, `if`(y>s, b(n, x, s, w, y, i),

                     b(n-1, max(x-1, 0), y, w+1, s, evalb(x=0))+

      `if`(y=0 or i, b(n-1, max(y-1, 0), w, s+1, x, evalb(y=0)), 0)+

      `if`(s=0 or i, b(n-1, max(s-1, 0), x, y+1, w, evalb(s=0)), 0)))

    end:

a:= n-> `if`(n=0, 1, 4*b(n-1, 0, 0, 1, 0, true)):

seq(a(n), n=0..30);

MATHEMATICA

b[n_, x_, y_, w_, s_, i_] := b[n, x, y, w, s, i] = If[n == 0, 1, If[y > s, b[n, x, s, w, y, i], b[n - 1, Max[x - 1, 0], y, w + 1, s, x == 0] + If[y == 0 || i, b[n - 1, Max[y - 1, 0], w, s + 1, x, y == 0], 0] + If[s == 0 || i, b[n - 1, Max[s - 1, 0], x, y + 1, w, s == 0], 0]]];

a[n_] :=  If[n == 0, 1, 4*b[n - 1, 0, 0, 1, 0, True]];

Table[a[n], {n, 0, 30}] (* Jean-François Alcover, Jun 23 2017, translated from Maple *)

CROSSREFS

Cf. A191757, A191758.

Sequence in context: A192626 A294782 A002906 * A001411 A095350 A084776

Adjacent sequences:  A191753 A191754 A191755 * A191757 A191758 A191759

KEYWORD

nonn,walk

AUTHOR

Alois P. Heinz, Jun 15 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 | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified November 12 22:10 EST 2019. Contains 329079 sequences. (Running on oeis4.)