Shifting and adding to get multiplication values? multiplying by 33 --> $2^5 + 2^0$
is same as (num &lt;&lt; 5) + 1

and by 65599 as (num &lt;&lt; 16) + (num &lt;&lt; 6) - (num &lt;&lt; 0)

How do you get these numbers though i.e. 16,6?? I know log can be used but Is there any other quicker way to do this?

EDITED___________________

what I need to do is create a hash function such that I have to recursively multiply with numbers like 65599 or 33... hence the shift might be a better option
Shifting left is the same as multiply by two.
Take number, say in your example 33, convert to binary, 100001, here 1&lt;&lt; 6 is the leftmost bit and 1 is rightmost bit. As you have noticed it is $2^0$.

Second example is handled manually, it is 10000000000111111, so at first you set leftmost bit, then notice that consecutive ones could be converted to 1000000 - 1.

Standard usage is to speed up multiplication by constant, so you precompute it and use in your code. It makes sense until additions, subtractions and bit shifts are cheaper on target machine than one vanilla multiplication.
Some bit twidlings are already present in compilers, other may break compilers ability to optimise more.

Such operation is good in static, compiled languages, like C. It may work on managed ones (with platform independent emulation of arithmetic operations), but makes little sense on interpreted languages like Python (unless you compile it).