OFFSET
0,2
LINKS
Index entries for linear recurrences with constant coefficients, signature (2, 3, -2).
FORMULA
a(n) = 2*a(n-1) + 3*a(n-2) - 2*a(n-3).
G.f.: -(x+1) / (-2*x^3+3*x^2+2*x-1).
EXAMPLE
a => aab => aabaabaac => aabaabaacaabaabaacaabaabb, thus a(0) = 1, a(1) = 3, a(2) = 9, a(3) = 25.
MAPLE
a:= n-> (<<0|1|0>, <0|0|1>, <-2|3|2>>^n. <<0, 1, 3>>)[2, 1]:
seq (a(n), n=0..30); # Alois P. Heinz, May 06 2011
MATHEMATICA
LinearRecurrence[{2, 3, -2}, {1, 3, 9}, 30] (* Harvey P. Dale, Jan 01 2019 *)
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Jeroen F.J. Laros, Jan 22 2005
EXTENSIONS
Terms >=1577 by Alois P. Heinz, May 06 2011
STATUS
approved