How to find the values of $n$ for which $\displaystyle\underbrace{111\cdots1111}_{n}\equiv0 \pmod {41}$? 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.
 A: Good guess, math110. What about a little induction on multiples of $\,5\,$? Let
$$\overbrace{11111\overbrace{111...1}^{5k\,\,1's}}^{5(k+1)\,\,1's}=10^{5k+5}+10^{5k+4}+\ldots+10^{5k+1}+\ldots+10+1=$$
$$10^{5k+4}+\ldots+10^{5k+1}+41 m\;,\;\;m\in\Bbb Z=10^{5k}\left(1+10+\ldots+10,000\right)+41m=$$
$$10^{5k}\cdot11,111+41m$$
And since $\,11,111=41\cdot 271\,$ we're done.
BTW, did you happen to notice the interesting pattern of the integers $\,\frac{1111...1}{41}\,$ ? Above is hidden the secret to them...but you don't need this.
A: You think $n=5k, k=1,2,\ldots$ so I guess you test whether the numbers $f_n=\displaystyle\underbrace{111\cdots1111}_{n}$ are divisible by $41$ for $n=1,2,3,4,{\color{red}5},6,7,8,9,{\color{red}{10}},11\ldots$ I suggest to find the remainders of $f_n$ over $41$ for these values of $n$ to see the pattern. Then try to prove it. 
Hint:
$f_{n+k}=10^kf_n+f_k.$
A: 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.
A: $n = 5k$
$11111$ = $41$ x $271$
$1111111111$ = $41$ x $27100271$
$111111111111111$ = $41$ x $2710027100271$
The remainders follow a series of $1,11,29,4,0$ and this cycle continues. Hence $n=5k$.
A: If you know that how to convert a recurring decimal to a fraction, this is easy. That is, $$0.\dot{a_1}\cdots\dot{a_n}=0.a_1a_2\cdots a_na_1a_2\cdots a_n\cdots=\frac{a_1a_2\cdots a_n}{10^n-1}.$$
Hence, we consider that $\frac{1}{41}=\frac{*}{9\cdots9}$, and so we just need to calculate $$\frac{9}{41}=0.\dot{2}195\dot{1}.$$This implies $n=5k$.
More explanation: Basically, you want to find $k$ such that $41k=1\cdots1$, or $41k=9\cdots9$. In other words, we have $$\frac{k}{9\cdots9}=\frac{1}{41},$$ which is a recurring decimal. On the other hand, we know that if you put some number as a numerator and put $9\cdots9$ as the denominator, it always gives you a recurring decimal. For example, $$\frac{5}{9}=0.555\cdots,\frac{5}{999}=0.005005\cdots,\frac{45}{999}=0.045045\cdots$$Thus, in order to find your $n$, one just needs to find the recurring period, and $n$ will be always a multiple of the period. For if $n$ is not a multiple of the period, you will end up getting a different recurring period, which is not possible.
