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
LINKS
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
KEYWORD
nonn,easy
AUTHOR
STATUS
approved