Home
SELF STUDY
BrowsePracticeTestsPlaylistDoubts & solutionsFree live classesOther courses

Modular Arithmetic

Quick practice

Question 1 of 5

Consider the following divisibility test for 3,

Take a number n,

Until n is less than 10, replace n by the sum of digits of n

If the remaining number is divisible by 3, then the original n is divisible by 3, otherwise it is not.


For example for n = 555555, in the first turn, replace n by 30, in the second turn replace n by 3. Since 3 is divisible by 3, 555555 is also divisible by 3.

The procedure also works for the number 9 (For example 555555 is not divisible by 9 because the remaining number is 3 which is not divisible by 9).

Suppose we repeat the same procedure, but by considering the digits in Hexadecimal (base 16) instead of base 10.


For example 555555 in base 16 is 87A23, whose sum of digits is 8 + 7 + 10 + 2 + 3 = 1E(30), whose sum of digits is F(15). We can conclude that 87A23 is divisible by 3. You can verify that the same works for other numbers as well.

Other than 3, for what other numbers can we test for divisibility using the same procedure (in base 16)?

A

15

B

6

C

Both B and C

D

9

E

5

Get unlimited practice with Competitive Programming subscription

pick

Boost your performance with adaptive practice tests

pick

Practice every concept in the syllabus

pick

Compare your speed and accuracy with your peers

pick

Download the app and practice on the go