OFFSET
0,2
COMMENTS
Number of walks of length n starting at vertex 1 in the following graph:
1---2
/|\ /|
0 | X |
\|/ \|
4---3.
Also, by symmetry, the number of walks of length n starting at 4 in the same graph.
LINKS
Harvey P. Dale, Table of n, a(n) for n = 0..1000
Sean A. Irvine, Walks on Graphs.
Index entries for linear recurrences with constant coefficients, signature (2,5,-2).
EXAMPLE
a(2)=12 because we have the walks 1-0-1, 1-0-4, 1-2-1, 1-2-3, 1-2-4, 1-3-1, 1-3-2, 1-3-4, 1-4-0, 1-4-1, 1-4-2, 1-4-3.
MAPLE
a:= n-> (<<0|1|0|0|1>, <1|0|1|1|1>, <0|1|0|1|1>, <0|1|1|0|1>, <1|1|1|1|0>>^n. <<1, 1, 1, 1, 1>>)[2, 1]:
seq(a(n), n=0..32);
MATHEMATICA
CoefficientList[Series[(1+2*x-x^2) / (1-2*x-5*x^2+2*x^3), {x, 0, 32}], x]
LinearRecurrence[{2, 5, -2}, {1, 4, 12}, 30] (* Harvey P. Dale, Aug 30 2025 *)
CROSSREFS
KEYWORD
nonn,easy,walk
AUTHOR
Sean A. Irvine, Jun 05 2025
STATUS
approved
