cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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.

Original entry on oeis.org

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

Views

Author

Andrey Zabolotskiy, Feb 28 2025

Keywords

Crossrefs

Cf. the Thue-Morse sequence A010060 and its other ternary generalizations: A053838, A287150.

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.