TITLE: How to construct particular De Bruijn sequences
QUESTION [5 upvotes]: For $n \ge 2$, there is at least one binary DeBruijn sequence beginning with $n$ zeros followed by $n$ ones.  Is there a straightforward way to construct such a sequence for each $n \ge 2$?  Examples:
$n=2: 0011$
$n=3: 00011101$
$n=4: 0000111101100101$
$n=5: 00000111110111001101011000101001$

REPLY [7 votes]: One of the simple ways to generate De Bruijn sequenceis the following rule. You write $n$ zeros, and after that "$1$ is better than $0$" (left hand rule):
$$0000111101100101000$$
For example 9th digit is $0$ because we already have $1111$. This algorithm was taken from the article N. M. Korobov, "Concerning some questions of uniform distribution". In the article Normal periodic systems and their applications to the estimation of sums of fractional parts he proposed a more general algorithm which allows to generate all possible De Bruijn sequenceis.