TITLE: How to find the values of $n$ for which $\displaystyle\underbrace{111\cdots1111}_{n}\equiv0 \pmod {41}$?
QUESTION [5 upvotes]: What are the values of $n$ satisfying $\displaystyle\underbrace{111\cdots1111}_{n}\equiv0 \pmod {41}$?
I think $n=5k$, with $k=1,2,\cdots$, but I can't prove it.

REPLY [2 votes]: By little Fermat, $\rm\ mod\ 41\!:\, 1 \equiv 2^{40}\!\equiv \color{#C00}2^{\,\color{#C00}8\cdot 5}\!\equiv \color{#0A0}{10}^5\!,\ $ by $\rm\:\color{#C00}{2^8}\!= 256 = \color{#0A0}{10} + 6\cdot 41,\:$ so $\rm\,10\,$ has order $\rm\,\color{blue}5.$ 
Therefore $\rm\,\ 41\mid (10^n\!-\!1)/9\iff 41\mid 10^n\!-\!1 \iff \color{blue}5\mid n$
Remark $\ $ Replying to a comment, I explain the genesis of this short proof. Let $\rm\:c\:$ be an element of a group $\rm\,G\,$ of order $\rm\:|G| = km,\:$ and suppose we wish to compute the order $\rm\:n\:$ of $\rm\:c.\:$ Recall, by Lagrange, $\rm\:x^{km} = 1\:$ for all $\rm\:x,\:$ so $\rm\:n\mid km.\:$ If $\rm\:c\:$ is a $\rm\,k'th\:$ power $\rm\:c = b^k\:$ then, by Lagrange, $\rm\:c^m = b^{km} = 1,\:$ so $\rm\:n\mid m.\:$ Thus our order search simplifies to searching divisors of the smaller number $\rm\ m\mid km.\ $ In particular, when $\rm\:m\:$ is prime (as above, where $\rm\,m=5),\:$ there are only two possibilities for the order, $\rm\:m\:$ or $\,1.\:$  
In the OP we are in the multiplicative group of nonzero integers mod $\,41,\,$ of order $\rm\,km = 8\cdot 5\:$ and we seek the order of $\rm\:c = 10.\:$ Motivated by the above observation, we try some small numbers to see if $\,10\,$ is an $8$'th or $5$'th power. We strike gold quickly since the first small number we try, $\rm\,b= 2,\:$ does the trick: $\,2^8\!\equiv 10.\:$ This yields the above concise proof that $\,10\,$ has order $\,5.$
Such luck is not that rare for small numbers (cf. R.K. Guy's law of small numbers), so it is often worth looking for such optimizations when working small problems by hand. Moreover, exercises and contest problems are often designed to make the calculations simple (so that they do not distract attention attention away from the essence of the matter being taught), which further increases the probability that such optimizations may exist.