login
Trails of length n on honeycomb lattice.
(Formerly M2560)
4

%I M2560 #39 Nov 29 2023 11:41:47

%S 1,3,6,12,24,48,96,186,360,696,1344,2562,4872,9288,17664,33384,63120,

%T 119280,225072,423630,797400,1499256,2817216,5286480,9918768,18592080,

%U 34840848,65228874,122105496,228402168,427176336,798373662,1491985800,2786515176,5203816992,9712725234,18127267800

%N Trails of length n on honeycomb lattice.

%D N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

%H Alois P. Heinz, <a href="/A006851/b006851.txt">Table of n, a(n) for n = 0..43</a>

%H H. Duminil-Copin and S. Smirnov, <a href="http://arxiv.org/abs/1007.0575">The connective constant of the honeycomb lattice equals sqrt(2+sqrt(2))</a>, arXiv:1007.0575 [math-ph], 2010-2011.

%H A. J. Guttmann, <a href="http://dx.doi.org/10.1088/0305-4470/18/4/009">Lattice trails II: numerical results</a>, J. Phys. A 18 (1985), 575-588.

%p a:= proc(n) option remember; local v, b;

%p if n<2 then return 1 +2*n fi;

%p v:= proc() false end: v(1, 0):= true;

%p b:= proc(n, d, x, y) local c;

%p if v(x, y) then `if`(n>0 or [x, y, d]=[1, 0, 1], 0, 1)

%p elif n=0 then 1

%p else v(x, y):= true;

%p c:= b(n-1, [$2..6, 1][d], x+[0, -1, -1, 0, 1, 1][d],

%p y+[1, 1, 0, -1, -1, 0][d])+

%p b(n-1, [6, $1..5][d], x+[1, 1, 0, -1, -1, 0][d],

%p y+[-1, 0, 1, 1, 0, -1][d]);

%p v(x, y):= false; c

%p fi

%p end;

%p 6*b(n-2, 2, 1, 1)

%p end:

%p seq(a(n), n=0..20); # _Alois P. Heinz_, Jul 08 2011

%t 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_ *)

%Y Cf. A001668.

%K nonn,walk

%O 0,2

%A _N. J. A. Sloane_