OFFSET
0,3
COMMENTS
Form a graph from a triangle and its midpoint triangle. This sequence counts closed walks of length n at a vertex of the original triangle.
LINKS
Index entries for linear recurrences with constant coefficients, signature (1,7,2,-4).
FORMULA
G.f.: (1-x-5*x^2-2*x^3)/((1+x-x^2)*(1-2*x-4*x^2));
a(n) = (2^n/3+2*(-1)^n/3)*(((1+sqrt(5))/2)^(n-1)/sqrt(5)-((1-sqrt(5))/2)^(n-1)/sqrt(5)).
a(n) = a(n-1)+7*a(n-2)+2*a(n-3)-4*a(n-4). - Wesley Ivan Hurt, Apr 23 2021
MATHEMATICA
LinearRecurrence[{1, 7, 2, -4}, {1, 0, 2, 2}, 30] (* Harvey P. Dale, Sep 01 2023 *)
PROG
(Magma) [(2^n + 2*(-1)^n)*Fibonacci(n-1)/3 : n in [0..30]]; // Wesley Ivan Hurt, Apr 23 2021
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Paul Barry, Mar 22 2004
STATUS
approved