When Multiples And Digit Sums Collide

How many positive integers n n from 1 to 1000 (inclusive) are there, such that n n is a multiple of 3, and the digit sum of n n is also a multiple of 3?

Details and assumptions

The digit sum of a number is the sum of all its digits. For example, the digit sum of 1123 is 1 + 1 + 2 + 3 = 7 1 + 1 + 2 + 3 = 7 .


The answer is 333.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

22 solutions

Prasun Biswas
Dec 28, 2013

Here, it is said that the nos. are between 1 and 1000 and should be multiple of 3 and the digit sum of those nos. should also be a multiple of 3. From the divisibility rules, we know that only multiples of 3 have its digit sum as multiple of 3. So we simply have to find that how many multiples of 3 lie between 1 and 1000.

The required nos. are 3 , 6 , 9 , . . . . , 999 3,6,9, .... , 999 and they are in AP with first term ( a ) = 3 (a)=3 and last term ( l ) = 999 (l)=999 with common difference ( d ) = 3 (d)=3 .We use here the formula a n = a + ( n 1 ) d a_{n}=a+(n-1)d where n=Term no.

999 = 3 + ( n 1 ) 3 996 = ( n 1 ) 3 n 1 = 332 n = 333 999=3+(n-1)3 \implies 996=(n-1)3 \implies n-1=332 \implies n=\boxed{333}

Since, 999 is the last term, so total no. of terms = 333 =\boxed{333}

Nicely solved !!

Devesh Rai - 7 years, 5 months ago

Thanks

Saifunnahar Tonby - 7 years, 5 months ago

quiet right

amir nazir - 7 years, 4 months ago

nice use of progressions

SaiTeja Muddana - 7 years, 2 months ago

wow i never expected it to be so easy

Varun Kulkarni - 7 years, 2 months ago

Nice! I didn't know about that rule. To be honest I don't know almost anything about number theory. I'm kind of learning with you by the way

João Vitor Cordeiro de Brito - 7 years, 5 months ago
Gaurav Pathak
Dec 28, 2013

The important property of "divisibility by 3" is enough to solve this problem. The divisibility rule for 3 states that "the number is divisible by three iff the sum of the digits of the number is divisible by 3". So, if the number is divisible by 3 then the sum of it's digits is obviously divisible by 3. Hence, we need to find only the numbers which are divisible by 3 and are less than 1000. Smallest number less than 1000 and divisible by 3 is 999 This gives the total number as 999/3 = 333.

You made a mistake in your solution by saying "Smallest number less than 1000 and divisible by 3 is 999." because 999 is not the smallest but the nearest no. less than 1000 and divisible by 3.

Prasun Biswas - 7 years, 5 months ago
Raghav Dua
Jan 2, 2014

//include iostream, include string and include sstream statements go here (line-by-line)

using namespace std;

bool isValid (int number) {

string buf;

stringstream port;

int subNumber (0), mainNumber (0);

bool property (true);

port << number;

port >> buf;

port.clear ();

for (int i = 0; i < buf.length (); i++) {

port << (buf [i]);

port >> subNumber;

mainNumber += subNumber;

port.clear ();

}

if (mainNumber % 3 != 0) {

property = false;

}

return (property);

}

using namespace std;

int main () {

unsigned int counter (0);

cout << (isValid (972)) << endl << endl;

for (int i = 1; i <= 1000; i++) {

if ((i % 3 == 0) && (isValid (i) == true)) { counter++; }

}

cout << counter << endl;

return (0);

}

Nimesh Patodi
Dec 28, 2013

If a number is divisible by 3 then, it's digit sum is also divisible by 3. Hence, an A.P. of required numbers is generated: 3,6,9,12,........,999 with common difference=3. Applying nth term formula for the last term(999), gives us the number of terms which is the answer. Calculations: 999=3+(n-1)3 which gives n=333.

Anzar Aznzar
Mar 29, 2014

1000/3 = 333,33...

x = 333

the sum of every multiple of 1, 2, 3, 5 and 9 gives their multiple

Suchitra Jhamb
Feb 19, 2014

All nos. divisible by 3 , sum is also divisible by 3

Mohammad Fiyaz
Jan 24, 2014

we have to find numbers of positive integer n from 1 to 1000 such that n should be multiple of 3.

and digit sum of same positive integer n should also be a multiple of 3.

thus multiples of 3 from 1 to 1000 are 1000/3==>333 ( taking Round finger)

n=333 is also multiple of 3.

3+3+3=9 that is multiple of 3

Nick De Ruyck
Jan 22, 2014

All multiple of 3 have a digit sum that is also a multiple of 3. (Just the same as with 9.) So when you do 1000/3 = 333 rest 1. Therefor the solution is 333.

numbers which multiple 3 is also have digits which the digit sum of that number is also a multiple of 3. so there are 333 numbers.

Irfan Wahyudin
Jan 13, 2014

this problem is application of aritmetics,... if a is multiple of 3 so, a start from 3 till 999 if the sum of all digit of a is multiple of 3,..so 3= 3, 6=3+3, 9=3+3+3, and so on... so we use the formula of aritmetics,... a + (n - 1) d = 999 3 + (n-1) 3 = 999 so,... 3n = 999 n = 333

Subhashish Kundu
Jan 9, 2014

we all know the easy way to check which no. is divisible by 3 i.e, you just add the digits and if the sum is divisible by 3 then the no. is also divisible by 3. So between 1 to 1000 there are 333 numbers divisible by 3 so that many number's sum of digits will also be divisible by 3

Ria Patel
Jan 6, 2014

If you know this simple fact, it will save you lots of time when solving this problem.

To be a multiple of three, the digits have to add up to a multiple of three, which means you are just looking for all the numbers 1-1000 (inclusive) that are a multiple of three. This problem just got a whole lot simpler and easier.

The first step is to know the greatest multiple of three that is between 1 and 1000. It is 999. Since every multiple of three comes up every three numbers, you must divide 999 by 3. It is 333. Therefore, the answer is 333.

For any number to be a multiple of 3, the sum of the digits of that number should be a multiple of 3. Hence, simply put, the question is actually "How many multiples of 3 are there between 1 and 1000?" To find the multiples of 3 between 1 and 1000, we divide 1000/3 and consider only the quotient (and do not consider the remainder). Hence the answer is 333

Luqman Nadeem
Jan 4, 2014

Its very simple actually. It is known that for any no. that is divisible by 3, the sum of its digits will also be divisible by 3 therefore 3 * 333 =999 is the last no. before 1000 that is divisible by 3. Now 333-1+1 = 333 thus 333 is the final answer.

Jivesh Khurana
Jan 2, 2014

As sum of a multiple of 3 is always a multiple of 3(like 84=8+4=12) so there is no new condition and this sum falls in category of AP... so first term is 3...and last term is 999..so 3 , 6, 9, 12..........................999. nth term=first term + (no of terms -1)common difference applying it we get 999=3 + (n-1)3 solving for n we get n=333

The lowest possible value for the sum of the digits are a multiple of 3 would be the number 3 itself, so 1000 divided by 3 is 333 with a remainder of 1, ie there are 333 integer multiples of three.

Partho Kunda
Dec 30, 2013

We know that the sum of a number which is multiple of 3 is also a multiple of 3. For example 123 is a multiple of 3. The sum of it's numbers which is (1+2+3) or 6 is also a multiple of 3. And there are 333 numbers from 1 to 1000. (Dividing 1000 by 3 we will find how many numbers from 1 to 1000 are there which are divided by 3 .) So, the answer is 333...

Gulraiz Shah
Dec 30, 2013

divide 1000 by 3 which comes 333.333 so neglect the values after point and 333 will be the answer

Zechariah Jimenez
Dec 29, 2013

Since for an integer N N to be divisible by 3 (a.k.a. the divisibility rule for 3), the digit sum of N N has to be divisible by 3,all we need to do is to find the integer portion of 1000 3 = 333.33333... 333 \frac{1000}{3}=333.33333...\approx\boxed{333} .

We know that the digit sum of all multiples of 3 are divisible by 3. Clearly, the answer is 333 since there are 333 multiples of 3 between 1 to 999 inclusive

Callum Schafer
Dec 28, 2013

Firstly it is important to recognise that all multiples of three have digit sums equal to multiples of three. Then we only have to work out the number of times 3 goes into 1000 without remainder thusly giving an answer of 333

3 is the smallest multiple and 999 is the biggest multiple. So here is a list of multiples of 3 3,6,9,...,999.

There are 333 terms in this list.

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...