Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

if were only allowed to use >>, -, + to make a number X times the constant K lets assume K is 17 and K is 20 how to make an expression for each

I was trying to think of ways to do this but I cant.

share|cite|improve this question
Could you elaborate? Operating only on $K$ itself you cannot make it larger by merely right-shifting, assuming you do not carry over bits shifted right-out. What is $1>>1$? How are $+, -$ defined? What can they operate on? – gnometorule Dec 18 '12 at 18:01
I got the answer look at it below that looks right – jyuserersh Dec 18 '12 at 18:13
up vote 1 down vote accepted

If $a$ is expressed in binary $$2^n\cdot a=a<<n$$ where $<<$ is the bitwise left shift operator.

$$17\cdot a=(2^4+1)\cdot a=(a<<4)+a$$ and $$20\cdot a=(2^4+2^2)\cdot a=(a<<4)+(a<<2)$$

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.