Prove that for any $m,n\in\mathbb{Z}^+$, the number $2^n-1$ is divisible by $(2^m-1)^2$ iff the number $n$ is divisible by $m(2^m-1)$.
My work so far:
It's an if and only if statement, so the common approach is to split the proof into two "if then" proofs ($A\rightarrow B \text{ and } B\rightarrow A$).
Starting with $A\rightarrow B$, for a direct proof, I would assume $A$ and prove $B$. I can use the definition of divisibility:
Assume $n=m(2^m-1)k$ for some integer $k$
Then I need to prove that $2^n-1=(2^m-1)^2h$ for some integer $h$
So I'm thinking I need to start with the expression $2^n-1$ and transform it to $(2^m-1)^2h$, or vice versa, and I need to use the assumption $n=m(2^m-1)k$ somehow.
I notice that the LS of the equality contains the variable $n$ while the RS contains $m$, and the assumption relates $n$ to $m$, so that could be a way forward. For example, simple substitution gives $2^{m(2^m-1)k}-1$, but I'm not sure what I could do from here. Perhaps there's a divisibility theorem that could help?
Other things I notice: $2^n-1$ and $(2^m-1)^2$ are always odd. Also, the divisors in both cases are multiples of $2^m-1$.
Any help/hints appreciated.