Remainder Dividing Repunits If $n = 11111 \ldots 1$ (1 repeated 123 times.)
Then find the remainder when $n$ is divided by 271?
I know I can write this in the form of a sum of a gp but it doesn't help to find the remainder...
Any hints would be helpful.
 A: $\bf{My\; Solution::}$ When $\displaystyle 11111$ Divided by $271\;,$ We get a remainder $0$
So We Can Write it as a pair of $5,s$ one form..
So $ 111111........(\bf{123-times})= \underbrace{11111}_{\bf{5-times}}\underbrace{11111}_{\bf{5-times}}..............................\underbrace{11111}_{\bf{5-times}}\underbrace{111}_{\bf{3-times}}$ Times
So when we Divide the above no. by $271\;,$ We get Remainder $111$ 
A: Hint: Since $9$ and $271$ are relatively prime, you can note your remainder is the remainder of $(10^{124}-1)*9^{-1}$. Thus if you get the multiplicative $x$ inverse of $9$ that gives you a remainder of 1 for $9x$, then all you have to do is compute the remainder of $10^{124}$ and subtract one and then multiply by $x$. To get the remainder of $10^{124}$, you can start with $10$ and then keep squaring to get the remainder of $10^2, 10^4, 10^8$, etc., and then multiply together the remainders of powers that add up to $124$. (The base-2 representation of 124 will tell you which powers of 10's remainders to multiply together. I.e., you multiply the remainders of the powers that are $10^{2^k}$ where the $k+1$th binary digit in $124$ base-2 expansion is 1. You can keep taking remainder as an intermediate step while you are multiplying remainders of powers.)
A: First you find $\frac{1}{271} = .\overline{00369} = \frac{369}{99999} 
                              = \frac{369/9}{99999/9} 
                              = \frac{41}{11111}$
So $\frac{11111}{271} = 41$
Then do what @juantheron did.
