Calculating all possible sums of the numbers $2^0, 2^1, \ldots, 2^{(n-1)}$ Using the simple equation $2^{n-1}$ you get values such as:
$1,2,4,8,16,32,64,128,256,$ etc. 
How can I find all possible number combinations within this range? For example, the numbers $1,2,4,8$ give:
\begin{align}
1 &= 1 \\
2 &= 2 \\
1 + 2 &= 3 \\
4 &= 4 \\
1 + 4 &= 5 \\
2 + 4 &= 6 \\
1 + 2 + 4 &= 7 \\ 
8 &= 8 \\
1 + 8 &= 9 \\
2 + 8 &= 10 \\
1 + 2 + 8 &= 11 \\
4 + 8 &= 12 \\
1 + 4 + 8 &= 13 \\
2 + 4 + 8 &= 14 \\ 
1 + 2 + 4 + 8 &= 15
\end{align}
The numbers calculable are: $1,2,3,4,5,6,7,8,9,10,11,12,13,14,15$.
Background I'm a computer programmer trying to get a unique number which represents a series of other numbers without the unique IDs being lost. 
If I assign $5$ people with the id's, $1,2,4,8,16$, then in order to pass the list of them I don't need to list them all, just the mathematical equation to work it out. For example, if I wanted people $1,2,4$ then I could just pass the number $7$ and therefore it would HAVE to be people $1,2,4$ as there is no other possible combination to make this. 
Please let me know if my logic is flawed somewhere! 
Thanks,
Nick

Every integer from $1$ to $2^n-1$ is expressible using the sums of the numbers $1,2,4,8, ... 2^{n-2}, 2^{n-1}$, and no other numbers. This can be proven using induction. 
