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 [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/algogeeks?hl=en.