|
|
A193680
|
|
Period 6 sequence 0,1,2,0,2,1.
|
|
7
|
|
|
0, 1, 2, 0, 2, 1, 0, 1, 2, 0, 2, 1, 0, 1, 2, 0, 2, 1, 0, 1, 2, 0, 2, 1, 0, 1, 2, 0, 2, 1, 0, 1, 2, 0, 2, 1, 0, 1, 2, 0, 2, 1, 0, 1, 2, 0, 2, 1, 0, 1, 2, 0, 2, 1, 0, 1, 2, 0, 2, 1, 0, 1, 2, 0, 2, 1, 0, 1, 2, 0, 2, 1, 0, 1, 2, 0, 2, 1, 0, 1, 2, 0, 2, 1, 0, 1, 2, 0, 2, 1
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,3
|
|
COMMENTS
|
This sequence can be extended periodically to negative values of n.
See a comment on A203571 where a k-family of 2k-periodic sequences P_k has been defined. The present sequence is P_3. - Wolfdieter Lang, Feb 02 2012
|
|
LINKS
|
|
|
FORMULA
|
a(n) = n (mod 3) if (-1)^floor(n/3)=+1 else (3 - n)(mod 3), n>=0. (-1)^floor(n/3) is the parity of the quotient floor(n/3), sometimes denoted by n\3.
O.g.f.: x*(1+2*x+2*x^3+x^4)/(1-x^6).
Multiplicative with a(2^e) = 2, a(3^e) = 0, and a(p^e) = 1 for p >= 5.
Dirichlet g.f.: zeta(s)*(1+1/2^s-1/3^s-1/6^s). (End)
|
|
EXAMPLE
|
a(8) = 8(mod 3) = 2 because (-1)^floor(8/3)= +1; 8\3 = 2 is even.
a(4) = (3-1)(mod 3) = 2, because (-1)^floor(4/3) is -1; 4\3 = 1 is odd.
|
|
MATHEMATICA
|
PadRight[{}, 120, {0, 1, 2, 0, 2, 1}] (* Harvey P. Dale, Jul 25 2020 *)
|
|
PROG
|
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,easy,mult
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|