OFFSET
0,3
LINKS
Index entries for linear recurrences with constant coefficients, signature (0,1,0,0,0,1,0,-1).
FORMULA
a(n) = a(n-2) + a(n-6) - a(n-8).
From Robert Israel, Aug 22 2014: (Start)
a(n) = sqrt(3)/18*(sin(2*n*Pi/3)+sin(n*Pi/3)) + 1/6*(cos(2*n*Pi/3)-cos(n*Pi/3)) + (-1)^n*(2+n)/12 + 5*(n+2)/12.
G.f.: (1 + x + x^2 + x^3 + x^4)/(1 - x^2 - x^6 + x^8). (End)
a(n) = 1 + n/2 if n is even, otherwise a(n) = 1 + floor(n/3). - Bruno Berselli, Aug 22 2014
MATHEMATICA
Table[Floor[(2 n + 6)/(5 - (-1)^n)], {n, 0, 100}]
LinearRecurrence[{0, 1, 0, 0, 0, 1, 0, -1}, {1, 1, 2, 2, 3, 2, 4, 3}, 80] (* Harvey P. Dale, Oct 24 2017 *)
PROG
(Magma) [Floor((2*n+6)/(5-(-1)^n)) : n in [0..100]];
(Magma) [IsEven(n) select 1+n/2 else 1+Floor(n/3): n in [0..80]]; // Bruno Berselli, Aug 22 2014
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Wesley Ivan Hurt, Aug 21 2014
STATUS
approved