TITLE: Number of homomorphisms from $D_n$ to $S_n$
QUESTION [10 upvotes]: Calculate the number of homomorphisms from $D_n$ (dihedral group of order $2n$) to $S_n$ (symmetric group of order $n!$).

For example, I calculated for $D_3$ to $S_3$ and it came to $10$ and for $D_4$ to $S_4$ it came to $124$.

REPLY [4 votes]: We can use $\textsf{GAP}$ to find the first few terms in this sequence:
gap> for n in [1..8] do
         Print( Size(AllHomomorphisms(DihedralGroup(2*n),SymmetricGroup(n))), "\n" );
         od;
1
4
10
76
146
3616
5272
195280

This sequence doesn't appear in the OEIS.  Note that the 76 disagrees with the OP's result of 124.
It's not hard to work out how many homomorphisms there from $D_p$ to $S_p$ when $p$ is prime.  If $\varphi\colon D_p\to S_p$ is such a homomorphism, then $\varphi(r)$ must have order $1$ or $p$:

If $\varphi(r)$ is the identity, then $\varphi(s)$ can be any self-inverse element of $S_p$.
If $\varphi(r)$ has order $p$, it must be a $p$-cycle, of which there are $(p-1)!$ possible choices.  Then $\varphi(s)$ must be an element of order two that conjugates this $p$-cycle to its inverse, of which there are exactly $p$ choices, for a total of $p(p-1)! = p!$ homomorphisms of this type.

So the total number of homomorphisms $D_p\to S_p$ is
$$
a_p \,+\, p!
$$
where $a_p$ is the number of $\sigma\in S_p$ for which $\sigma^2=1$.  The sequence $a_n$ is entry A000085 in the OEIS, and doesn't seem to have a nice closed-form formula.
Incidentally, this formula agrees with the $\textsf{GAP}$ data above for $n=2,3,5,7$.  It doesn't work when $n$ isn't prime since the order of $\varphi(r)$ can be any divisor of $n$, and because an element of order $n$ in $S_n$ need not be an $n$-cycle.