Conjugacy class size formula in symmetric group

Statement
Suppose $$n$$ is a natural number and $$\lambda$$ is an unordered integer partition of $$n$$ such that $$\lambda$$ has $$a_j$$ parts of size $$j$$ for each $$j$$. In other words, there are $$a_1$$ $$1$$s, $$a_2$$ $$2$$s, $$a_3$$ $$3$$s, and so on. Let $$c$$ be the conjugacy class in the symmetric group of degree $$n$$ comprising the elements whose cycle type is $$\lambda$$, i.e., those elements whose  cycle decomposition has $$a_j$$ cycles of length $$j$$ for each $$j$$. Then:

$$\! |c| = \frac{n!}{\prod_j (j)^{a_j}(a_j!)}$$

Note that those $$j$$ where $$a_j = 0$$ contribute a $$1$$ in the denominator and can be ignored from the product, while for those $$j$$ where $$a_j = 1$$, the $$a_j!$$ term can be omitted.

Equivalently, if $$C$$ is the centralizer of any element of $$c$$, then:

$$\! |C| = \prod_j (j)^{a_j}(a_j!)$$

These are equivalent because size of conjugacy class equals index of centralizer, which follows from the identification of the conjugacy class with the left coset space of the centralizer via the action of the group on itself as automorphisms by conjugation.

Related facts

 * Cycle type determines conjugacy class
 * Splitting criterion for conjugacy classes in the alternating group

Illustrative examples
For instance, consider $$n = 23$$ with the partition $$23 = 3 + 3 + 3 + 3 + 2 + 2 + 2 + 1 + 1 + 1 + 1 + 1$$. There are four 3s, three 2s, and five 1s. An example element with this cycle type is given by the cycle decomposition:

$$\! (1,2,3)(4,5,6)(7,8,9)(10,11,12)(13,14)(15,16)(17,18)$$

The size of the conjugacy class corresponding to this partition is:

$$\! \frac{23!}{[(3)^4(4!)][(2)^3(3!)][(1)^5(5!)]}$$

Here's another example: $$13 = 5 + 4 + 4$$. There is one 5 and two 4s, and we get:

$$\! \frac{13!}{[(5)^1(1!)][(4)^2(2!)]}$$

When a particular $$j$$ has $$a_j = 1$$ (i.e., it occurs only once in the partition) then the corresponding term divided is $$j^1(1!) = j$$, so the above can be written more briefly:

$$\! \frac{13!}{[5][(4)^2(2!)]}$$

Similarly, consider $$15 = 5 + 4 + 3 + 3$$. We get:

$$\! \frac{15!}{[5][4][(3)^2(2!)]}$$

Comprehensive treatment of small degrees
In the right column links in the table below, you can see tabulated information on the sizes of conjugacy classes, as well as how the formula is applied to the cycle sizes to compute each specific size. The cases $$n = 3,4,5$$ are embedded below.