If $n^a+mn^b+1$ divides $n^{a+b}-1$, prove $m=1$ and $b=2a$ Let $n,m,a,b $ be positive integers such that: $n\geq 2$,    $a\leq b $ and $n^a+mn^b+1$ divides $n^{a+b}-1$. Prove    that $m=1$ and $b=2a $.
We could factor the divisor to proceed by $n^{a+b}-1=(n-1)(1+n+n^2+...+n^{a+b-1})$ but I cannot see another way we could take this on from here.

Suppose $k(n^a + mn^b + 1) = n^{a+b} - 1$.  Since $k$ is the ratio of two positive integers (using $n\ge 2$), it is certainly positive, and also clearly $k < n^{a+b}/(mn^b) = n^a/m$.  In particular $0 < k < n^a$.
On the other hand, looking at this equation modulo $n^a$ (using the fact that $a \le b$ and hence $n^a \mid n^b$) we see that $k \equiv -1 \pmod{n^a}$.  Combining this with the known range of $k$, this uniquely identifies $k = n^a-1$.  It also forces $m=1$ since otherwise $n^a/m$ would be too small.
We therefore have $(n^a - 1)(n^a + n^b + 1) = n^{a+b} - 1$ which easily simplifies to $n^{2a} = n^b$, hence $b = 2a$ (since $n > 1$).
