[Math] remainder when 67896789…(300 digits) divided by 999

modular arithmeticnumber theory

What is the remainder when 678967896789… (300 digits)is divided by 999?
i tried to divide it manually to find some pattern in remainder. But was getting bit lengthy.
so please suggest me some short method.

Best Answer

Similar to casting out nines to find the remainder when divided by 9, you can cast out 999's to find the remainder when divided by 999. The reason this works is the same: 1000 = 1 modulo 999, so xyz000...000 = xyz modulo 999. But instead of just adding up the digits, you have to add three-digit groups.

Take for instance the number 12345678. Break this into three-digit groups (starting from the right):

12 345 678

Take the sum:

12 + 345 + 678 = 1035

Reduce modulo 999, using the same trick:

1035 = 1 + 035 = 36 mod 999

So 12345678 = 36 mod 999.

In your case, we have

678 967 896 789

repeated 25 times:

25 * (678 + 967 + 896 + 789) = 25 * 3330 = 83250

So 67896789...6789 = 83250 = 83 + 250 = 333 modulo 999.