I have an sequence of numbers 1, 2, 4, 8, 16, 32 and so on. Given an number, which must be the sum of the sequence, for example: 44(which is the sum of 4+8+32). How do I know the number 44 is composed by 4, 8 and 32?
I suck at math, and I think most suitable is root extraction(Nth root), someone can give some advice for my problem? If there's any method that can help.
This is how you write numbers in binary.
Divide your number by 2, divide the result by 2 again, and repeat.
Now look at your remainders. If a remainder is 0, ignore it. If the remainder of the first division is 1, that gives you 1. If the remainder of the second division is 1, that gives you 2. If the remainder of third division is 1, you get 4; then 8; then 16; and so on.
In your example, $$ 44/2=22\\ 22/2=11\\ 11/2=5 rem 1 \text{(that means 4)}\\ 5/2=2 rem 1 \text{(that means 8)}\\ 2/2=1\\ 1/2=0 rem 1 \text{(that means 32)}$$