剛剛收到另一個討論區給我的解法
Let f(n) be the sum of all the 'alternating sums' of{1,2,3.....n} 's subsets.
To evaluatef(n), we can calculate the 'alternating sums' by separating the subsets into two types: contains and does not contain .
For those 2^(n-1) subsets which does not contain , the sum of 'alternating sums' will be f(n-1) .
For the remaining2^(n-1) subsets containing , must be the greatest number in the subsets.
Every subsets of these can be expressed as {n}聯集A, where A包含在{1,2,3.....n-1}, and so its 'alternating sum' must equal minus the 'alternating sum' of A .
Therefore the sum of 'alternating sums' of these subsets= sigma[A包含在(1,2,.....n-1)] [n-alternating sum(A)]=2^(n-1) *n-f(n-1).
Summing up, we get f(n)=2^(n-1)n .