Just calculate the logarithms with base 2 and round down:

log(2008)/log(2) = 10.97... ==> 10

log(2008-2^10)/log(2) = 9.94... ==> 9

log(2008-2^10-2^9)/log(2) = 8.88... ==> 8

log(2008-2^10-2^9-2^8)/log(2) = 7...

log(2008-2^10-2^9-2^8-2^7)/log(2) = 6...

log(2008-2^10-2^9-2^8-2^7-2^6)/log(2) = 4...

log(2008-2^10-2^9-2^8-2^7-2^6-2^4)/log(2) = 3 exactly

So we have 2^10+2^9+2^8+2^7+2^6+2^4+2^3=2008.