OFFSET
0,2
LINKS
Michael De Vlieger, Table of n, a(n) for n = 0..10000
Index entries for linear recurrences with constant coefficients, signature (1, 0, 1, -1).
FORMULA
a(n) = (12*n-3+9*cos(2*(n-1)*Pi/3)-5*sqrt(3)*sin(2*(n-1)*Pi/3))/9. - Wesley Ivan Hurt, Sep 30 2017
G.f.: (x*(2 - x + 3*x^2))/((x - 1)^2*(1 + x + x^2)). - Georg Fischer, Nov 17 2022
MAPLE
nmax:= 40: gf:= (x*(2 - x + 3*x^2))/((x - 1)^2*(1 + x + x^2)): ser:= series(gf, x, nmax + 16): seq(coeff(ser, x, i), i=0..nmax); # Georg Fischer, Nov 17 2022
MATHEMATICA
Table[Switch[Mod[n, 3], 0, 4 n/3, 1, 4 (n - 1)/3 + 2, 2, 4 (n - 2)/3 + 1], {n, 0, 71}] (* Michael De Vlieger, Sep 30 2017 *)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Paul Curtz, Oct 01 2007
STATUS
approved