Preliminaries
Consider a number in the form:
$$x = a^n b - c,$$
where $a, b, c$ and $n$ are natural numbers. For which $n$ we can say that $x$ is divisible by $d$ with $a$ and $d$ coprime?
WLOG, consider the following example with $a=2$, $c=1$ and $d = 3$.
\begin{array}{llll} 2^{n}b - 1 \equiv 0 &(\text{mod}~ 3) & (1)\\ 2^{n}b - 1 + 3 \equiv 0 &(\text{mod}~ 3) & (\text{we add a multiple of $d=3$)}\\ 2^{n}b + 2 \equiv 0 &(\text{mod}~ 3) & (\text{we divide by a number (2) non divisible by $d=3$)}\\ 2^{n-1}b + 1 \equiv 0 &(\text{mod}~ 3) & (2) \\ 2^{n-1}b + 1 - 3\equiv 0 &(\text{mod}~ 3) & (\text{we subtract a multiple of $d=3$)}\\ 2^{n-1}b - 2\equiv 0 &(\text{mod}~ 3) & (\text{we divide by a number (2) non divisible by $d=3$)}\\ 2^{n-2}b - 1\equiv 0 &(\text{mod}~ 3) & (3). \end{array}
Reiterating this schema until I get $2^{n-n} = 2^0 = 1$, I conclude that
- If $n$ is even (see equation (1) and (3)), then I need to prove
$$b - 1\equiv 0 ~(\text{mod}~ 3). $$
- If $n$ is odd (see equation (2)), then I need to prove
$$b + 1\equiv 0 ~(\text{mod}~ 3). $$
Now, depending on $b$, I can find the answer to the initial question.
My question
I am wondering if the presented procedure has a name, or I can arrive to the conclusion by simply applying some known results that I'm missing.
Since $2+1=3$, it follows that $2+1\equiv0\pmod3$; i.e., $2\equiv-1\pmod3$.
Therefore $2^n\equiv(-1)^n\pmod3$.
$(-1)^n$ is $1$ when $n$ is even and $-1$ when $n$ is odd.
Therefore $2^n\equiv1\pmod3$ when $n$ is even and $2^n\equiv-1\pmod3$ when $n$ is odd.
So if $2^nb-1\equiv0\pmod3$ then $b-1\equiv0$ when $n$ is even and $-b-1\equiv0$ when $n$ is odd;
i.e., $b\equiv1$ when $n$ is even and $b\equiv-1\equiv2\pmod3$ when $n$ is odd.