# Number System Divisibility by 7

X is a number formed by writing 9 for 99 times. What will be the remainder of this number when divided by 7?

• So you're looking at $10^n -1 \mod{7}$. Maybe you can give some values for $n$ and see if you find a pattern. – Matti P. Mar 19 at 14:04
• Is there anything you have already tried? I can think of two methods which enable me to do this in my head, but just telling you what they are won't help you much in solving similar problems - trying it yourself will help. – Mark Bennet Mar 19 at 14:05
• Are you familiar with Fermat's little theorem? – J. W. Tanner Mar 19 at 14:06

$$X= 10^{99} - 1 = 10^{3 \times 33} - 1$$.
Now $$10^3 = 1000 = -1$$ modulo $$7$$.
So $$X=(-1)^{33} - 1 = - 1 - 1 = 5$$ modulo $$7$$.
• Easier: $\bmod 7\!:\,\ 10^{\large 3}\equiv 3^{\large 3}\equiv 3\cdot 2 \equiv -1\ \$ – Bill Dubuque Mar 19 at 15:08