OFFSET
1,2
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..5000
Index entries for linear recurrences with constant coefficients, signature (1,0,1,-1).
FORMULA
From Colin Barker, Mar 13 2012: (Start)
G.f.: x^2*(3+2*x+x^2)/((1-x)^2*(1+x+x^2)).
a(n) = a(n-1) + a(n-3) - a(n-4) for n>4. (End)
From Wesley Ivan Hurt, Jun 13 2016: (Start)
a(n) = (6*n-4+cos(2*n*Pi/3)-sqrt(3)*sin(2*Pi*n/3))/3.
a(3k) = 6k-1, a(3k-1) = 6k-3, a(3k-2) = 6k-6. (End)
Sum_{n>=2} (-1)^n/a(n) = log(2)/6 + log(2+sqrt(3))/(2*sqrt(3)) - Pi/12. - Amiram Eldar, Dec 14 2021
EXAMPLE
G.f. = 3*x^2 + 5*x^3 + 6*x^4 + 9*x^5 + 11*x^6 + 12*x^7 +15*x^8 + 17*x^9 + ...
MAPLE
A047271:=n->(6*n-4+cos(2*n*Pi/3)-sqrt(3)*sin(2*Pi*n/3))/3: seq(A047271(n), n=1..100); # Wesley Ivan Hurt, Jun 13 2016
MATHEMATICA
Select[Range[0, 120], MemberQ[{0, 3, 5}, Mod[#, 6]]&] (* Vincenzo Librandi, Apr 26 2012 *)
PROG
(Magma) I:=[0, 3, 5, 6]; [n le 4 select I[n] else Self(n-1)+Self(n-3)-Self(n-4): n in [1..70]]; // Vincenzo Librandi, Apr 26 2012
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
EXTENSIONS
G.f. corrected by Colin Barker, May 14 2012
STATUS
approved