TITLE: When do permutations commute?
QUESTION [7 upvotes]: When do two permutations commute?
How do you find out something like how many permutations in $S_7$ commute with $(12)(345)$?

REPLY [2 votes]: The answer below is incorrect as stated and needs an edit, please see discussion below. And please don't upvote this, it's bad enough that this answer has gotten a bounty.

In your case (and in this earlier question), all cycles have different lengths, but in general, a permutation may have some equal length cycles in its disjoint cycle decomposition. Permutations $\sigma$ and $\pi$ commute when $\pi$

permutes elements within disjoint cycles of $\sigma$, and/or
permutes the sets of elements in equal length disjoint cycles of $\sigma$.

Klein 4-group is the smallest nontrivial example of the second action. E.g. $(12)(34)$ commutes with $(13)(24)$ because $(13)(24)$ maps the set $\{1,2\}$ onto set $\{3,4\}$ and vice versa.