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

A036581
Ternary Thue-Morse sequence: closed under a->abc, b->ac, c->b.
5
0, 2, 1, 0, 1, 2, 0, 2, 1, 2, 0, 1, 0, 2, 1, 0, 1, 2, 0, 1, 0, 2, 1, 2, 0, 2, 1, 0, 1, 2, 0, 2, 1, 2, 0, 1, 0, 2, 1, 2, 0, 2, 1, 0, 1, 2, 0, 1, 0, 2, 1, 0, 1, 2, 0, 2, 1, 2, 0, 1, 0, 2, 1, 0, 1, 2, 0, 1, 0, 2, 1, 2, 0, 2, 1, 0, 1, 2, 0, 1, 0, 2, 1, 0, 1, 2, 0, 2, 1, 2, 0, 1, 0, 2, 1, 2, 0, 2, 1
OFFSET
0,2
COMMENTS
This sequence and A108694 are squarefree (they do not contain any substring XX). - Bill Gosper, Jul 22 2005
Trajectory of 1 under the morphism 0 -> 021, 1 -> 2 & 2 -> 01. - Robert G. Wilson v, Apr 06 2008
I believe that this is the sequence Cummings refers to as the Morse-Hedlund sequence. It can be constructed by starting with the Thue-Morse binary sequence A010060, 0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,..., reading successive pairs of digits: 01, 11, 10, 01, 10, 00, 01, 11, 10, 00, 01, ..., and mapping 01 to 0, 10 to 1, and both 00 and 11 to 2, getting 0,2,1,0,1,2,0,2,1,... - N. J. A. Sloane, Oct 17 2012
REFERENCES
L. J. Cummings, On the construction of Thue sequences, Proc. 9th S-E Conf. Combinatorics, Graph Theory and Computing, pp. 235-242. - From N. J. A. Sloane, Oct 17 2012
M. Lothaire, Combinatorics on Words. Addison-Wesley, Reading, MA, 1983, p. 26.
LINKS
A. Cobham, Uniform Tag Sequences, Mathematical Systems Theory, 6 (1972), 164-192.
Marston Morse and Gustav A. Hedlund, Unending chess, symbolic dynamics and a problem in semigroups, Duke Math. J., Volume 11, Number 1 (1944), 1-7. - From N. J. A. Sloane, Oct 17 2012
FORMULA
a(n) = A010060(n+1) - A010060(n) - 1 mod 3. - Bill Gosper, Jul 22 2005
MAPLE
A036581 := proc(n)
A010060(n+1)-A010060(n)-1 ;
% mod 3 ;
end proc: # R. J. Mathar, Oct 17 2012
MATHEMATICA
Nest[ # /. {0 -> {0, 2, 1}, 1 -> {2}, 2 -> {0, 1}} &, {0}, 7] // Flatten (* Robert G. Wilson v, Apr 06 2008 *)
a010060[n_]:=Mod[DigitCount[n, 2, 1], 2]; Table[Mod[a010060[n + 1] - a010060[n] - 1, 3], {n, 0, 100}] (* Indranil Ghosh, Apr 25 2017 *)
SubstitutionSystem[{0->{0, 2, 1}, 1->{2}, 2->{0, 1}}, {0}, {7}][[1]] (* Harvey P. Dale, Dec 26 2021 *)
PROG
(Haskell)
a036581 n = a036581_list !! n
a036581_list = zipWith (\u v -> if u /= v then 2 * u + v - 1 else 2)
a010060_list $ tail a010060_list
-- According to N. J. A. Sloane's comment from Oct 17 2012
-- Reinhard Zumkeller, Nov 30 2012
(Python)
def a010060(n): return bin(n)[2:].count("1")%2
def a(n): return (a010060(n + 1) - a010060(n) - 1)%3 # Indranil Ghosh, Apr 25 2017
CROSSREFS
Sequence in context: A179286 A193690 A108964 * A369462 A135055 A265433
KEYWORD
nonn,nice
EXTENSIONS
More terms from Robert G. Wilson v, Apr 06 2008
STATUS
approved

  NODES
orte 1
see 1
Story 1