login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A193680 Period 6 sequence 0,1,2,0,2,1. 6
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

Table of n, a(n) for n=0..89.

Index entries for linear recurrences with constant coefficients, signature (0,0,0,0,0,1).

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).

a(n) = 1-( (-1)^(n+1)+cos(Pi*n/3)+cos(2*Pi*n/3))/3. - R. J. Mathar, Oct 07 2011

a(n) = abs(((n+3) mod 6)-3) mod 3. - Paolo P. Lava, Feb 15 2012

a(n) = floor(40007/333333*10^(n+1)) mod 10. - Hieronymus Fischer, Jan 04 2013

a(n) = floor(71/364*3^(n+1)) mod 3. - Hieronymus Fischer, Jan 04 2013

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

Table[{0, 1, 2, 0, 2, 1}, {15}] // Flatten (* Jean-François Alcover, Jun 21 2013 *)

PROG

(PARI) a(n)=[0, 1, 2, 0, 2, 1][n%6+1] \\ Charles R Greathouse IV, Oct 07 2011

CROSSREFS

Cf. signed versions A112300, A186809.

Sequence in context: A083054 A297742 A061264 * A186809 A112300 A049239

Adjacent sequences:  A193677 A193678 A193679 * A193681 A193682 A193683

KEYWORD

nonn,easy,mult

AUTHOR

Wolfdieter Lang, Sep 30 2011

EXTENSIONS

Keyword:mult added by Andrew Howroyd, Jul 31 2018

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent | More pages
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified October 22 09:57 EDT 2018. Contains 316433 sequences. (Running on oeis4.)