OFFSET
0,2
LINKS
Ilya Gutkovskiy, Illustration
Index entries for linear recurrences with constant coefficients, signature (1,0,1,-1).
FORMULA
O.g.f.: x*(3 - 2*x + x^2)/((1 - x)^2*(1 + x + x^2)).
E.g.f.: 2*(3*x*exp(x) + 3*exp(x) - exp(-x/2)*(3*cos((sqrt(3)*x)/2) - 4*sqrt(3)*sin((sqrt(3)*x)/2)))/9.
a(n) = a(n-1) + a(n-3) - a(n-4) for n>3.
a(n) = 2*(3*n + 4*sqrt(3)*sin((2*Pi*n)/3) - 3*cos((2*Pi*n)/3) + 3)/9.
a(n) = 3*n - 2*floor(n/3) - 5*floor((n + 1)/3). - Vaclav Kotesovec, Apr 22 2016
a(n) mod 2 = A011655(n).
MAPLE
A272071:=proc(n) option remember;
if n=0 then 0 elif n=1 then 3 elif n=2 then 1 elif n=3 then 2 else
a(n-1)+a(n-3)-a(n-4); fi; end: seq(A272071(n), n=0..150); # Wesley Ivan Hurt, Apr 20 2016
MATHEMATICA
LinearRecurrence[{1, 0, 1, -1}, {0, 3, 1, 2}, 80]
Table[2 ((3 n + 4 Sqrt[3] Sin[(2 Pi n)/3] - 3 Cos[(2 Pi n)/3] + 3)/9), {n, 0, 79}]
CoefficientList[Series[x*(3 - 2*x + x^2)/((1 - x)^2*(1 + x + x^2)), {x, 0, 100}], x] (* Wesley Ivan Hurt, Apr 20 2016 *)
PROG
(PARI) concat(0, Vec(x*(3-2*x+x^2)/((1-x)^2*(1+x+x^2)) + O(x^99))) \\ Altug Alkan, Apr 22 2016
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Ilya Gutkovskiy, Apr 19 2016
STATUS
approved