Question
How do I show that $$\underbrace{1\ldots1}_{81\text{ times}}$$ is divisible by $81$ but not by $243$?
My Attempt
Write $$\underbrace{1\ldots1}_{81\text{ times}}=\underbrace{111,111,111}_{9\text{ times}}$$ and note that $111,111,111=9 \times 12,345,679$. This also shows that $9 \mid 111,111,111$.
Now, the sum of digits of $$\underbrace{12,345,679}_{9\text{ times}}$$ is $37 \times 9$ which is clearly divisible by $9$, thereby showing that $9 \mid 12,345,679$.
This in turn shows that $$81 \mid \underbrace{111,111,111}_{9\text{ times}}$$
Next, note that $$111,111,111=243 \times 457247.37\overline{037}=243 \times \left(457247+\frac{370}{999}\right)$$
As a result, we have $$\underbrace{111,111,111}_{9\text{ times}}=243 \times \left(457247+\frac{370}{999}\right) \times \left(1+10^{9}+\cdots+10^{72}\right)$$
To show that $$243 \nmid \underbrace{111,111,111}_{9\text{ times}}$$ we need only show that $999 \nmid (1+10^9+\cdots+10^{72})$.
Indeed, as $10^3 \equiv 1 \pmod {999}$, so $10^9=(10^3)^3 \equiv 1^3 \equiv 1 \pmod {999}$ and in general $10^{9a} \equiv 1 \pmod {999}$ for $a \in \mathbb{N}$. Since $$(1+10^9+\cdots+10^{72}) \equiv \underbrace{1+\cdots+1}_{9\text{ times}} =9 \pmod {999}$$ so $999 \nmid (1+10^9+\cdots+10^{72})$ and we get the desired result.
Doubt
Is the above solution correct? If it is correct, is there a shorter and more elegant solution?
The problem is equivalent to show that $10^{81}-1$ is divisible by $3^6$ but not by $3^7$. This follows from the fact that, for $x=10$, $$\begin{align} x^{81}-1&=(x^{27}-1)(1+x^{27}+x^{54})\\ &=(x^{9}-1)(1+x^9+x^{18})(1+x^{27}+x^{54})\\ &=(x^{3}-1)(1+x^3+x^6)(1+x^9+x^{18})(1+x^{27}+x^{54})\\ &=\underbrace{(x-1)}_{=3^2}\underbrace{(1+x+x^2)}_{3k_1}\underbrace{(1+x^3+x^6)}_{3k_2}\underbrace{(1+x^9+x^{18})}_{3k_3}\underbrace{(1+x^{27}+x^{54})}_{3k_4} \end{align}$$ where $k_1,k_2,k_3,k_3$ are coprime with $3$.