A person has $32$ cards out of which $10$ cards, each of blue, green and red colours, have denominations as $\{2^1, 2^2,\cdots , 2^{10}\}$ and one black and one white each of whose value is unity. What is the number of ways in which the person can get a sum of $2012$ if he can choose any number of cards?
I couldn't think much in it, except that number of ways of choosing $\text{(blue,black,white)}$ is equal to if he chooses $\text{(green,black,white) or (red,black,white)}$.
So if suppose he chooses $\text{(blue,black,white)}$, the total sum of the cards would be $$1+1+2+2^2+\cdots+2^{10}=2^{11}=2048$$
So, if we remove the cards whose sum equals $36$, we will get $2012$. Thus, we need to find the number of ways in which the sum on cards equals $36$. I tried it, but there were so many cases, that I gave up. I also haven't taken the case if he chooses for instance $\text{(blue,green,white)}$ etc.
The answer to this is $1007^2$, which suggests some easy method must be there.
Any hints would be appreciated!