Artificial intelligent assistant

How can I prove that $a^m-1|a^n-1 \Leftrightarrow m|n$? Suppose that $(a,m,n)\in \mathbb{N}^{3}$, as $a>1$ How can I prove that $a^m-1|a^n-1 \Leftrightarrow m|n$? I proved that $m|n \implies a^m-1|a^n-1$, but I couldn't prove the reciproque.

Suppose $a^m-1\mid a^n-1$. I claim $m\mid n$. Write $n=qm+r$ for $0\leq ra^r-1$ since $m>r$ and $a>1$, so necessarily $a^r-1=0$, or $r=0$. Thus $m\mid n$.

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 000c8a1f378a780a5fa5e267ecd1d8e4