take the example $2^x+2^y= 9$ (say), in general how would I find the number of solutions that exist? Here of course the answers are $(3,0) \text{ or }(0,3)$.
But how would that work for something more complicated like $2^x +2^y +2^z= 2336$?
take the example $2^x+2^y= 9$ (say), in general how would I find the number of solutions that exist? Here of course the answers are $(3,0) \text{ or }(0,3)$.
But how would that work for something more complicated like $2^x +2^y +2^z= 2336$?
For your second example, let $x$, $y$ and $z$ be integers such that $$2^x+2^y+2^z=2336.\tag{1}$$ Without loss of generality $x\leq y\leq z$. If $x<0$ then also $y<0$ as otherwise the left hand side cannot be an integer. Then $0<2^x+2^y\leq1$ and so $2335\leq 2^z<2336$, which is clearly impossible, and so $x,y,z\geq0$. Note that if $x<y<z$ then $(1)$ gives a binary representation for $2336$ with precisely three nonzero digits. There can be at most one such solution, or at most six solutions if we permute $x$, $y$ and $z$.
Because $x,y,z\geq0$ we see that $2^x$, $2^y$ and $2^z$ are all integers, and $$2^x(1+2^{y-x}+2^{z-x})=2336=2^5\times73,\tag{2}$$ If $1+2^{y-x}+2^{z-x}$ is even then $y-x=0$ and $z-x>0$, and we get $$2^5\times73=2^x(1+2^{y-x}+2^{z-x})=2^{x+1}(1+2^{z-x-1}),$$ which implies that $x=4$ and $2^{z-x-1}=72$, which is of course impossible. Hence $1+2^{y-x}+2^{z-x}$ is odd, so we see from $(2)$ that $x=5$ and $$1+2^{y-z}+2^{z-x}=73.$$ Then because $2^{z-x}\geq2^{y-x}$ we see that $\frac{72}{2}\leq2^{z-x}<72$, so $z-x=6$ meaning that $z=11$, and it follows that $2^{y-x}=8$ meaning that $y=8$. We find that $(x,y,z)=(5,8,11)$ and counting all permutations, we find a total of $3!=6$ solutions.