The question is:
Prove that:
For $n>1, R_n^k-1$ is divisible by $4$ if $k$ is even. If $k$ is odd, then $R_n^k+1$ is divisible by $4$ where $R_n$ is the rep-unit of length $n$ i.e. $R_3 = 111 , R_5 = 11111, \cdots$.
My Try:
- First we try to find $a$ such that $R_n\equiv a \pmod 4$.
Notice that we can express these integers as $R_n = \frac{10^n-1}{9}$. Now: $$\frac{10^n-1}{9} \equiv a \pmod 4$$ $$10^n-1 \equiv 9a \pmod 4 \to 10^n-1 \equiv a \pmod 4$$ But $10^n$ is divisible by $4$ for any $n>1$. Hence: $$0-1 \equiv a \pmod 4$$ Implying:
$$a \equiv -1 \pmod 4$$
- The second step is trivial. If $k$ is odd, then $(-1)^k +1 = -1 + 1 = 0 \pmod 4$, else if $k$ is even, then $(-1)^k -1 = 1-1 = 0 \pmod 4$
Any ideas or notes on the prove?
Is there simpler way to prove so?