@Avik: Correcting/augmenting your post:

N = (3*4096+15*256+3*16+3)
   = 3*(2^12) + 15*(2^8) + 3*(2^4) + 3*(2^0)
   = (2+1)*(2^12) + (8+4+2+1)*(2^8) + (2+1)*(2^4) + (2+1)
   = (2^1+2^0)*(2^12) + (2^3+2^2+2^1+2^0)*(2^8) + (2^1+2^0)*(2^4) +
(2^1+2^0)
   = 2^13 + 2^12 + 2^11 + 2^10 + 2^9 + 2^8 + 2^5 + 2^4+ 2^1 + 2^0

So there are 10 1's in the binary representation of the number N.

Dave

On Aug 6, 12:42 am, Avik Mitra <tutai...@gmail.com> wrote:
> N = (3*4096+15*256+3*16+3)
>    = 3* (2^10) + 15*( 2^8) + 3*(2^4) + 3* (2^0)
>    = (1+2)*(2^10) + (1+2+2^2+ 2^3)*(2^8) + (1+2)*(2^4) + (1+2)
>    = (2^10 + 2^11) + (2^8+2^9+2^10+2^11) + (2^4 + 2^6)+ (1+2)
>    = 2^11+2^12+2^8+2^9+2^4+2^6+2+1
>    = 1 + 2 + 2^4 + 2^6 + 2^8 + 2^9 + 2^11 + 2^12
>
> So there are 8 1's in the binary representation of the number N.

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algoge...@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to