What is the sum (in base 10) of all the natural numbers less than 64 which have exactly two ones in their base 2 representation?
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
Since 6 4 = 2 6 , therefore all natural number, which are smaller than 64 can be represented with a maximum of 6 binary digits.
If we want to have a binary number with (maximum 6 digits and) exactly two "1" digits, we can consider a choice of 2 out of 6 binary places. We can choose (the first digit 6 ways, and) the second digit 5 ways. This means, that there are exactly 5 numbers, which share the same "1" digit at the same place (e.g. all have a "1" as the third digit, our first choice).
Therefore, the sum we are looking for:
5 × ( 3 2 + 1 6 + 8 + 4 + 2 + 1 ) = 5 × 6 3 = 3 1 5