OFFSET
0,2
LINKS
Ilya Gutkovskiy, Expanded graphical example
Index entries for linear recurrences with constant coefficients, signature (0,0,2,0,0,-1).
FORMULA
G.f.: (1 + 2*x + 3*x^2 + x^3 + x^5)/(1 - x^3)^2.
a(3*n) + a(3*n+1) = a(3*n+2).
a(n) = (8*(n+1) + (1-2*n)*cos(2*n*Pi/3) + sqrt(3)*(3-2*n)*sin(2*n*Pi/3))/9.
a(n) = 1 + n + (1-2*n)*floor(n/3)/3 + 2*(n-2)*floor((n+1)/3)/3. - Vaclav Kotesovec, Feb 25 2016
EXAMPLE
a(0) = 1;
a(1) = 2;
a(2) = 1 + 2 = 3;
a(3) = 3;
a(4) = 4;
a(5) = 3 + 4 = 7,
a(6) = 5;
a(7) = 6;
a(8) = 5 + 6 = 11, etc.
MATHEMATICA
LinearRecurrence[{0, 0, 2, 0, 0, -1}, {1, 2, 3, 3, 4, 7}, 78]
CoefficientList[Series[(1 + 2 x + 3 x^2 + x^3 + x^5)/(1 - x^3)^2, {x, 0, 77}], x]
Table[(8 (n + 1) + (1 - 2 n) Cos[2 n (Pi/3)] + Sqrt[3] (3 - 2 n) Sin[2 n (Pi/3)])/9, {n, 0, 77}]
PROG
(PARI) Vec((1 + 2*x + 3*x^2 + x^3 + x^5)/(1 - x^3)^2 + O(x^80)) \\ Michel Marcus, Feb 20 2016
(Magma) I:=[1, 2, 3, 3, 4, 7]; [n le 6 select I[n] else 2*Self(n-3)-Self(n-6): n in [1..70]]; // Vincenzo Librandi, Feb 20 2016
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Ilya Gutkovskiy, Feb 19 2016
STATUS
approved