Summing elements of a sequence Let the sequence $a_n$ be defined as $a_n = 2^n$ where $n = 0, 1, 2, \ldots $
That is, the sequence is $1, 2, 4, 8, \ldots$
Now assume I am told that a certain number is obtained by taking some of the numbers in the above sequence and adding them together (e.g. $a_4 + a_{19} + a_5$),  I may be able to work out what numbers from the sequence were used to arrive at the number.  For example, if the number given is 8, I know that the sum was simply $a_3$, since this is the only way to get 8.  If i'm told the number is 12, I know that the sum was simply $a_3 + a_2$. 
If I'm told what the resulting number, can you prove that I can always determine which elements of the above sequence were used in the sum to arrive at that number?  

Fundamental reason: The division algorithm.
For any number $a\geq 0$, we know there exists a unique $q_0\geq 0$ and $0\leq r_0<2$ such that
$$a=2q_0+r_0.$$
Similarly, we know there exists a unique $q_1\geq 0$ and $0\leq r_1<2$ such that
$$q_0=2q_1+r_1.$$
We can define the sequences $q_0,q_1,\ldots$ and $r_0,r_1,\ldots$ in this way, i.e. $q_{n+1}\geq 0$ and $0\leq r_{n+1}< 2$ are the unique solutions to
$$q_n=2q_{n+1}+r_{n+1}.$$
Note that $0\leq r_n<2$ is just equivalent to $r_n\in\{0,1\}$.
Also note that if $q_n=0$ for some $n$, then $q_k=0$ and $r_k=0$ for all $k>n$.
Because $\frac{1}{2} q_n\geq q_{n+1}$ for any $n$, and because every $q_n$ is a non-negative integer, we will eventually have $q_n=0$ for some $n$. Let $N$ be the smallest index such that $q_N=0$.
Then
$$\begin{align}
a&=2q_0+r_0\\
&=2(2q_1+r_1)+r_0\\
&\cdots\\
&=2(2(\cdots (2q_N+r_N)+r_{N-1}\cdots )+r_1)+r_0\\
&=2^Nr_N+2^{N-1}r_{N-1}+\cdots+r_0\\
\end{align}$$
is a sum of terms from the sequence $a_n=2^n$, specifically those $a_n$'s for which the corresponding $r_n=1$ instead of 0.
