Given an alphabet $\{x,y\}$, a (binary) Lyndon word is a word $w$ in $\{x,y\}$ such that if $w=uv$ is a factorisation of $w$ into non-empty subwords, then $u<v$ in lexicographic order. This is equivalent to being the unique minimum word (in lexicographic order) among all its rotations.
The number of binary Lyndon words of length $n$ is given by the necklace polynomial
$$\frac{1}{n}\sum_{d|n}\mu \left(\frac{n}{d}\right)2^d$$
Is there a way to count the number of binary Lyndon words of length $n$ with $k$ occurrences of a given letter?
Let $L(n,k)$ be the number of Lyndon words of length $n$ with $k$ ones. Then $$ \binom{n}{k}=\sum_{d|\gcd(n,k)} (n/d)L(n/d,k/d) $$ This follows because an arbitrary length $n$ string with $k$ ones can be constructed by choosing one of the $L(n/d,k/d)$ Lyndon words of length $n/d$ with $k/d$ ones, rotating it in one of $(n/d)$ ways, then repeating it $d$ times.
Written another way; if $a$ and $b$ are coprime, and $m>0$ is arbitrary, then $$ \binom{am}{bm}=\sum_{d|m}(am/d)L(am/d,bm/d)=\sum_{d|m}ad\cdot L(ad,bd) $$
Möbius inversion then implies $$ am\cdot L(am,bm)=\sum_{d|m}\mu(d)\binom{am/d}{bm/d} $$ which after the substitutions $m\gets \gcd(n,k),a\gets n/\gcd(n,k),b\gets k/\gcd(n,k)$ results in $$ \boxed{L(n,k) = \frac1n\sum_{d|\gcd(n,k)}\mu(d)\binom{n/d}{k/d}.} $$