I posted it as an olympiad problem, because it was given on a math olympiad (former second round, now first in the Bulgarian math olympiad). They have the same answer as your but I didn't undertstand the solution and tried to solve the problem in a different way.
What I did was - each different pair of shoes is an element of a set with

elements. From the taken shoes is it is possible to have exactly

pair of shoes (case

), exactly

pairs of shoes (case

), ..., exactly

pairs of shoes (case

). Summing the different cases gives

as a final result.
Did I make a mistake? If no - is it possible the expression I found to be simplified further?