A381577 Unique sequence of 0's, 1's, and 2's such that for any terms x and y with x < y, the subsequence of x's and y's becomes the Thue-Morse sequence after substitution x -> 0, y -> 1.
0, 1, 2, 2, 1, 0, 2, 1, 0, 0, 1, 2, 2, 1, 0, 0, 1, 2, 0, 1, 2, 2, 1, 0, 2, 1, 0, 0, 1, 2, 0, 1, 2, 2, 1, 0, 0, 1, 2, 2, 1, 0, 2, 1, 0, 0, 1, 2, 2, 1, 0, 0, 1, 2, 0, 1, 2, 2, 1, 0, 0, 1, 2, 2, 1, 0, 2, 1, 0, 0, 1, 2, 0, 1, 2, 2, 1, 0, 2, 1, 0, 0, 1, 2, 2, 1, 0
Offset: 0
Crossrefs
Programs
-
Python
def A381577(n): return ((2,1,0) if (n//3).bit_count()&1 else (0,1,2))[n%3] # Chai Wah Wu, Feb 28 2025
Formula
In the Thue-Morse sequence, substitute 0 -> 012, 1 -> 210 once.