OFFSET
0,2
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (3,0,-1,3).
FORMULA
Also a(n) - 3^(n+1) = hexaperiodic 1, -1, -3, -1, 1, 3; cf. A132951.
From R. J. Mathar, Apr 04 2008: (Start)
O.g.f.: (1-x+3*x^3)/((1-3*x)*(1+x)*(x^2-x+1)).
a(n) = -(-1)^n/12 + 3^(n+1)/4 + A057079(n+2)/3. (End)
MATHEMATICA
LinearRecurrence[{3, 0, -1, 3}, {1, 2, 6, 20}, 50] (* G. C. Greubel, Jan 15 2018 *)
PROG
(PARI) x='x+O('x^30); Vec((1-x+3*x^3)/((1-3*x)*(1+x)*(x^2-x+1))) \\ G. C. Greubel, Jan 15 2018
(Magma) I:=[1, 2, 6, 20]; [n le 4 select I[n] else 3*Self(n-1) - Self(n-3) + 3*Self(n-4): n in [1..30]]; // G. C. Greubel, Jan 15 2018
CROSSREFS
KEYWORD
nonn
AUTHOR
Paul Curtz, Nov 24 2007
EXTENSIONS
More terms from R. J. Mathar, Apr 04 2008
STATUS
approved