OFFSET
0,3
COMMENTS
Construct a graph as follows: form the graph whose adjacency matrix is the tensor product of that of P_3 and [1,1;1,1], then add a loop at each of the extremity nodes. (Spectrum : [0; 1^3; (1-sqrt(33))/2;(1+sqrt(33))/2]). a(n) counts closed walks of length n at each of the internal nodes.
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (1,8).
FORMULA
a(n) = 0^n/2 + (4/sqrt(33))*( ((1 + sqrt(33))/2)^(n-1) - ((1 - sqrt(33))/2)^(n-1) ).
E.g.f.: (33 + exp(x/2)*(33*cosh(sqrt(33)*x/2) - sqrt(33)*sinh(sqrt(33)*x/2)))/66. - Stefano Spezia, Sep 08 2022
a(n) = (1/2)*[n=0] + 4*A015443(n). - G. C. Greubel, Feb 04 2023
MATHEMATICA
CoefficientList[Series[(1-x-4x^2)/(1-x-8x^2), {x, 0, 30}], x] (* Harvey P. Dale, Dec 01 2013 *)
LinearRecurrence[{1, 8}, {1, 0, 4}, 31] (* G. C. Greubel, Feb 04 2023 *)
PROG
(Magma) [1] cat [n le 2 select 4*(n-1) else Self(n-1) +8*Self(n-2): n in [1..30]]; // G. C. Greubel, Feb 04 2023
(SageMath)
def A100303(n): return (1/2)*int(n==0) + 4*lucas_number1(n-1, 1, -8)
[A100303(n) for n in range(31)] # G. C. Greubel, Feb 04 2023
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Paul Barry, Nov 12 2004
STATUS
approved