Consider the case when n = 437
N in base 2: (Converting n to binary) 110110101
The reverse binary of n is 101011011
Initially a and b will be 0.
So, reverse binary of n = 101011011
a = 000000000
b = 000000000
Whenever you see a '1' in the reverse binary of n, place a 1 in the similar position in number_a or number_b. Start with number_a first. If you store the reverse binary of n in a string then str[0] == '1' (In this example, however this is not true in all cases, the first '1' might appear in str[3], str[6], etc). So, make number_a[0] = '1'. str[1] == '0' so just continue the loop. str[2] == '1' again, so this time make number_b[2] = '1'. str[4] == '1' so this time make number_a[4] = '1'. Repeat this process until you reach NULL.
Now, char number_a and char number_b contains the binary form of a and b, but in reversed order. So I hope you know what you have to do now. You can just convert number_a and find b from the relation:
n = a + b
Good luck.
![:roll:](./images/smilies/icon_rolleyes.gif)