A number has 3 digits. When it is divided by 6 or 7, it leaves a remainder of 1. When it is divided by 8 or 11, it leaves 2 remainder of 7.

What is the largest such number?

The answer given is 799

1 answer

I suggest you Google something like
"Chinese Remainder Theorem" and I assume you know about modular arithmetic since I will be using properties of modular arithmetic

so we have
z = 1 mod 6
z = 1 mod 7
z = 7 mod 8
z = 7 mod 11
But, in the Chinese Remainder Therorem we need all the modular arguments to be "relatively prime"
6 and 8 are not

BUT, 1 mod 6 = 7 mod 6
and if 7 mod 6 = 7 mod 8
then 7 mod 6 = 7 mod 24 , (LCM of 6 and 8 is 24)

so we can reduce our problem to 3 conditions:
z = 7 mod 24
z = 1 mod 7
z = 7 mod 11
BUT 7 mod 11 = 7 mod 24
so we now have

z = 7 mod 264
z = 1 mod 7

starting with the smallest 3 digit number, results of
7 mod 264 are
271 539 799 1063 ...

only 3 cases to check for mod 7
271 mod 7 = 5
539 mod 7 = 0
799 mod 7 = 1 ======> yeahhh, its 799

NOTE:
I did not actually have to use the "Chinese Remainder Theorem" since I was fortunate to have 7 mod 24 = 7 mod 11

If I had ended up with something like
5 mod 24 and 6 mod 11, it would be much more difficult and I would have to resort to the CRT