# On alternating sums of the elements of subsets.

Recently in a contest a question was asked as under.

We define a lead element of a set $\{a_1,a_2,a_3, \cdots a_n\}$ as $$l(\{a_1,a_2,a_3, \cdots a_n\})=|a_1-a_2+a_3-a_4 \cdots(-1)^{n-1}a_n|$$

Now let $X_n$ be the set of natural numbers from $1$ to $n$.

Then find the sum of all the lead elements of all the non empty subsets of $X_n$ in terms of $n$?

I guess some recursion relation will build up ,but I am not able to get the solution.

• Have you tried writing out the first few terms, finding a pattern, then trying to prove it by induction? – rogerl Nov 1 '14 at 13:47
• what do you use for the ordering of elements needed to define the lead elements of a subset? – David Holden Nov 1 '14 at 13:52
• The same order of 1 to n – Love Everything Nov 1 '14 at 13:54
• So its not a set, its an ordered sequence is it? If so, you could group the difference of adjacent elements together and see what happens for even and odd $n$ separately – Macavity Nov 1 '14 at 14:20
• @Macavity kinda ..but the question used the word set – Love Everything Nov 1 '14 at 14:22