login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A110568
Period 6: repeat [1, 0, 2, 2, 0, 1].
2
1, 0, 2, 2, 0, 1, 1, 0, 2, 2, 0, 1, 1, 0, 2, 2, 0, 1, 1, 0, 2, 2, 0, 1, 1, 0, 2, 2, 0, 1, 1, 0, 2, 2, 0, 1, 1, 0, 2, 2, 0, 1, 1, 0, 2, 2, 0, 1, 1, 0, 2, 2, 0, 1, 1, 0, 2, 2, 0, 1, 1, 0, 2, 2, 0, 1, 1, 0, 2, 2, 0, 1, 1, 0, 2, 2, 0, 1, 1, 0, 2, 2, 0, 1, 1, 0, 2, 2, 0, 1, 1, 0, 2
OFFSET
0,3
COMMENTS
Permutation of {0, 1, 2}, followed by its reversal, repeated.
FORMULA
a(n) = A078008(n) mod 3.
G.f.: (1-x+3*x^2-x^3+x^4) / (1-x+x^2-x^3+x^4-x^5).
a(n) = a(n-1) - a(n-2) + a(n-3) - a(n-4) + a(n-5) for n>4.
a(n) = 1 + cos(2*Pi*n/3)/2 - sqrt(3)*sin(2*Pi*n/3)/2 - cos(Pi*n/3)/2 + sqrt(3)*sin(Pi*n/3)/6.
a(n) = a(n-6) for n > 5. - Wesley Ivan Hurt, Jun 28 2016
a(n) = ((n-1)*(-1)^(n-1) mod 3). - Wesley Ivan Hurt, Jan 07 2021
MAPLE
A110568:=n->[1, 0, 2, 2, 0, 1][(n mod 6)+1]: seq(A110568(n), n=0..100); # Wesley Ivan Hurt, Jun 28 2016
MATHEMATICA
Mod[#, 3]&/@CoefficientList[Series[(1-x)/(1-x-2x^2), {x, 0, 100}], x] (* Harvey P. Dale, Mar 30 2011 *)
PadRight[{}, 100, {1, 0, 2, 2, 0, 1}] (* Wesley Ivan Hurt, Jun 28 2016 *)
LinearRecurrence[{1, -1, 1, -1, 1}, {1, 0, 2, 2, 0}, 100] (* Harvey P. Dale, Apr 03 2019 *)
PROG
(Magma) &cat [[1, 0, 2, 2, 0, 1]^^30]; // Wesley Ivan Hurt, Jun 28 2016
(PARI) x='x+O('x^50); Vec((1-x+3*x^2-x^3+x^4)/(1-x+x^2-x^3+x^4-x^5)) \\ G. C. Greubel, Aug 31 2017
KEYWORD
easy,nonn
AUTHOR
Paul Barry, Jul 27 2005
EXTENSIONS
Name changed by Wesley Ivan Hurt, Jun 28 2016
STATUS
approved