OFFSET
0,5
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (4,0,-1,4).
FORMULA
a(n+1) - 4*a(n) = hexaperiodic 0, 0, 1, 0, 0, -1, A131531.
a(n) + a(n+3) = 1, 4, 16, 64 = 2^2n = A000302.
a(n) = (1/65)*4^n + (1/15)*(-1)^(n+1) + (2/39)*cos((Pi*n)/3) - (4*sqrt(3)/39) * sin((Pi*n)/3). Or, a(n) = (1/65)*(4^n + [ -1; -4; -16; 1; 4; 16]). - Richard Choulet, Dec 31 2007
O.g.f.: -x^3/[(4*x-1)*(1+x)*(x^2-x+1)]. - R. J. Mathar, Jan 07 2008
MATHEMATICA
a = {0, 0, 0, 1, 4}; Do[AppendTo[a, 3*a[[ -1]] + 4*a[[ -2]] - a[[ -3]] + 3*a[[ -4]] + 4*a[[ -5]]], {25}]; a (* Stefan Steinerberger, Dec 31 2007 *)
LinearRecurrence[{3, 4, -1, 3, 4}, {0, 0, 0, 1, 4}, 25] (* G. C. Greubel, Oct 14 2016 *)
LinearRecurrence[{4, 0, -1, 4}, {0, 0, 0, 1}, 40] (* Harvey P. Dale, Jan 31 2021 *)
PROG
(PARI) a(n)=([0, 1, 0, 0; 0, 0, 1, 0; 0, 0, 0, 1; 4, -1, 0, 4]^n*[0; 0; 0; 1])[1, 1] \\ Charles R Greathouse IV, Oct 14 2016
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Paul Curtz, Dec 14 2007
EXTENSIONS
More terms from Stefan Steinerberger, Dec 31 2007
STATUS
approved