OFFSET
0,2
REFERENCES
N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..43
H. Duminil-Copin and S. Smirnov, The connective constant of the honeycomb lattice equals sqrt(2+sqrt(2)), arXiv:1007.0575 [math-ph], 2010-2011.
A. J. Guttmann, Lattice trails II: numerical results, J. Phys. A 18 (1985), 575-588.
MAPLE
a:= proc(n) option remember; local v, b;
if n<2 then return 1 +2*n fi;
v:= proc() false end: v(1, 0):= true;
b:= proc(n, d, x, y) local c;
if v(x, y) then `if`(n>0 or [x, y, d]=[1, 0, 1], 0, 1)
elif n=0 then 1
else v(x, y):= true;
c:= b(n-1, [$2..6, 1][d], x+[0, -1, -1, 0, 1, 1][d],
y+[1, 1, 0, -1, -1, 0][d])+
b(n-1, [6, $1..5][d], x+[1, 1, 0, -1, -1, 0][d],
y+[-1, 0, 1, 1, 0, -1][d]);
v(x, y):= false; c
fi
end;
6*b(n-2, 2, 1, 1)
end:
seq(a(n), n=0..20); # Alois P. Heinz, Jul 08 2011
MATHEMATICA
a[n_] := a[n] = Module[{v, b}, If[n<2, Return[1+2*n]]; v[_, _] = False; v[1, 0] = True; b[n0_, d_, x_, y_] := Module[{c}, Which[v[x, y], If[n0>0 || {x, y, d} == {1, 0, 1}, 0, 1], n0 == 0, 1, True, v[x, y] = True; c = b[n0-1, {2, 3, 4, 5, 6, 1}[[d]], x+{0, -1, -1, 0, 1, 1}[[d]], y+{1, 1, 0, -1, -1, 0}[[d]]] + b[n0-1, {6, 1, 2, 3, 4, 5}[[d]], x+{1, 1, 0, -1, -1, 0}[[d]], y+{-1, 0, 1, 1, 0, -1}[[d]]]; v[x, y] = False; c]]; 6*b[n-2, 2, 1, 1]]; Table[Print[a[n]]; a[n], {n, 0, 25}] (* Jean-François Alcover, Mar 20 2014, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn,walk
AUTHOR
STATUS
approved