What is the the sum of orders of all elements of $S_n$?
It is quite easy to calculate this value for small $n$-s:
For $S_1$ it is $1$, as it is trivial. For $S_2$ it is $3$ (as $S_2$ is isomorphic to $\mathbb{Z}_2$). For $S_3$ it is $13$ as it has $1$ element of order $1$, $3$ elements of order $2$ and $2$ elements of order $3$. For $S_4$ it is $73$ as it has $1$ element of order $1$, $6$ elements of order $2$, $8$ elements of order $3$ and $9$ elements of order $4$. For $S_5$ it is $501$ as it has $1$ element of order $1$, $10$ elements of order $2$, $20$ elements of order $3$, $45$ elements of order $4$, $24$ elements of order $5$ and $20$ elements of order $6$.
However, I do not know, how to find this value in general.
Any help will be appreciated.
According to “The average order of a permutation” by Richard Stong, the sum of the orders of all elements of $S_n$ has the following asymptotic:
$$n!e^{C\sqrt{\frac{n}{\log(n)}} + O\left(\frac{\sqrt{n}\log(\log(n))}{\log(n)}\right)}$$
where $C \approx 2.99047$ is a constant.