Number in binary as a product I agree that any binary number that consists of $n$ ones (and no zeros) has as its decimal equivalent the number $2^n - 1$. However, the author of the book I'm reading next makes the following claim, which I don't quite see. He says that as a consequence of the fact above, it follows that any binary number that has the form of starting with $n$ ones and ending with $n - 1$ zeros (with nothing between them) has as its decimal equivalent the number $2^{n - 1}(2^n - 1)$. For example, the decimal number 496 in binary is 111110000, which consists of five 1s followed by four 0s, so $496 = 2^4 \times (2^5 - 1) = 16 \times 31$. But why is this true, i.e. why does it work? 

Since your binary number starts with $n$ ones followed by $n-1$ zeros, the number has $n+(n-1) = 2n-1$ binary digits. Therefore its decimal value is
$$ 
\begin{align}
& 0 \times 2^{0} + 0 \times 2^{1} + \cdots + 0 \times 2^{n-2} + 1 \times 2^{n-1} + 1 \times 2^{n} + 1 \times 2^{n+1} + \cdots + 1 \times 2^{2n-3} +  1 \times 2^{2n-2}  \\
&= 2^{n-1} \left( 1 + 2 + 2^2 + \cdots + 2^{n-2 } + 2^{n-1} \right) \\
&= 2^{n-1} \frac{1 - 2^n }{1 - 2 } \\
&= 2^{n-1} \frac{2^n - 1 }{2-1} \\
&= 2^{n-1} \left( 2^n-1 \right).
\end{align}
$$
