OFFSET
1,2
LINKS
Index entries for linear recurrences with constant coefficients, signature (1,0,1,-1).
FORMULA
G.f.: x^2*(2+x+3*x^2) / ((1+x+x^2)*(x-1)^2). - R. J. Mathar, Oct 08 2011
From Wesley Ivan Hurt, Jun 13 2016: (Start)
a(n) = a(n-1) + a(n-3) - a(n-4) for n>4.
a(n) = (6*n-7-2*cos(2*n*Pi/3))/3.
a(3k) = 6k-3, a(3k-1) = 6k-4, a(3k-2) = 6k-6. (End)
E.g.f.: (9 + (6*x - 7)*exp(x) - 2*cos(sqrt(3)*x/2)*(cosh(x/2) - sinh(x/2)))/3. - Ilya Gutkovskiy, Jun 14 2016
Sum_{n>=2} (-1)^n/a(n) = (3-sqrt(3))*Pi/18 + log(2+sqrt(3))/(2*sqrt(3)) + log(2)/3. - Amiram Eldar, Dec 14 2021
MAPLE
MATHEMATICA
Select[Range[0, 200], Mod[#, 6] == 0 || Mod[#, 6] == 2 || Mod[#, 6] == 3 &] (* Vladimir Joseph Stephan Orlovsky, Jul 07 2011 *)
Select[Range[0, 200], MemberQ[{0, 2, 3}, Mod[#, 6]] &] (* Vincenzo Librandi, Oct 02 2015 *)
LinearRecurrence[{1, 0, 1, -1}, {2, 3, 6, 8}, {0, 20}] (* Eric W. Weisstein, Apr 09 2018 *)
CoefficientList[Series[x (2 + x + 3 x^2)/((-1 + x)^2 (1 + x + x^2)), {x, 0, 20}], x] (* Eric W. Weisstein, Apr 09 2018 *)
Table[(6 n + Cos[2 n Pi/3] + Sqrt[3] Sin[2 n Pi/3] - 1)/3, {n, 0, 20}] (* Eric W. Weisstein, Apr 09 2018 *)
PROG
(PARI) isok(n) = my(m = n % 6); (m==0) || (m==2) || (m==3); \\ Michel Marcus, Oct 02 2015
(Magma) [n : n in [0..130] | n mod 6 in [0, 2, 3]]; // Vincenzo Librandi, Oct 02 2015
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
STATUS
approved