Let’s continue on our endeavor to understand divisibility and remainders in this post. Last week’s post focused on situations where the remainders were equal. Today, let’s see how to deal with situations where the remainders are different.

Question: When positive integer n is divided by 3, the remainder is 2. When n is divided by 7, the remainder is 5. How many values less than 100 can n take?

(A) 0

(B) 2

(C) 3

(D) 4

(E) 5

So n is a number 2 greater than a multiple of 3 (or we can say, it is 1 less than the next multiple of 3). It is also 5 greater than a multiple of 7 (or we can say it is 2 less than the next multiple of 7)

n = 3a + 2 = 3x – 1

n = 7b + 5 = 7y – 2

No common remainder! When we have a common remainder,the smallest value of n would be the common remainder. Say, if n were of the forms: (3a + 1) and (7b + 1), the smallest number of both these forms is 1. When 1 is divided by 3, the quotient is 0 and the remainder is 1. When 1 is divided by 7, the quotient is 0 and the remainder is 1. But that is not the case here. So then, what do we do now? Let’s try and work with some trial and error now. n belongs to both the lists given below:

Numbers of the form (3a+2): 2, 5, 8, 11, 14, 17, 20, 23, 26, 29, 32, 35, 38, 41, 44, 47, 50…

Numbers of the form (7b + 5): 5, 12, 19, 26, 33, 40, 47, 54, 61, 68, 75…

Which numbers are common to both the lists? 5, 26, 47 and there should be more. Do you see some link between these numbers? Let me show you some connections:

– 26 is 21 more than 5.

– 47 is 21 more than 26.

– 21 is the LCM of 3 and 7.

How do we explain these? Say, we identified that the smallest positive number which gives a remainder of 2 when divided by 3 and a remainder of 5 when divided by 7 is 5 (note here that when we divide 5 by 7, the quotient is 0 and the remainder is 5). What will be the next such number? Since the next number will also belong to both the lists above so it will be 3/6/9/12/15/18/21… away from 5 and it will also be 7/14/21/28/35/42… away from 5 i.e. it will be a multiple of 3 and a multiple of 7 away from 5. The smallest such multiple is obviously the LCM (lowest common multiple) of 3 and 7 i.e. 21. Hence the next such number will be 21 away from 5. We get 26. Use the same logic to get the next such number. It will be another 21 away from 26 so we get 47. By the same logic, the next few such numbers will be 68, 89, 110 etc. How many such numbers will be less than 100? 5, 26, 47, 68, 89 i.e. 5 such numbers.

So, does this mean that when the remainders are not equal, you will need to make the lists given above. Well yes, in a way, but you can do it mentally. Let me explain. In the first 100 numbers, there will be many more numbers of the form (3a+2) than (7b + 5). Since n should be of both the forms, let’s start checking in the smaller list first.

Say b = 0, the number is 5. Is 5 of the form (3a + 2). Yes! Your list has served its purpose. Now all we need to do is keep adding 21 (the LCM of 3 and 7) to get the next few numbers! This turned out to be an easy example. Let’s change the values a little to make it a little more cumbersome.

Question: When positive integer n is divided by 13, the remainder is 2. When n is divided by 8, the remainder is 5. How many such values are less than 180?

(A) 0

(B) 1

(C) 2

(D) 3

(E) 4

The LCM of 8 and 13 is 104. Hence there cannot be more than 2 such values less than 180. Options (D) and (E) are out of the window for sure.

The number n should be of the following two forms:

n = 8a + 5

n = 13b + 2

In a given bunch of numbers, there will be many more numbers of the form (8a + 5) and fewer of the form (13b + 2) so let’s start with a number of the form (13b + 2).

If b = 0, n = 2. Is it of the form (8a + 5)? No. n/8 gives a remainder of 2, not 5.

If b = 1, n = 15. Is it of the form (8a + 5)? No. n/8 gives a remainder of 7, not 5.

If b = 2, n = 28. Is it of the form (8a + 5)? No. n/8 gives a remainder of 4, not 5.

If b = 3, n = 41. Is it of the form (8a + 5)? No. n/8 gives a remainder of 1, not 5.

If b = 4, n = 54. Is it of the form (8a + 5)? No. n/8 gives a remainder of 6, not 5.

If b = 5, n = 67. Is it of the form (8a + 5)? No. n/8 gives a remainder of 3, not 5.

If b = 6, n = 80. Is it of the form (8a + 5)? No. n/8 gives a remainder of 0, not 5.

If b = 7, n = 93. Is it of the form (8a + 5)? Yes! n/8 gives a remainder of 5.

The smallest value of n is 93. The next value of n = 93 + 104 = 197 i.e. greater than 180. Hence there is just one value of n less than 180. Let me continue the steps above just for kicks…

If b = 8, n = 106. Is it of the form (8a + 5)? No. n/8 gives a remainder of 2, not 5.

If b = 9, n = 119. Is it of the form (8a + 5)? No. n/8 gives a remainder of 7, not 5.

Do you see that we have started getting the same remainders again in the same order: 2, 7…? 106 is 104 more than 2. 119 is 104 more than 15. Also notice that we got all possible remainders for 8 (0, 1, 2, 3, 4, 5, 6, 7) while n was less than 104, the LCM of 8 and 13. Can you reason it out? I will leave you here with your thoughts…

*Karishma, a Computer Engineer with a keen interest in alternative Mathematical approaches, has mentored students in the continents of Asia, Europe and North America. She teaches the GMAT for Veritas Prep in Detroit, and regularly participates in content development projects such as this blog!*

really excellent post!!! gj

Hi Karishma,

For the second question, I found the value of n in the following equation.

n = 8a + 5

for a=11, i found the first value of n, whereas you have found the same at b=7 .

Is it advisable to use the equation in which the divisor is greater?

We want n to be of the form (8a + 5) as well as (13b + 2) . The numbers of the form (13b + 2) will move more quickly since 13 is larger than 8. So you will need to check fewer numbers to arrive at the first value of n. It is advisable to use the expression in which the divisor is greater.

Thanks Karishma!

Great post Karishma…..Thanks for making these problems more easy and quickly “tackle-able”

I modified your version slightly…and it works out a bit easier (at least for me)

Since n is the same,

8a + 5 = 13b + 2

=> 8a = 13b – 3

Now, all we need to check is 13b-3 is a multiple of 8 or not.

And once we get the first value, no need to multiply. Just add 13 to the previous result (multiplication and subtraction for the first value only)

For eg,

b = 0 => RHS = -3 | Not divisible by 8

b = 1 => RHS = 10 (-3+10) | Not divisible by 8

b = 2 => RHS = 23 (10+13) | Not divisible by 8

and so on …..

Certainly! You can simplify the two equations. What you then deal with is ‘integral solutions to an equation with two variables’ case discussed here: http://www.veritasprep.com/blog/2011/06/quarter-wit-quarter-wisdom-beyond-the-rule-of-thumb/#comment-3828

Note that all these workings are only for demonstration purpose. Once you are comfortable with the logic you can do it without pen and paper. Use whatever method is more intuitive to you.

Oh btw….great tip of using a greater divisor between the two!

That brings the number of calculations down significantly….

Hi Karishma,

Thanks for the post. I just want to ask, whether we can form a general formula of a number which satisfies 2 equations: divided by “a”, remainder b (x=a.n + b) and divided by “c”, remainder d (x=c.m + d).

Or in another way, without plugging in number, how to solve the problem: find remainder when x divided by 32 if x = 8n + 3 = 6m + 4?

I find 1 solution but it can only apply for a-b=1 (for eg: x=a.n +b = (a+1)m +d)

Then we have:

(a+1)x = a(a+1)n +ab

ax = a(a+1)m + (a+1)d

Minus 2 equation => x = a(a+1) (n-m) + ab – (a+1)d => remainder when x divided by a(a+1) is ab-(a+1)d.

For the first solution, you will need to do some hit and trial as suggested in the post.