OFFSET
1,1
COMMENTS
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (9,-27,27).
FORMULA
Let M = the 3 X 3 matrix [3 0 0 / 2 3 0 / 1 2 3]; then M^n * [1 1 1] = [3^n A081038(n) a(n)], where a(n) - A081038(n) = A077616(n).
From Colin Barker, Nov 09 2012: (Start)
a(n) = 3^(n-2)*(9 + 7*n + 2*n^2).
a(n) = 9*a(n-1) - 27*a(n-2) + 27*a(n-3).
G.f.: x*(6 - 23*x + 27*x^2)/(1-3*x)^3. (End)
E.g.f.: -1 + (1 + 3*x + 2*x^2)*exp(3*x). - G. C. Greubel, Jun 06 2019
EXAMPLE
MATHEMATICA
a[n_] := (MatrixPower[{{3, 0, 0}, {2, 3, 0}, {1, 2, 3}}, n].{{1}, {1}, {1}})[[3, 1]]; Table[ a[n], {n, 23}] (* Robert G. Wilson v, Jun 05 2004 *)
Table[3^(n-2)*(9+7*n+2*n^2), {n, 1, 30}] (* G. C. Greubel, Jun 06 2019 *)
PROG
(PARI) vector(30, n, 3^(n-2)*(9+7*n+2*n^2)) \\ G. C. Greubel, Jun 06 2019
(Magma) [3^(n-2)*(9+7*n+2*n^2): n in [1..30]]; // G. C. Greubel, Jun 06 2019
(Sage) [3^(n-2)*(9+7*n+2*n^2) for n in (1..30)] # G. C. Greubel, Jun 06 2019
(GAP) List([1..30], n-> 3^(n-2)*(9+7*n+2*n^2)) # G. C. Greubel, Jun 06 2019
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Gary W. Adamson, May 26 2004
EXTENSIONS
Edited and extended by Robert G. Wilson v, Jun 05 2004
STATUS
approved