division with a remainder I have Problems with the prove of these exercises of my mathematics study. For (a), I tried to use long division to find the remainder of (2^a) - 1 and (2^b) - 1, but that didn't really work. Can you help me to prove it?
Let a, b be on Z(>0)
(a) Let r be the remainder of a by division with b. Prove that (2^r) - 1 is the remainder
    of (2^a) - 1 by division with (2^b) - 1
(b) Prove: (2^b) - 1 | (2^a) - 1 if and only if b|a.
 A: let's assume $a=bq+r$
  and $2^{a}-1=q'\left(2^{b}-1\right)+2^{r}-1$
 .
from the second equation we get
$$q'=\frac{2^{a}-2^{r}}{2^{b}-1}=\frac{2^{bq+r}-2^{r}}{2^{b}-1}=2^{r}\frac{2^{bq}-1}{2^{b}-1}=2^{r}\sum_{k=0}^{q-1}2^{b}\in\mathbb{Z}$$
 when the last equality is from geometric serias formula.
for the proof of (b), use (a) of course
A: Following are the proofs:


*

*From given we get $a=kb+r$ for some integer $k$, $$2^a-1=2^{(kb+r)}-1$$
which is $$2^{(kb)}.2^r-1$$
$$((2^b-1)+1)^{k}.2^r-1$$
Now all terms of the binomial expansion of $((2^b-1)+1)^{k}$ will be multiple of $2^b-1$ except for $1$. Except for this term all give modulo zero so we get
$1.2^r-1$ left which is the remainder. For binomial expansion of $(a+b)^n$ see Binomial Expansion.

*If $r=0$ ie. $b$ divides $a$ then the remainder of $2^a-1$ divided by $2^b-1$ becomes $2^r-1=0$,thus $2^b-1$ divides $2^a-1$.If the reverse is true then $2^r-1=0$ which can only happen for $r=0$,thus $b$ divides $a$.We have proven both ways so we have shown the if and only if condition.

A: Hint:
If $a=db+r$ where $0\leq r<b$ then:
$2^{a}-1=2^{r}\left(2^{b}-1\right)\left(2^{bd-b}+2^{bd-2b}+\cdots+1\right)+2^{r}-1$
