login
A384730
Expansion of (1+x-2*x^2) / (1-x-6*x^2+2*x^3).
3
1, 2, 6, 16, 48, 132, 388, 1084, 3148, 8876, 25596, 72556, 208380, 592524, 1697692, 4836076, 13837180, 39458252, 112809180, 321884332, 919822908, 2625510540, 7500679324, 21414096748, 61167151612, 174650373452, 498825089628, 1424393027116, 4068042817980
OFFSET
0,2
COMMENTS
Number of walks of length n starting at vertex 0 in the following graph:
1---2
/ \ /|
0 X |
\ / \|
4---3.
EXAMPLE
a(2)=6 because we have the walks 0-1-0, 0-1-2, 0-1-3, 0-4-0, 0-4-2, 0-4-3.
MAPLE
a:= n-> (<<0|1|0|0|1>, <1|0|1|1|0>, <0|1|0|1|1>, <0|1|1|0|1>, <1|0|1|1|0>>^n. <<1, 1, 1, 1, 1>>)[1, 1]:
seq(a(n), n=0..32);
MATHEMATICA
CoefficientList[Series[(1+x-2*x^2) / (1-x-6*x^2+2*x^3), {x, 0, 32}], x]
LinearRecurrence[{1, 6, -2}, {1, 2, 6}, 33] (* Vincenzo Librandi, Oct 13 2025 *)
PROG
(Magma) I:=[1, 2, 6]; [n le 3 select I[n] else Self(n-1) + 6*Self(n-2)-2*Self(n-3): n in [1..35]]; // Vincenzo Librandi, Oct 13 2025
CROSSREFS
Cf. A384731 (vertices 1 and 4), A384732 (vertices 2 and 3).
Sequence in context: A148443 A148444 A064190 * A151281 A045694 A225178
KEYWORD
nonn,easy,walk
AUTHOR
Sean A. Irvine, Jun 05 2025
STATUS
approved