Exponential generating function for number of permutations of n with one distinct cycle Let $g_n$ be the number of ways of selecting a permutation of length n, and then selecting a cycle within that permutation and marking it as "special" or distinguished. My goal is to find the exponential generating function
$G(x)=\sum_{n=0}^\infty g_n\frac{x^n}{n!}$
My thinking is to view this as a composition of two actions, where first we select a permutation of length n, which can be done in $n!$ ways and thus has exponential generating function $A(x)=\sum_{n=0}^\infty x^n = \frac{1}{1-x}$. Then, we do the action of selecting a cycle within that permutation and marking it as "special". This has generating function $B(x)=\sum_{n=0}^\infty b_n\frac{x^n}{n!}$, but I am having trouble thinking about what $b_n$ would be exactly. I know that once I figure out $b_n$ then the generating function G that I originally want would be given by $G(x)=B(A(x))$.
How can I find out what $b_n$ is in terms of n? It seems to be the number of cycles I would have to choose from a given permutation of length n would vary wildly depending upon the permutation I choose.
Any help is greatly appreciated! Thanks
 A: Using combinatorial classes as in Analytic Combinatorics by Flajolet
and Sedgewick we have the following class $\mathcal{P}$
of permutations with cycles marked:
$$\def\textsc#1{\dosc#1\csod}
\def\dosc#1#2\csod{{\rm #1{\small #2}}}
\mathcal{P} = \textsc{SET}(
\mathcal{U} \times \textsc{CYC}_{=1}(\mathcal{Z})
+\mathcal{U} \times \textsc{CYC}_{=2}(\mathcal{Z})
+\mathcal{U} \times \textsc{CYC}_{=3}(\mathcal{Z})
+ \cdots).$$
This gives the EGF
$$G(z, u) = \exp\left(uz
+ u\frac{z^2}{2}
+ u\frac{z^3}{3}
+ u\frac{z^4}{4}
+ u\frac{z^5}{5}
+ \cdots\right)
\\ = \exp\left(u\log\frac{1}{1-z}\right).$$
Now we want to turn the term $u^k \frac{z^n}{n!}$ representing a
permutation of $n$ elements consisting of $k$ cycles into
$k\frac{z^n}{n!}$ so we differentiate and set $u$ to one to get
$$H(z) = \left.\frac{\partial}{\partial u} G(z,u)\right|_{u=1}
= \left. \exp\left(u\log\frac{1}{1-z}\right)
\log\frac{1}{1-z} \right|_{u=1}
\\ = \frac{1}{1-z} \log\frac{1}{1-z}.$$
Extracting coefficients from this we get the count
$$n! [z^n] H(z) = n! H_n$$
where we have used harmonic numbers $H_n = \sum_{q=1}^n \frac{1}{q}.$
Note also that the above mixed GF shows that a permutation has $H_n$ cycles on average, so we would expect a factor of $H_n.$
A: A more concrete approach (compared to Marko Riedel's) is to think of the thing you're trying to construct as arising by (set) partitioning $\{1,2,\dots,n\}$ into 2 sets $(S,S^c)$, then building a cyclic permutation on $S$ and an arbitrary permutation on $S^c$. Luckily this "splitting then building an $A$-structure on $S$ and a $B$-structure on $S^c$" is exactly what multiplication of exponential generating functions models.
 The EGF for cyclic permutations is $\ln(1/(1-x))$, and that for all permutations is $1/(1-x)$ so, as Marko shows, the EGF you want is $$ \frac1{1-x} \ln \,\Bigl( \frac1{1-x} \Bigr). $$
 One extracts the coefficients by noting that (ordinary) power series multiplication by $1/(1-x)$ has the effect of summing initial segments of the other power series. Thus, again as in Marko's answer, $$ g_n = \sum_{i=1}^n \frac1i .$$
