A122497 Let f(S) denote the interchange of 1's and 2's in S. Let S_0 = 1, S_{N+1} = f(S_N).S_N, where the dot indicates concatenation. Sequence gives S_0.S_1.S_2.S_3....
1, 2, 1, 1, 2, 2, 1, 2, 1, 1, 2, 1, 2, 2, 1, 1, 2, 2, 1, 2, 1, 1, 2, 2, 1, 1, 2, 1, 2, 2, 1, 2, 1, 1, 2, 1, 2, 2, 1, 1, 2, 2, 1, 2, 1, 1, 2, 1, 2, 2, 1, 2, 1, 1, 2, 2, 1, 1, 2, 1, 2, 2, 1, 1, 2, 2, 1, 2, 1, 1, 2, 2, 1, 1, 2, 1, 2, 2, 1, 2, 1, 1, 2, 1, 2, 2, 1, 1, 2, 2, 1, 2, 1, 1, 2, 2, 1, 1, 2, 1, 2, 2, 1, 1, 2
Offset: 1
Examples
The first few S_i are: 1 2, 1 1, 2, 2, 1 2, 1, 1, 2, 1, 2, 2, 1 1, 2, 2, 1, 2, 1, 1, 2, 2, 1, 1, 2, 1, 2, 2, 1
Links
- G. C. Greubel, Table of n, a(n) for the first 13 rows, flattened
- Eric Weisstein's World of Mathematics, Thue-Morse Constant
Programs
-
Mathematica
ThueMorse[n_, b_] := Nest[Flatten[ # /. {1 -> {1, 2}, 2 -> {2, 1}}] &, {b}, n] a = Table[ThueMorse[n, 1 + Mod[n, 2]], {n, 0, 7}] Flatten[a]
Formula
a(n) = A059448(n) + 1. - Filip Zaludek, Dec 10 2016
Extensions
Edited by N. J. A. Sloane, May 22 2007
Comments