OFFSET
1,2
LINKS
Index entries for linear recurrences with constant coefficients, signature (1,0,1,-1).
FORMULA
a(n) = 2*floor((n-1)/3)+2*n-2. - Gary Detlefs, Mar 18 2010
a(n) = 2*A004773(n-1). G.f.: 2*x^2*(1+x+2*x^2)/((1+x+x^2)*(x-1)^2). - R. J. Mathar, Mar 29 2010
From Wesley Ivan Hurt, Jun 10 2016: (Start)
a(n) = a(n-1) + a(n-3) - a(n-4) for n>4.
a(n) = 2*(12*n-15-3*cos(2*n*Pi/3)+sqrt(3)*sin(2*n*Pi/3))/9.
a(3k) = 8k-4, a(3k-1) = 8k-6, a(3k-2) = 8k-8. (End)
Sum_{n>=2} (-1)^n/a(n) = (sqrt(2)-1)*Pi/16 + (2-sqrt(2))*log(2)/16 + sqrt(2)*log(sqrt(2)+2)/8. - Amiram Eldar, Dec 19 2021
MAPLE
A047464:=n->2*(12*n-15-3*cos(2*n*Pi/3)+sqrt(3)*sin(2*n*Pi/3))/9: seq(A047464(n), n=1..100); # Wesley Ivan Hurt, Jun 10 2016
MATHEMATICA
Flatten[#+{0, 2, 4}&/@(8Range[0, 20])] (* or *) LinearRecurrence[{1, 0, 1, -1}, {0, 2, 4, 8}, 80] (* Harvey P. Dale, May 04 2013 *)
PROG
(Magma) [n : n in [0..150] | n mod 8 in [0, 2, 4]]; // Wesley Ivan Hurt, Jun 10 2016
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
STATUS
approved