Sure. Does it have to pretty? If not, you can just test of the number is bigger than 1024, if so, subtract 1024, then check if it's bigger than 512, if so, subtract 512, etc. Basically recursively subtracting your numbers from large to small until your remainder ends up 0.
Notice that you can conveniently express your number series as 2^N (which is why you smartly picked those numbers anyway!)