3 added 44 characters in body

The homogeneous component of degree $k$ in the free Lie algebra $\mathfrak{Lie}(x_1,\dots,x_n)$ in $n$ letters is of dimension $$g_n(k)=\frac{1}{k}\sum_{d|k}\mu(d)n^{k/d}.$$ This is also the number of Lyndon words of length $k$ in $n$ letters, and of a few other things...

Question: Is there a positive formula for this number?

As an aside,

Question: Is there a corresponding formula for the dimensions of the homogeneous components of the free Lie triple system on $n$ letters?

2 Fix the formula