If you consider any multiple of 3 and then sum up its digits, the sum is always divisible by 3. For eg. 843 is a multiple of 3 and 8 + 4 + 3 = 15 is also multiple of 3. Similarly, for 9, any multiple of 9 satisfies the property that the sum of its digits is also divisible by 9.

But he suddenly realized that this property for 3 or 9 in base 10 may not hold for another base (let say 11)

Inquisitive, that he is, he wants to know the number of digits for which this property holds for a particular base non trivially.

For 0 and 1, this property holds trivially and thus can be ignored.

A base is the number of unique digits, including zero, that is used to represent numbers .

i am unable to get it... please give some hints.

One way is, to start with a couple of loops to run through multiplication tables, say 2 to 16, 2 to 5 times. For each answer convert it to a different base as a string then add the values of each digit together, and compare the result to the multiplier.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.