Let's connect the numbers from the set S={1,2,3,…,2n−1,2n} in pairs:
Let X be any n-element subset of the set S. Choose (if possible) the smallest number x from the set X with the property that the number y paired with x does not belong to the set X. Then remove the element x from the set X and replace it with the element y. The resulting set is called f(X). The sets X and f(X) have sums of elements of different parity.
In the further part of the solution, we will consider two cases:
(a) The number n is odd.
The mapping f is defined for any n-element subset of the set S and it pairs all n-element subsets with odd sums of elements with all n-element subsets with even sums of elements. This proves that the number of n-element subsets with even sums of elements is the same as the number of n-element subsets with odd sums of elements.
(b) The number n is even.
In this case, the mapping f can only be defined for those n-element subsets of the set S that consist of complete pairs. There are (n/2n) such subsets, and all of them have sums of elements with the same parity as the parity of the number n/2. The remaining subsets can be paired as (X,f(X)). If n is divisible by four, then the number of n-element subsets with even sums of elements is (n/2n) more than the number of n-element subsets with odd sums of elements. If, however, n is not divisible by four, then the number of n-element subsets with odd sums of elements is (n/2n) more.