login
A138395
a(n) = 6*a(n-1) - 3*a(n-2), a(1) = 1, a(2) = 6.
10
1, 6, 33, 180, 981, 5346, 29133, 158760, 865161, 4714686, 25692633, 140011740, 762992541, 4157920026, 22658542533, 123477495120, 672889343121, 3666903573366, 19982753410833, 108895809744900, 593426598236901, 3233872160186706, 17622953166409533
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
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
Sequence in context: A111994 A092851 A137627 * A050151 A009162 A012718
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