This site is supported by donations to The OEIS Foundation.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A010872 a(n) = n mod 3. 85
 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2 (list; graph; refs; listen; history; text; internal format)
 OFFSET 0,3 COMMENTS Fixed point of morphism 0 -> 01, 1 -> 20, 2 -> 12. Complement of A002264, since 3*A002264(n) + a(n) = n. - Hieronymus Fischer, Jun 01 2007 LINKS Ralph E. Griswold, Shaft Sequences Index entries for linear recurrences with constant coefficients, signature (0,0,1). FORMULA a(n) = n - 3*floor(n/3) = a(n-3). G.f.: (2*x^2+x)/(1-x^3). - Mario Catalani (mario.catalani(AT)unito.it), Jan 08 2003 a(n) = 1 + (1-2*cos(2*Pi*(n-1)/3)) * sin(2*Pi*(n-1)/3)) / sqrt(3). Complex representation: a(n) = 1/3*(1-r^n)*(1+r^n/(1-r)) where r=exp(2*Pi/3*i)=(-1+sqrt(3)*i)/2 and i=sqrt(-1). - Hieronymus Fischer, May 29 2007 a(n) = (16/9)*((sin(Pi*(n-2)/3))^2+2*(sin(Pi*(n-1)/3))^2)*(sin(Pi*n/3))^2. a(n) = (4/3)*(|sin(Pi*(n-2)/3)|+2*|sin(Pi*(n-1)/3)|)*|sin(Pi*n/3)|. a(n) = (4/9)*((1-cos(2*Pi*(n-2)/3))+2*(1-cos(2*Pi*(n-1)/3)))*(1-cos(2*Pi*n/3)). These formulas can be easily adapted to represent any periodic sequence. - Hieronymus Fischer, Jun 01 2007 Trigonometric formulas above edited for better readability by Hieronymus Fischer, Nov 22 2011 a(n) = 3 - a(n-1) - a(n-2) for n > 1. - Reinhard Zumkeller, Apr 13 2008 a(n) = 1-2*sin(4*Pi*(n+2)/3)/sqrt(3). - Jaume Oliver Lafont, Dec 05 2008 From Wesley Ivan Hurt, May 27 2015, Mar 22 2016: (Start) a(n) = 1 - 0^((-1)^(n/3)-(-1)^n) + 0^((-1)^((n+1)/3)+(-1)^n). a(n) = 1 + (-1)^((2*n+4)/3)/3 + (-1)^((-2*n-4)/3)/3 + 2*(-1)^((2*n+2)/3)/3 + 2*(-1)^((-2*n-2)/3)/3. a(n) = 1 + 2*cos(Pi*(2*n+4)/3)/3 + 4*cos(Pi*(2*n+2)/3)/3. (End) EXAMPLE G.f. = x + 2*x^2 + x^4 + 2*x^5 + x^7 + 2*x^8 + x^10 + 2*x^11 + x^13 + ... MAPLE A010872:=n->(n mod 3): seq(A010872(n), n=0..100); # Wesley Ivan Hurt, May 27 2015 MATHEMATICA Nest[ Function[ l, {Flatten[(l /. {0 -> {0, 1}, 1 -> {2, 0}, 2 -> {1, 2}})]}], {0}, 7] (* Robert G. Wilson v, Feb 28 2005 *) PROG (Haskell) a010872 = (`mod` 3) a010872_list = cycle [0, 1, 2]  -- Reinhard Zumkeller, May 26 2012 (MAGMA) [n mod 3 : n in [0..100]]; // Wesley Ivan Hurt, May 27 2015 (PARI) x='x+O('x^200); concat(0, Vec((2*x^2+x)/(1-x^3))) \\ Altug Alkan, Mar 23 2016 CROSSREFS Cf. A000035, A010873. A080425, A004526, A002264, A002265, A002266. Cf. partial sums: A130481. Other related sequences are A130482, A130483, A130484, A130485. Sequence in context: A134979 A112248 A244860 * A220663 A220659 A025858 Adjacent sequences:  A010869 A010870 A010871 * A010873 A010874 A010875 KEYWORD easy,nonn AUTHOR EXTENSIONS Edited by Joerg Arndt, Apr 21 2014 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.

Last modified February 20 12:33 EST 2018. Contains 299379 sequences. (Running on oeis4.)