OFFSET
0,3
COMMENTS
LINKS
R. J. Mathar, Counting Walks on Finite Graphs, Section 1.
Index entries for linear recurrences with constant coefficients, signature (0,4).
FORMULA
a(n) = 2^(n-2)*(1+(-1)^n), n>=2, a(0)=1.
O.g.f.: (1-2*x^2)/(1-(2*x)^2).
E.g.f.: 1+(1 + 2*x^2/(U(0) - 2*x^2 + 1))*x^2 where U(k)= 4*k+5 + 2*x^2/(1 + (2*k+3)*(k+2)/U(k+1)) ; (continued fraction, 3rd kind, 2-step). - Sergei N. Gladkovskii, Oct 28 2012
EXAMPLE
a(4)=8 from the eight round trips of length 4 (starting from, say, vertex no. 1): 12121, 14141, 12141, 14121, 12321, 14341, 12341 and 14321.
MATHEMATICA
CoefficientList[Series[(1 - 2 x^2)/(1 - (2 x)^2), {x, 0, 40}], x] (* or *) Riffle[Join[{1}, NestList[4#&, 2, 20]], 0] (* or *) LinearRecurrence[ {0, 4}, {1, 0, 2}, 80] (* Harvey P. Dale, Dec 04 2015 *)
CROSSREFS
KEYWORD
nonn,easy,walk
AUTHOR
Wolfdieter Lang, Nov 08 2011
STATUS
approved