(s,n)
return total//n
The number of length-n Lyndon words over s symbols.
The number of length-n Lyndon words over s symbols.
The number of length - n Lyndon words over s symbols .
def CountLyndonWords(s,n):
    """The number of length-n Lyndon words over s symbols."""
    if n == 0:
        return 1
    total = 0
    for i in range(1,n+1):
        if n%i == 0:
            total += MoebiusFunction(n/i) * s**i
    return total//n
def CountLyndonWords ( s , n ) : if n == 0 : return 1 total = 0 for i in range ( 1 , n + 1 ) : if n % i == 0 : total += MoebiusFunction ( n / i ) * s ** i return total // n