How can a Turing machine write the description of the n-th Turing machine?
The question is probably assuming that there is some arbitrary but agreed-upon convention that specifies how to write a Turing machine description with the symbols of some alphabet. Since all Turing machines have by definition a finite description, all valid outputs will be finite strings. 

The exercise itself is an ordinary combinatorics problem.