OFFSET
0,2
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (1,0,1,-1).
FORMULA
a(3n) = n-1; a(3n+1) = n+1; a(3n+2) = n+3. Or, a(n) = 1 + a(n-3). - Alex Meiburg, Aug 21 2010
a(n) = a(n-1) + a(n-3) - a(n-4) = (n + 3 + 5*A049347(n-1))/3. - R. J. Mathar, Aug 21 2010
G.f.: (1+2*x+x^3-3*x^2)/((1+x+x^2)*(x-1)^2). - R. J. Mathar, Aug 21 2010
a(n) = 1 + n/3 - (5*I/9)*sqrt(3)*(-1/2+(I/2)*sqrt(3))^n + (5*I/9)*sqrt(3)*(-1/2-(I/2)*sqrt(3))^n for each n >= 0. - Alexander R. Povolotsky, Aug 21 2010
a(n) = (3*n+9+10*sqrt(3)*sin(2*n*Pi/3))/9. - Wesley Ivan Hurt, Oct 01 2017
EXAMPLE
Taking the first 3 terms doesn't give 3 consecutive integers as they are 0, 1 and ... 3. But if you take the fourth term (2), you'll have in hand 0,1,2 [and even another triple of consecutive integers, which is (1,2,3)].
MATHEMATICA
f[n_] := Switch[ Mod[n, 3], 0, n/3 + 1, 1, (n + 8)/3, 2, (n - 2)/3]; Array[f, 78, 0] (* Robert G. Wilson v, Sep 10 2010 *)
CoefficientList[Series[(1 + 2*x + x^3 - 3*x^2)/((1 + x + x^2)*(x - 1)^2), {x, 0, 50}], x] (* G. C. Greubel, Feb 25 2017 *)
PROG
(PARI) x='x+O('x^50); Vec((1+2*x+x^3-3*x^2)/((1+x+x^2)*(x-1)^2)) \\ _G. C. Greubel, Feb 25 2017
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
N. J. A. Sloane, Sep 08 2010, based on a posting to the Sequence Fans Mailing List by Eric Angelini, Aug 21 2010
EXTENSIONS
a(28) onwards from Robert G. Wilson v, Sep 10 2010
STATUS
approved