The Power of 2

Find the number of positive integers < 1000 < 1000 that can be expressed as 2 k 2 m , 2^k-2^m, where k k and m m are non-negative integers.


The answer is 50.

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.

7 solutions

Anis Abboud
Nov 3, 2013
  • k has to be greater than m (otherwise 2 k 2 m 2^{k}-2^{m} would not be positive). This also implies that k greater than 0 (otherwise m would be negative).
  • k cannot be greater than 10, because then 2 k 2 m 2^{k}-2^{m} would be greater than 1024. Thus, k is between 1 and 10.
  • Notice that for each (k, m) pair we get a different result for 2 k 2 m 2^k - 2^m . Explanation: Since m is smaller than k, 2 m < = 2 k 1 = 1 2 2 k 2^m <= 2^{k - 1} = \frac{1}{2} 2^k . i.e., 2 k 2 m 2^k - 2^m is at least half of 2 k 2^k . Also, increasing k by 1 doubles 2 k 2^k ...
  • For each value i of k, m can be between 0 and i - 1 => i options.
  • Therefore, the number of possible pairs is 1 + 2 + . . . + 10 = 55 1 + 2 + ... + 10 = 55 .
  • Out of these, 2 10 2 0 / 1 / 2 / 3 / 4 2^{10} - 2^{0/1/2/3/4} would give a result that is greater than 1000, therefore we exclude these 5 pairs, leaving 50 \boxed{50} valid pairs.
Daniel Liu
Nov 3, 2013

Note that if k = 10 k=10 , then 2 m > 24 2^m>24 so that 2 k 2 m < 1000 2^k-2^m<1000 . Therefore m 5 m\ge 5

If k 9 k\le 9 , then 0 m < k 0\le m< k .

Since there are k k different possibilities for m m if 0 m < k 0\le m< k , then the total number of possible ways for k 9 k\le 9 is 1 + 2 + + 8 + 9 = 45 1+2+\cdots +8+9=45 .

We add the possibilities where k = 10 k=10 . Since 5 m < 10 5\le m< 10 , there are 5 5 ways.

Therefore, the total number of ways is 45 + 5 = 50 45+5=\boxed{50} .

You need to prove that the values with k 9 k\le 9 do not overlap.

Daniel Chiu - 7 years, 7 months ago

Log in to reply

Does it have anything to do with the fact that for each 2 k 2 m 2^k-2^m , you can factor out 2 m 2^m and have a unique 2 k m 1 2^{k-m}-1 for each m m in [ 1 , 10 ] [1,10] and each individual k k ? After starting the prime factorizations for all of the values for 2 k 2 m 2^k-2^m , you would have 2 m 2^m and some other number not divisible by 2 2 .

Trevor B. - 7 years, 7 months ago

Log in to reply

Yeah I was thinking of something like that.

Daniel Chiu - 7 years, 7 months ago

m and k are non negative. 2^k - 2^m will be positive integers if k>m. m is non negative so if: m=0, k={1,2,...,9}. there are 9 solutions. m=1, k={2,3,...,9}. there are 8 solutions. m=2, k={3,4,...,9}. there are 7 solutions. m=3, k={4,5,...,9}. there are 6 solutions. m=4, k={5,6,...,9}. there are 5 solutions. m=5, k={6,7,...,10}. there are 5 solutions. m=6, k={7,8,...,10}. there are 4 solutions. m=7, k={8,9,10}. there are 3 solutions. m=8, k={9,10}. there are 2 solutions. m=9, k={10}. there is 1 solution. if m>9, then k>10, 2^k - 2^m is larger than 1000. so there is no solutions for m>9. the answer is 9+8+7+6+5+5+4+3+2+1=50.

Anesh Krishna
May 20, 2014

since the positive integer required is less than 1000,

maximum value of k = 10 and corresponding values of m range from 5 to 9 value of k = 9 and corresponding values of m range from 0 to 8 value of k = 8 and corresponding values of m range from 0 to 7 value of k = 7 and corresponding values of m range from 0 to 6 value of k =6 and corresponding values of m range from 0 to 5 value of k = 5 and corresponding values of m range from 0 to 4 value of k = 4 and corresponding values of m range from 0 to 3 value of k = 3 and corresponding values of m range from 0 to 2 value of k = 2 and corresponding values of m range from 0 to 1 value of k = 1 and corresponding values of m =0

totally we get 50 numbers :)

Ashish Pathak
May 20, 2014

As 2^k - 2^m should be positive, then we can make cases and calculate the total number of integers.
For m=1, k can be {2,3,4,5,6,7,8,9} m=2, k can be {3,4,5,6,7,8,9} m=3, k be {4,5,6,7,8,9} m=4, k be {5,6,7,8,9} m=5, k be {6,7,8,9,10} m=6, k be {7,8,9,10} m=7, k be {8,9,10} m=8, k be {9,10} m=9, k be {10} Adding all these cases Therefore Total number of cases = 50

Ved Gupta
May 20, 2014

The largest power of 2 below 1000 is 9 as 2^9 = 512 and 2^{10} = 1024 Fixing k = 9, m = {8,7,6 ... 2,1,0} i.e. 9 solutions as 0 < 2^9 -2^m < 1000

similarly fixing k = {8,7,6,5,4,3,2,1} we get 8,7,6,5,4,3,2,1 solutions respectively adding no. of solutions given above = 45 Now let k =10 Then 2^10 - 2^m <1000 or 1024 > 2^m > 24 It follows 2^m =32, 64, 128, 256, 512 or m = {5,6,7,8,9} 5 solutions Total solutions = 45+5 = 50

Daniel Alfaro
Nov 4, 2013

In order for our number N 2 k 2 m = N 2^{k}-2^{m}=N to be positive then k > m k>m .

So if k=1 then m has to be 0 \longrightarrow 1 solution (notice the difference in the wording between non-negative and positive) if k=2 then m can either be 1 or 2.... \longrightarrow 2 solutions Therefore we have k solutions for every k value. if k=10 then 2 10 = 1024 2^{10}=1024 so m can't be 2 0 , 2 1 , 2 2 , 2 3 , 2 4 2^{0}, 2^{1}, 2^{2}, 2^{3}, 2^{4} or otherwise N>1000

Since we have k solutions for every k value, and there are 9 values of k (plus the solutions for k=10 which are 5) ; then the number of solutions are \frac{9+1}{2}\dot 9}\=45} (sum of algebraic sequence) numer of solution from k=1 to k=9 \(\longrightarrow 45 + numer of solution from k=10 \longrightarrow 5 = 50 (45+5=50)

You need to prove that the values with k 9 k\le 9 do not overlap.

Daniel Chiu - 7 years, 7 months ago

sorry for the mistake

Daniel Alfaro - 7 years, 7 months ago

In order for our number N 2 k 2 m = N 2^{k}-2^{m}=N to be positive then k > m k>m .

So if k=1 then m has to be 0 \longrightarrow 1 solution (notice the difference in the wording between non-negative and positive) if k=2 then m can either be 1 or 2.... \longrightarrow 2 solutions Therefore we have k solutions for every k value. if k=10 then 2 10 = 1024 2^{10}=1024 so m can't be 2 0 , 2 1 , 2 2 , 2 3 , 2 4 2^{0}, 2^{1}, 2^{2}, 2^{3}, 2^{4} or otherwise N>1000

Since we have k solutions for every k value, and there are 9 values of k (plus the solutions for k=10 which are 5) ; then the number of solutions are 9 + 1 2 9 ˙ = 45 \frac{9+1}{2} \dot 9=45 (sum of algebraic sequence) numer of solution from k=1 to k=9 \longrightarrow 45 + numer of solution from k=10 \longrightarrow 5 = 50 (45+5=50)

Daniel Alfaro - 7 years, 7 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...