Quite Binary

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?


The answer is 315.

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.

1 solution

Zee Ell
Aug 29, 2016

Since 64 = 2 6 , therefore all natural number, which are smaller than 64 can be represented with a maximum of 6 binary digits. \text {Since } 64 = 2^6 \text {, 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 × ( 32 + 16 + 8 + 4 + 2 + 1 ) = 5 × 63 = 315 5 × (32 + 16 + 8 + 4 + 2 + 1) = 5 × 63 = \boxed {315}

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...