Problem: Predict the remainder when 11111...(100 ones) is divided by 1111111

351 Views Asked by At

this very same problem appeared in a different thread but the questions was slightly different. In my case, I'm looking precisely for the answer.

This is how I solved it, I only need confirmation of whether this actually is correct:

So I assumed that 1111... (100 ones) is going to be exactly divided by 1111111 (7 ones) 14 times (100/7 = 14). Hence, if 14 times 7 equals 98 '1's, then the remainder is 2 '1's.

Thanks.

4

There are 4 best solutions below

0
On

Yes, this is a perfectly sound reasoning.

You can also express it as

$$ 100000010000001\cdots1000000100\cdot 1111111 + 11 = \underbrace{111\cdots111}_{100\text{ ones}} $$

0
On

Yes, it is correct. If you envision setting up the long division, the first subtraction strips off the first seven $1$s, the next strips the next seven, and so on.

0
On

Mod $10^7-1: 10^7\equiv1\implies10^{98}\equiv1\implies10^{100}\equiv100\implies10^{100}-1\equiv99.$

I.e., $10^7-1|(10^{100}-1)-99\implies \dfrac{10^7-1}9|\dfrac{10^{100}-1}9-\color{blue}{11}$

0
On

The first seven $1$'s gives you a multiple of $1111111$, same for the next seven, etc. Since $100 = 14 \cdot 7 + 2$ after removing $14$ groups of seven $1$'s you are left with two: the remainder is $11$.