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

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A272265 Number of n-step tri-directional self-avoiding walks on the hexagonal lattice. 1
1, 3, 9, 21, 51, 123, 285, 669, 1569, 3603, 8343, 19335, 44193, 101577, 233697, 532569, 1218345, 2789475, 6343161, 14464101, 33004269, 74923059, 170440203, 387945747, 879473277, 1997066751, 4536975315, 10273846185 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,2

COMMENTS

Only 3 directions are allowed, separated by 120 degrees.

  o

  x

o   o

LINKS

Table of n, a(n) for n=0..27.

MATHEMATICA

mo={{2, 0}, {-1, 1}, {-1, -1}}; a[0]=1;

a[tg_, p_:{{0, 0}}] := Block[{e, mv = Complement[Last[p]+# & /@ mo, p]}, If[tg == 1, Length@mv, Sum[a[tg-1, Append[p, e]], {e, mv}]]];

a /@ Range[0, 10]

(* Robert FERREOL, Nov 28 2018; after the program of Giovanni Resta in A001411 *)

PROG

(Python)

def add(L, x):

... M=[y for y in L]; M.append(x)

... return(M)

plus=lambda L, M : [x+y for x, y in zip(L, M)]

mo=[[2, 0], [-1, 1], [-1, -1]]

def a(n, P=[[0, 0]]):

... if n==0: return(1)

... mv1 = [plus(P[-1], x) for x in mo]

... mv2=[x for x in mv1 if x not in P]

... if n==1: return(len(mv2))

... else: return(sum(a(n-1, add(P, x)) for x in mv2))

[a(n) for n in range(11)]

# Robert FERREOL, Nov 30 2018

CROSSREFS

Cf. A001334.

Sequence in context: A262444 A109755 A005254 * A191796 A007056 A026551

Adjacent sequences:  A272262 A272263 A272264 * A272266 A272267 A272268

KEYWORD

nonn,walk

AUTHOR

Francois Alcover, May 05 2016

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 October 18 05:14 EDT 2019. Contains 328145 sequences. (Running on oeis4.)