k is the language (0..k-1). n is the length of the string.
The de Bruijn sequence is the shortest way one can combine all the possible combinations
(strings)
if one is allowed to overlap the different combinations.
The total length of the sequence is (the part is for the "around the corner"
cases).