This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A006851 M2560 #39 Nov 29 2023 11:41:47 %S A006851 1,3,6,12,24,48,96,186,360,696,1344,2562,4872,9288,17664,33384,63120, %T A006851 119280,225072,423630,797400,1499256,2817216,5286480,9918768,18592080, %U A006851 34840848,65228874,122105496,228402168,427176336,798373662,1491985800,2786515176,5203816992,9712725234,18127267800 %N A006851 Trails of length n on honeycomb lattice. %D A006851 N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence). %H A006851 Alois P. Heinz, <a href="/A006851/b006851.txt">Table of n, a(n) for n = 0..43</a> %H A006851 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 A006851 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 A006851 a:= proc(n) option remember; local v, b; %p A006851 if n<2 then return 1 +2*n fi; %p A006851 v:= proc() false end: v(1, 0):= true; %p A006851 b:= proc(n, d, x, y) local c; %p A006851 if v(x, y) then `if`(n>0 or [x, y, d]=[1, 0, 1], 0, 1) %p A006851 elif n=0 then 1 %p A006851 else v(x, y):= true; %p A006851 c:= b(n-1, [$2..6, 1][d], x+[0, -1, -1, 0, 1, 1][d], %p A006851 y+[1, 1, 0, -1, -1, 0][d])+ %p A006851 b(n-1, [6, $1..5][d], x+[1, 1, 0, -1, -1, 0][d], %p A006851 y+[-1, 0, 1, 1, 0, -1][d]); %p A006851 v(x, y):= false; c %p A006851 fi %p A006851 end; %p A006851 6*b(n-2, 2, 1, 1) %p A006851 end: %p A006851 seq(a(n), n=0..20); # _Alois P. Heinz_, Jul 08 2011 %t A006851 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 A006851 Cf. A001668. %K A006851 nonn,walk %O A006851 0,2 %A A006851 _N. J. A. Sloane_