New search (restrictions: 1 < n < 15, 1 < k < 15, k^n < 50000 )

k: n:
See below for more info about Bruijn sequences. You may also want try my de Bruijn sequence Java Applet.

de Bruijn sequence, k=2, n=3

The following is a de Bruijn sequence of a k=2 sized alphabet with string length of n=3 . Please note that the sequence is circular, i.e. it wraps "around the end", indicated by setting the first n-1 digits last in the sequence (inside parenthesis).

Sequence length: k^n = 2^3 = 8 (with the "wrap": k^n+(n-1) = 2^3+(3-1) = 10)
0 0 0 1 0 1 1 1 (0 0)


The table below shows a more structured version of the sequence:

0 0 1
0 1 1

Example: A de Bruijn sequence with k=10 and n=4 is a minimal sequence to type for testing all the possible (code) sequences of length 4 on a device with 10 keys (labelled 0 to 9), and there are no restriction that you have to type Enter after each try. Click
here to see that sequence. See the URL:s below for somewhat more serious applications...

For more information about these types of sequences see e.g.
The code/algortihm for this program is from the inspirational Combinatorial Object Server, COS, at

See also:
Back to my homepage
Created by Hakan Kjellerstrand