(s,n)
return output
Generate a De Bruijn sequence for words of length n over s symbols
    by concatenating together in lexicographic order the Lyndon words
    whose lengths divide n. The output length will be s^n.
    Because nearly half of the generated sequences will have length
    exactly n, the algorithm will take O(s^n/n) steps, and the bulk
    of the time will be spent in sequence concatenation.
Generate a De Bruijn sequence for words of length n over s symbols
    by concatenating together in lexicographic order the Lyndon words
    whose lengths divide n. The output length will be s^n.
    Because nearly half of the generated sequences will have length
    exactly n, the algorithm will take O(s^n/n) steps, and the bulk
    of the time will be spent in sequence concatenation.
Generate a De Bruijn sequence for words of length n over s symbols by concatenating together in lexicographic order the Lyndon words whose lengths divide n . The output length will be s^n . Because nearly half of the generated sequences will have length exactly n the algorithm will take O ( s^n / n ) steps and the bulk of the time will be spent in sequence concatenation .
def DeBruijnSequence(s,n):
    """Generate a De Bruijn sequence for words of length n over s symbols
    by concatenating together in lexicographic order the Lyndon words
    whose lengths divide n. The output length will be s^n.
    Because nearly half of the generated sequences will have length
    exactly n, the algorithm will take O(s^n/n) steps, and the bulk
    of the time will be spent in sequence concatenation."""
    
    output = []
    for w in LengthLimitedLyndonWords(s,n):
        if n % len(w) == 0:
            output += w
    return output
def DeBruijnSequence ( s , n ) : output = [ ] for w in LengthLimitedLyndonWords ( s , n ) : if n % len ( w ) == 0 : output += w return output