I keep running into the same type of failure when attempting to prove a statement using modular arithmetic, when the expression at hand is exponential.
For example:
Prove that the remainder of a power of $2$ divided by $6$ is either $2$ or $4$.
It's pretty easy for $5$ out of $6$ cases:
- $n\equiv\color\red1\pmod6\implies2^n\equiv2^\color\red1\equiv2\pmod6$
- $n\equiv\color\red2\pmod6\implies2^n\equiv2^\color\red2\equiv4\pmod6$
- $n\equiv\color\red3\pmod6\implies2^n\equiv2^\color\red3\equiv2\pmod6$
- $n\equiv\color\red4\pmod6\implies2^n\equiv2^\color\red4\equiv4\pmod6$
- $n\equiv\color\red5\pmod6\implies2^n\equiv2^\color\red5\equiv2\pmod6$
But I am unable to get it straight for $n=0$:
- $n\equiv\color\red0\pmod6\implies2^n\equiv2^\color\red0\equiv1\pmod6$
Now, I can work it out by using $n=6$ instead:
- $n\equiv\color\red6\pmod6\implies2^n\equiv2^\color\red6\equiv4\pmod6$
But it doesn't feel right to use the notation "$n\equiv6\pmod6$".
So there is definitely some sort of flaw in my method, and I would like to know what that is.
Thanks