login
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.
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,3
FORMULA
In the Thue-Morse sequence, substitute 0 -> 012, 1 -> 210 once.
PROG
(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
CROSSREFS
Cf. the Thue-Morse sequence A010060 and its other ternary generalizations: A053838, A287150.
Sequence in context: A194853 A309866 A287150 * A257109 A096830 A319780
KEYWORD
nonn,easy
AUTHOR
Andrey Zabolotskiy, Feb 28 2025
STATUS
approved