OFFSET
0,3
LINKS
Index entries for linear recurrences with constant coefficients, signature (1,-1,1,-1,1).
FORMULA
G.f.: -(3*x^4+2*x^2+1)/(x-1)/(x^2+x+1)/(x^2-x+1). a(n) = A131555(n)+1. - R. J. Mathar, Nov 14 2007
From Wesley Ivan Hurt, Jun 17 2016: (Start)
a(n) = a(n-1) - a(n-2) + a(n-3) - a(n-4) + a(n-5) for n>4.
a(n) = (12-2*sqrt(3)*cos((1-4*n)*Pi/6)-6*sin((1+2*n)*Pi/6))/6. (End)
a(n) = floor(n/2) - 3*floor(n/6) + 1. - Ridouane Oudra, Sep 09 2023
MAPLE
A105899:=n->(12-2*sqrt(3)*cos((1-4*n)*Pi/6)-6*sin((1+2*n)*Pi/6))/6: seq(A105899(n), n=0..100); # Wesley Ivan Hurt, Jun 17 2016
MATHEMATICA
Flatten[Table[{1, 1, 2, 2, 3, 3}, {20}]] (* Wesley Ivan Hurt, Jun 17 2016 *)
PadRight[{}, 120, {1, 1, 2, 2, 3, 3}] (* Harvey P. Dale, May 09 2022 *)
PROG
(PARI) a(n)=1+n%6\2 \\ Jaume Oliver Lafont, Aug 30 2009
(Magma) &cat[[1, 1, 2, 2, 3, 3]: n in [0..20]]; // Wesley Ivan Hurt, Jun 17 2016
CROSSREFS
KEYWORD
nonn,easy,less
AUTHOR
Paul Curtz, Aug 27 2007
EXTENSIONS
Edited by N. J. A. Sloane, Sep 15 2007
More terms from Klaus Brockhaus, May 24 2010
STATUS
approved