Too Many 2s

Every positive integer can be written as a sum of distinct powers of two. For example, 101 = 2 0 + 2 2 + 2 5 + 2 6 101={ 2 }^{ 0 }+{ 2 }^{ 2 }+{ 2 }^{ 5 }+{ 2 }^{ 6 }

As we can see, 101 101 is written as a sum of four distinct powers of two. How many positive integers less than 2 222 { 2 }^{222} can be written as a sum of four distinct powers of two?

Note: 38 = 2 1 + 2 2 + 2 4 + 2 4 { 38=2 }^{ 1 }+{ 2 }^{ 2 }+{ 2 }^{ 4 }+{ 2 }^{ 4 } is NOT valid, since 2 4 { 2 }^{ 4 } appears twice.


The answer is 98491965.

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.

2 solutions

Jackson Abascal
Nov 10, 2014

The expanded summation of powers of two of a number is another way of describing how it is written in base 2. Let's use the given example, 101 10 = 1100101 2 { 101 }_{ 10 }={ 1100101 }_{ 2 } Notice that the coefficients given in the powers of two summation form of 101 are mirrored in it's base 2 representation - the 0th, 2nd, 5th, and 6th digits are all 1, starting with the least significant digit as the 0th power and moving left.

Writing powers of two in base 2 is rather simple. In the same way that 10 x { 10 }^{ x } is a 1 followed by x zeroes in base 10, 2 x { 2 }^{ x } is a 1 followed by x zeroes in base 2. 2 222 { 2 }^{ 222 } must then be a one followed by 222 digits, and is 223 digits long.

Once again in the same way that 10 x { 10 }^{ x } is the lowest x+1 digit number in base 10, 2 x 2^{ x } is the lowest x+1 digit number in base 2. Since we're considering only numbers less than 2 222 { 2 }^{ 222 } , we are therefore considering every number with 222 digits or less in base 2.

Let's imagine a series of 222 zeroes written in a row. If we can "flip" some of them to ones, we can represent every number from 0 0 to 2 222 1 { 2 }^{ 222 }-1 in binary. We know from earlier that if we flip any 4 unique zeroes to ones, then the number will have four terms in its summation form.

The number of different ways we can choose 4 zeroes to flip from 222 is given by the binomial coefficient n C r ( 222 , 4 ) = 222 ! 4 ! ( 222 4 ) ! = ( 219 ) ( 220 ) ( 221 ) ( 222 ) ( 1 ) ( 2 ) ( 3 ) ( 4 ) = 98491965 nCr(222, 4)=\frac { 222! }{ 4!(222-4)! } =\frac { (219)(220)(221)(222) }{ (1)(2)(3)(4) } =\boxed{98491965}

To generalize, the number of integers less than 2 a { 2 }^{ a } that have b b terms when expressed as a sum of distinct powers of two is simply n C r ( a , b ) nCr(a, b) .

Note: This perhaps isn't the most direct path of finding the solution, but I like it because it's relatively easy to understand when solved with the binary digits analogy.

Wow. I've never thought of this way though. :/

Joeie Christian Santana - 6 years, 6 months ago

biggest number is 2^221+2^220+2^219+2^218,any solution is this type x=2^a+2^b+2^c+2^d,a<b<c<d<222,so we choose 4 numbers of 222(from 0 to 221),answer is nCr(222,4)=98491965

Nikola Djuric - 6 years, 6 months ago
Raman Chan
Dec 14, 2014

treat the numbers as binary forms then numbers under 2^222 will have 222 digits in binary form of which as per question there must be 4 distinct powers of 2 so now for powers of 2 we take 1,1,1,1 and 218 0s
then permuting them weget 222! /(218!4!) which gives 98491965

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...