login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A010882
Period 3: repeat [1, 2, 3].
22
1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3
OFFSET
0,2
COMMENTS
Partial sums are given by A130481(n)+n+1. - Hieronymus Fischer, Jun 08 2007
41/333 = 0.123123123... - Eric Desbiaux, Nov 03 2008
Terms of the simple continued fraction for 3/(sqrt(37)-4). - Paolo P. Lava, Feb 16 2009
This is the lexicographically earliest sequence with no substring of more than 1 term being a palindrome. - Franklin T. Adams-Watters, Nov 24 2013
FORMULA
G.f.: (1+2x+3x^2)/(1-x^3). - Paul Barry, May 25 2003
a(n) = 1 + (n mod 3). - Paolo P. Lava, Nov 21 2006
a(n) = A010872(n) + 1. - Hieronymus Fischer, Jun 08 2007
a(n) = 6 - a(n-1) - a(n-2) for n > 1. - Reinhard Zumkeller, Apr 13 2008
a(n) = n+1-3*floor(n/3) = floor(41*10^(n+1)/333)-floor(41*10^n/333)*10; a(n)-a(n-3)=0 with n>2. - Bruno Berselli, Jun 28 2010
a(n) = A180593(n+1)/3. - Reinhard Zumkeller, Oct 25 2010
a(n) = floor((4*n+3)/3) mod 4. - Gary Detlefs, May 15 2011
a(n) = -cos(2/3*Pi*n)-1/3*3^(1/2)*sin(2/3*Pi*n)+2. - Leonid Bedratyuk, May 13 2012
E.g.f.: 2*(3*exp(3*x/2) - sqrt(3)*cos(Pi/6-sqrt(3)*x/2))*exp(-x/2)/3. - Ilya Gutkovskiy, Jul 05 2016
MAPLE
seq(op([1, 2, 3]), n=0..50); # Wesley Ivan Hurt, Jul 05 2016
MATHEMATICA
Nest[ Flatten[ # /. {1 -> {1, 2}, 2 -> {3, 1}, 3 -> {2, 3}}] &, {1}, 7] (* Robert G. Wilson v, Mar 08 2005 *)
PadRight[{}, 120, {1, 2, 3}] (* Harvey P. Dale, Apr 09 2018 *)
PROG
(Haskell)
a010882 = (+ 1) . (`mod` 3)
a010882_list = cycle [1, 2, 3]
-- Reinhard Zumkeller, Mar 20 2013
(PARI) a(n) = 1 + n%3; \\ Michel Marcus, Feb 04 2016
(Magma) &cat[[1..3]^^30]; // Vincenzo Librandi, Feb 04 2016
CROSSREFS
Cf. A010872, A010873, A010874, A010875, A010876, A004526, A002264, A002265, A002266, A177036 (decimal expansion of (4+sqrt(37))/7), A214090.
Sequence in context: A082846 A117373 A132677 * A343638 A293207 A106590
KEYWORD
nonn,easy
STATUS
approved