login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A036585 Ternary Thue-Morse sequence: closed under a->abc, b->ac, c->b. 9

%I #19 Mar 03 2023 16:25:48

%S 3,2,1,3,1,2,3,2,1,2,3,1,3,2,1,3,1,2,3,1,3,2,1,2,3,2,1,3,1,2,3,2,1,2,

%T 3,1,3,2,1,2,3,2,1,3,1,2,3,1,3,2,1,3,1,2,3,2,1,2,3,1,3,2,1,3,1,2,3,1,

%U 3,2,1,2,3,2,1,3,1,2,3,1,3,2,1,3,1,2,3,2,1,2,3,1,3,2,1,2,3,2,1,3,1,2,3,2,1

%N Ternary Thue-Morse sequence: closed under a->abc, b->ac, c->b.

%C First differences of A001969. Observed by Franklin T. Adams-Watters, proved by Max Alekseyev, Aug 30 2006

%D M. Lothaire, Combinatorics on Words. Addison-Wesley, Reading, MA, 1983, p. 26.

%H Reinhard Zumkeller, <a href="/A036585/b036585.txt">Table of n, a(n) for n = 1..10000</a>

%F a(n) = A001969(n+1) - A001969(n). - _Franklin T. Adams-Watters_, Aug 28 2006

%F a(n) = A029883(n) + 2 = A036577(n) + 1.

%o (PARI) a(n)=if(n<1 || valuation(n,2)%2,2,2-(-1)^subst(Pol(binary(n)),x,1))

%o (Haskell)

%o a036585 n = a036585_list !! (n-1)

%o a036585_list = 3 : concat (map f a036585_list)

%o where f 1 = [1,2,3]; f 2 = [1,3]; f 3 = [2]

%o -- _Reinhard Zumkeller_, Oct 31 2012

%o def A036585(n): return 2+(n.bit_count()&1)-((n-1).bit_count()&1) # _Chai Wah Wu_, Mar 03 2023

%Y Cf. A001969, A007413, A005679.

%K nonn

%O 1,1

%A _N. J. A. Sloane_.

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 27 12:42 EDT 2024. Contains 372019 sequences. (Running on oeis4.)