OFFSET
0,4
COMMENTS
a(n) is the sum of the upper-left and the upper-middle element of {{3,3,-4},{1,0,0},{0,1,0}}^(n-2). - Jianing Song, Aug 11 2023
LINKS
Jianing Song, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (3,3,-4).
FORMULA
G.f.: (x-2*x^2)/(1-3*x-3*x^2+4*x^3). - Jianing Song, Aug 11 2023
MAPLE
a[1]:=1: a[2]:=1: a[3]:=6: for n from 4 to 25 do a[n]:=3*a[n-1]+3*a[n-2]-4*a[n-3] od: seq(a[n], n=1..25);
MATHEMATICA
M = {{1, -2, 1}, {-2, 2, 0}, {1, 1, 0}} v[1] = {1, 0, 0} v[n_] := v[n] = M.v[n - 1]; a1 = Table[v[n][[1]], {n, 1, 50}]
PROG
(PARI) a(n) = my(Mn=[3, 3, -4; 1, 0, 0; 0, 1, 0]^(n-2)); Mn[1, 1]+Mn[1, 2] \\ Jianing Song, Aug 11 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
Roger L. Bagula, Oct 03 2006
EXTENSIONS
Edited by N. J. A. Sloane, Oct 08 2006
Added initial a(0) = 0 at the suggestion of Jianing Song. - N. J. A. Sloane, Aug 12 2023
STATUS
approved