OFFSET
1,2
COMMENTS
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (9,-9,1).
FORMULA
From R. J. Mathar, Aug 22 2008: (Start)
O.g.f.: x*(1-6x+x^2)/((1-x)*(1-8x+x^2)).
EXAMPLE
a(4) = 145 = 9*19 - 9*3 + 1.
a(4) = 145, leftmost term in M^4 * [1 0 0] = [145 352 640].
MAPLE
a:= n-> (<<1|1|1>, <1|2|3>, <1|3|6>>^n)[1$2]:
seq(a(n), n=1..23); # Alois P. Heinz, Jun 06 2021
MATHEMATICA
a[n_] := (MatrixPower[{{1, 1, 1}, {1, 2, 3}, {1, 3, 6}}, n].{{1}, {0},
{0}})[[1, 1]]; Table[ a[n], {n, 20}]; (* Robert G. Wilson v, May 29 2004 *)
nxt[{a_, b_, c_}]:={b, c, 9c-9b+a}; NestList[nxt, {1, 3, 19}, 30][[All, 1]] (* Harvey P. Dale, Sep 02 2022 *)
PROG
(PARI) Vec(x*(1-6*x+x^2)/((1-x)*(1-8*x+x^2)) + O(x^20)) \\ Michel Marcus, Mar 21 2015
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Gary W. Adamson, May 27 2004
EXTENSIONS
Edited and extended by Robert G. Wilson v, May 29 2004
Edited by Georg Fischer, Jun 06 2021
STATUS
approved