login
A159955
Period 9: repeat [0, 1, 2, 1, 2, 0, 2, 0, 1].
3
0, 1, 2, 1, 2, 0, 2, 0, 1, 0, 1, 2, 1, 2, 0, 2, 0, 1, 0, 1, 2, 1, 2, 0, 2, 0, 1, 0, 1, 2, 1, 2, 0, 2, 0, 1, 0, 1, 2, 1, 2, 0, 2, 0, 1, 0, 1, 2, 1, 2, 0, 2, 0, 1, 0, 1, 2, 1, 2, 0, 2, 0, 1, 0, 1, 2, 1, 2, 0, 2, 0, 1, 0, 1, 2, 1, 2, 0, 2, 0, 1, 0, 1, 2, 1, 2, 0, 2, 0, 1, 0, 1, 2, 1, 2, 0, 2, 0, 1
OFFSET
0,3
FORMULA
a(n+9) = a(n) with a(0) = a(5) = a(7) = 0, a(1) = a(3) = a(8) = 1, a(2) = a(4) = a(6) = 2.
a(n) = floor((4*n-9)/3) mod 3. - Gary Detlefs, May 15 2011
a(n) = (n + floor(n/3)) mod 3. - William Walkington, Mar 22 2016
From Chai Wah Wu, Jul 30 2020: (Start)
a(n) = a(n-1) - a(n-3) + a(n-4) - a(n-6) + a(n-7) for n > 6.
G.f.: x*(-x^5 + x^4 - 2*x^3 + x^2 - x - 1)/((x - 1)*(x^6 + x^3 + 1)). (End)
MATHEMATICA
PadRight[{}, 120, {0, 1, 2, 1, 2, 0, 2, 0, 1}] (* Vincenzo Librandi, Mar 24 2016 *)
PROG
(Magma) &cat[[0, 1, 2, 1, 2, 0, 2, 0, 1]^^15]; // Vincenzo Librandi, Mar 24 2016
CROSSREFS
Sequence in context: A375158 A332685 A258196 * A327306 A053838 A342651
KEYWORD
easy,nonn
AUTHOR
Philippe Deléham, Apr 27 2009
STATUS
approved