A203572 Period length 12: 0, 1, 2, 3, 4, 5, 0, 5, 4, 3, 2, 1 repeated.
0, 1, 2, 3, 4, 5, 0, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 0, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 0, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 0, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 0, 5, 4, 3, 2, 1, 0
Offset: 0
Examples
a(14) = 14(mod 6) = 2 because 14\6 = floor(14/6)=2 is even; the sign is +1. a(8) = (6-8)(mod 6) = 4 because 8\6 = floor(8/6)=1 is odd; the sign is -1.
Crossrefs
Cf. A203571.
Programs
-
Mathematica
PadRight[{},120,{0,1,2,3,4,5,0,5,4,3,2,1}] (* Harvey P. Dale, Nov 28 2015 *)
Formula
a(n) = n(mod 6) if (-1)^floor(n/6)=+1 else (6-n)(mod 6), n>=0. (-1)^floor(n/6) is the sign corresponding to the parity of the quotient floor(n/6). This quotient is sometimes denoted by n\6.
O.g.f.: x*(1+2*x+3*x^2+4*x^3+5*x^4+5*x^6+4*x^7+3*x^8+2*x^9+ x^10)/(1-x^12).
Comments