login
A270740
Period 9: repeat 0,1,2,2,0,1,1,2,0.
1
0, 1, 2, 2, 0, 1, 1, 2, 0, 0, 1, 2, 2, 0, 1, 1, 2, 0, 0, 1, 2, 2, 0, 1, 1, 2, 0, 0, 1, 2, 2, 0, 1, 1, 2, 0, 0, 1, 2, 2, 0, 1, 1, 2, 0, 0, 1, 2, 2, 0, 1, 1, 2, 0, 0, 1, 2, 2, 0, 1, 1, 2, 0
OFFSET
0,3
FORMULA
a(n) = (n - floor(n/3)) mod 3.
From Chai Wah Wu, Jun 04 2016: (Start)
a(n) = a(n-1) - a(n-3) + a(n-4) - a(n-6) + a(n-7) for n > 6.
G.f.: x*(1 + x - x^3 + 2*x^4)/((1 - x)*(1 + x^3 + x^6)). (End)
MATHEMATICA
Table[Mod[n - Floor[n/3], 3], {n, 0, 120}] (* Michael De Vlieger, Mar 25 2016 *)
PadRight[{}, 120, {0, 1, 2, 2, 0, 1, 1, 2, 0}] (* Harvey P. Dale, Jan 16 2019 *)
PROG
(PARI) a(n) = (n - n\3) % 3; \\ Michel Marcus, Mar 22 2016
CROSSREFS
Cf. A002264 (floor(n/3)), A010872 (n mod 3).
Sequence in context: A206442 A137581 A156311 * A189463 A287451 A113414
KEYWORD
nonn,easy
AUTHOR
William Walkington, Mar 22 2016
STATUS
approved