OFFSET
1,2
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..3000
Index entries for linear recurrences with constant coefficients, signature (1,0,1,-1).
FORMULA
a(n) = 3*(n - 1) - floor((n - 1)/3) - ((n - 1)^2 % 3). - Gary Detlefs, Mar 19 2010; corrected by L. Edson Jeffery, Sep 02 2014
a(n) = floor(8*(n-1)/3). - Gary Detlefs, Jan 02 2012
G.f.: x^2*(2+3*x+3*x^2)/((1+x+x^2)*(x-1)^2). - R. J. Mathar, Feb 03 2014
Conjecture: a(n)+a(n+1)+a(n+2) = 8*n-1; or a(n) = 8*(n-2)-a(n-1)-a(n-2)-1, n>3, with a(1)=0, a(2)=2, a(3)=5. - L. Edson Jeffery, Sep 02 2014
a(n) = a(n-1)+a(n-3)-a(n-4), n>4, with a(1)=0, a(2)=2, a(3)=5, a(4)=8. - L. Edson Jeffery, Sep 02 2014
a(n) = ((8*n-9)+2*sin((2*n*Pi)/3)/sqrt(3))/3. - L. Edson Jeffery, Sep 02 2014
a(3k) = 8k-3, a(3k-1) = 8k-6, a(3k-2) = 8k-8. - Wesley Ivan Hurt, Jun 10 2016
MAPLE
seq(3*n - floor(n/3) - (n^2 mod 3), n=0..51); # Gary Detlefs, Mar 19 2010
MATHEMATICA
LinearRecurrence[{1, 0, 1, -1}, {0, 2, 5, 8}, 62] (* L. Edson Jeffery, Sep 02 2014 *)
Table[((8*n-9)+2*Sin[(2*n*Pi)/3]/Sqrt[3])/3, {n, 62}] (* L. Edson Jeffery, Sep 02 2014 *)
Table[8 n + {0, 2, 5}, {n, 0, 100}]//Flatten (* Vincenzo Librandi, Jun 11 2016 *)
PROG
(PARI) a(n) = floor(8*(n-1)/3); \\ Michel Marcus, Sep 03 2014
(Magma) [n : n in [0..150] | n mod 8 in [0, 2, 5]]; // Wesley Ivan Hurt, Jun 10 2016
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
STATUS
approved