Let $S = \{a, b, c, \ldots \}$ be an alphabet, and let $S^N$ be the set of words with letters in $S$ of length $N$ that are not expressible as the repetition of any single word in $\bigcup_{M < N} S^M$.
For example, a, ab and aab are allowed, but aa, aaa and abab are disallowed.
What is $\left|S^N\right|$ in terms of $\left|S\right|$ and $N$?
I'm also interested in a formula for $\sum_{M = 1}^N \left|S^M\right|$.
http://oeis.org/A027375 gives the answer for $S$ of size two, with many links to the literature. http://oeis.org/A143324 gives the number of length $n$ primitive (that is, aperiodic, or period $n$) $k$-ary words ($n\ge1$, $k\ge1$) as $$\sum_{d\mid n}k^d\mu(n/d)$$ where the sum is over all $d$ dividing $n$, and $\mu$ is the Mobius function, which see.