The polynomial $(a^n-b^n)$ over values of $n$ can actually be treated as a base. That is, there are characteristic divisors for each integer $m$, which divides this equation when $m=m$.
The equation $a^n-b^n$ has a distinct algebraic divisor for each $m \ n$, this algebraic divisor appears every time $m$ divides $n$.
Although you can use algebra to sort this, it is usually faster to use a sample base, like 10. This means that the values can be found by a calculator. In the following table, one calculates the unique factor in 9, 99, 999, etc, dividing by the unique factors for all of the proper divisors (eg $999999 /( 9 * 11 * 111) = 91$. The next step is to add a string of '$5$'s. This has the effect of creating 'negative digits', eg $4 \text{ ~} -1$.
Now you can read the polynomial off by subtracting 5 from each place in turn, and treating the place as $a^x b^{n-x}$, where the value had been $10^x$. You then get the desired polynomial. I used this system to generate all of these kind of numbers as far as 162 places programically.
1 9 555564 1,-1
2 11 555566 1, 1
3 111 555666 1, 1, 1
4 101 555656 1, 0, 1
6 91 555646 1, -1, 1
5 11111 566666 1,1,1,1,1
8 10001 565556 1,0,0,0,1
10 9091 565456 1,-1,1,-1,1
12 9901 565456 1,0,-1,0,1
The kind of system where $a$ and $b$ are integers, are fractional bases. You can find, for example, that $37 \mid 1,1,1$ for $a=15, b=2$, and some of the 37ths actually have 3-place periods in that base.
The same rules that governs ordinary bases (eg $p \mid b^{p-1}-1)$ also happens for fractional bases, since one can write $B = a/b$ and multiply through by a power of $b$ throughout.
Another way to prove things is to write $a^{mn}-b^{mn}$ as $(a^m)^n - (b^m)^n$, and then put $A$, $B$ for the expressions in brackets: $A^n-B^n$. This is similar to considering base $1000$ as a power of $10$. So, eg in base $1000$, we have $999 \mid 1000^n-1$, and thus $111 \mid 10^{3n}-1$.