A308831 Start with generation 0, which is the empty sequence. For generation N>=1, extend the existing sequence into a non-cyclic ternary de Bruijn sequence of order N. If more than one extension is possible, choose the lexicographically earliest.
0, 1, 2, 0, 0, 2, 2, 1, 1, 0, 0, 0, 1, 0, 1, 1, 1, 2, 1, 0, 2, 0, 2, 1, 2, 2, 2, 0, 1, 0, 0, 1, 1, 0, 1, 0, 2, 1, 0, 0, 2, 0, 0, 0, 0, 2, 1, 1, 1, 1, 0, 2, 2, 0, 0, 1, 2, 1, 1, 2, 0, 1, 1, 2, 2, 0, 2, 0, 1, 2, 2, 1, 2, 1, 2, 0, 2, 2, 2, 2, 1, 0, 1, 2
Offset: 0
Keywords
Examples
Generation 1: [012] (All ternary sequences of length 1 now appear. With 3! = 6 solutions, the lexicographically earliest is chosen.) Generation 2: [0120022110] (The sequence is extended from the previous generation, now including all ternary sequences of length 2.) The process continues.
Links
- A. D. Skovgaard, Table of n, a(n) for n = 0..246
- A. D. Skovgaard, Python program to generate the sequence, with explanatory comments
- A. D. Skovgaard, a(n) for n = 0..246 in compressed notation
Comments