OFFSET
0,3
COMMENTS
For n>0, a(n) equals the number of words of length n-1 over {0,1,...,8} in which 0 and 1 avoid runs of odd lengths. - Milan Janjic, Jan 08 2017
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (7,2).
FORMULA
a(n) = 7*a(n-1) + 2*a(n-2).
E.g.f.: (exp(x*(7 + sqrt(57))/2) - exp(x*(7 - sqrt(57))/2))/sqrt(57). - Iain Fox, Dec 30 2017
MATHEMATICA
Join[{a=0, b=1}, Table[c=7*b+2*a; a=b; b=c, {n, 100}]] (* Vladimir Joseph Stephan Orlovsky, Jan 17 2011 *)
LinearRecurrence[{7, 2}, {0, 1}, 30] (* Vincenzo Librandi Nov 13 2012 *)
PROG
(Sage) [lucas_number1(n, 7, -2) for n in range(0, 21)] # Zerinvary Lajos, Apr 24 2009
(Magma) [n le 2 select n-1 else 7*Self(n-1) + 2*Self(n-2): n in [1..30]]; // Vincenzo Librandi, Nov 13 2012
(PARI) x='x+O('x^30); concat([0], Vec(x/(1-7*x-2*x^2))) \\ G. C. Greubel, Dec 30 2017
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
STATUS
approved