The question is
Show that if $a$ and $b$ are both positive integers, then $(2^a − 1) \bmod (2^b − 1) = 2^{a \bmod b} − 1$. [1]
attempt. clearly this holds when when $a=b$ and $a<b$. However I find it hard to prove for when $a>b$. Let $a=qb+r$ where $q\ge 1,0\le r<b$. I also used $2$ properties, first one is that $(2^b-1)$ divides $2^{(n+1)b}-2^{nb}$ because $$ 2^{(n+1)b}-2^{nb}=2^{nb}(2^b-1) $$ and the second property is that we can break $2^a-1$ into $$ 2^a-1 = \sum_{i=0}^{a-1} 2^i = s_0+s_1+...+s_{q} $$ where $$ s_n=\sum_{i=nb}^{(n+1)b-1} 2^i = 2^{(n+1)b}-2^{nb},\quad n=0,...,q-1 $$ and $$ s_{q} = \sum_{i=qb}^{qb+r-1} 2^i = 2^{qb+r}-2^{qb} = 2^{qb}(2^r-1) $$ now by first property we know $2^b-1$ divides $s_0+...+s_{q-1}$, the remainder seems to be $s_{q} = 2^{qb}(2^r-1) = 2^{qb}(2^{a \bmod b} − 1)$ which is not exactly $2^{a \bmod b} − 1$ but a multiple of it ... so I failed to prove it
[1] Discrete Mathematics and Its Applications, Kenneth H. Rosen