Vincent Davis wrote:
I plan to use the sequence as an index to count occurrences of sequences of length n.
If all you want is a mapping between a sequence of length n and compact representation of it, there's a much simpler way: just convert it to a base-k integer, where k is the size of the alphabet. The resulting integer won't be any larger than an index into the de Bruijn sequence would be, and you can easily recover the original sequence from its encoding without needing any kind of lookup table. -- Greg -- https://mail.python.org/mailman/listinfo/python-list