Find $X, Y \in \mathbb{Z}$ such that $2^a X + (2^b - 1) Y = 1$ (coprimality) I've been wrecking my brain trying to solve this exercise. Is this answer wrong?
$$X= (2^{a})^{b-1}, Y= (-1) (2^b +1) \ [(2^b -1)(2^b +1)]^{a-1}$$

Supposing $a,b>0$.For sure there exists a number $m\in \Bbb{Z}$ such that:
$$mb\geq a\Rightarrow m\geq \frac{a}{b} \Rightarrow m\geq \left \lceil{\frac{a}{b}}\right \rceil=M $$
Notice that if:
$$Y=-\sum_{i=0}^{M} 2^{bi}=\frac{-2^{b(M+1)}+1}{2^b-1}$$
Then the equation becomes:
$$2^a X-2^{b(M+1)}+1=1$$
Clearly this is satisfied by:
$$X=2^{bM+b-a}$$
So our particolar solutions are:
$$X=2^{b\left(\left \lceil{\frac{a}{b}}\right \rceil+1\right)-a} \ , \ Y=\frac{1-2^{b\left(\left \lceil{\frac{a}{b}}\right \rceil+1\right)}}{2^b-1}$$
So the general solutions are:
$$X=2^{b\left(\left \lceil{\frac{a}{b}}\right \rceil+1\right)-a}+(2^b-1)k \ , \ Y=\frac{1-2^{b\left(\left \lceil{\frac{a}{b}}\right \rceil+1\right)}}{2^b-1}-2^ak$$
:)
