TITLE: Exhibit an explicit bijection between irreducible polynomials over finite fields and Lyndon words.
QUESTION [21 upvotes]: Let $q$ be a power of a prime.  It's well-known that the function $B(n, q) = \frac{1}{n} \sum_{d | n} \mu \left( \frac{n}{d} \right) q^d$ counts both the number of irreducible polynomials of degree $n$ over $\mathbb{F}_q$ and the number of Lyndon words of length $n$ over an alphabet of size $q$.  Does there exist an explicit bijection between the two sets?

REPLY [5 votes]: The correspondence invented by Golomb relies on the choice of a primitive element a in the field of order q^n. Then, to each Lyndon word L=(l_0,l_1,...,l_{n-1}) one assigns the primitive polynomial having as a root the element a^{m(L)} where m(L) is the integer sum of l_i*q^i over i=0,1,...,n-1.