OFFSET
1,2
COMMENTS
a(n) equals the number of words of length n-1 over {0,1,2,3,4,5} avoiding 01, 02 and 03. - Milan Janjic, Dec 17 2015
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (6,-3).
FORMULA
Limit_{n->oo} a(n)/a(n-1) = 3 + sqrt(6) = 5.44948974...
a(n) = ((3+sqrt(6))^n - (3-sqrt(6))^n)/(2*sqrt(6)). - Alexander R. Povolotsky, Apr 01 2008
a(n) = lower left term of n-th power of 2 X 2 matrix [1,2; 1,5].
G.f.: 1/(1 - 6*x + 3*x^2). - Philippe Deléham, Sep 09 2009
a(n) = Chebyshev_U(n, sqrt(3))*(sqrt(3))^n. - Paul Barry, Sep 28 2009
EXAMPLE
a(5) = 981 = 6*a(4) - 3*a(3) = 6*180 - 3*33.
MATHEMATICA
a[n_]:=(MatrixPower[{{1, 2}, {1, 5}}, n].{{1}, {1}})[[2, 1]]; Table[a[n], {n, 0, 40}] (* Vladimir Joseph Stephan Orlovsky, Feb 19 2010 *)
LinearRecurrence[{6, -3}, {1, 6}, 30] (* Harvey P. Dale, Jan 18 2012 *)
PROG
(Magma) I:=[1, 6]; [n le 2 select I[n] else 6*Self(n-1)-3*Self(n-2): n in [1..30]]; // Vincenzo Librandi, Dec 17 2015
(PARI) Vec(1/(1-6*x+3*x^2) + O(x^100)) \\ Altug Alkan, Dec 17 2015
(SageMath)
A138395=BinaryRecurrenceSequence(6, -3, 0, 1)
[A138395(n) for n in range(1, 30)] # G. C. Greubel, Jan 10 2024
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Gary W. Adamson, Mar 19 2008
EXTENSIONS
More terms from Philippe Deléham, Sep 09 2009
a(21) and first formula corrected by Klaus Brockhaus, Oct 05 2009
Extended by T. D. Noe, May 23 2011
STATUS
approved