Number of permutations which have the same Kendall-Tau distance Input: The number of elements $m$ and an (positive) integer distance $d$.
Ouput: The number of permutations of $m$ elements which have Kendall-Tau distance $d$ from a fixed permutation.

I think there should be a closed formula. Does anybody know a good reference?
This StackOverflow question answers your question. You might also be interested in this OEIS sequence.