Quandaries and Queries
 

 

Who is asking: Student
Level: Middle

Question:
Find the sum of all positive integers not greater than 10000 that are divisible by neither 3 nor 7.

 

 

Hi,

I expect that you know how to sum an arithmetic progression. There is a description of this procedure in the answers we have given to two prrevious questions, one by David and another by Rosa.

Firt you need to find the sum of all positive integers not greater than 10000, I want to call it S. That is

S = 1 + 2 + 3 +...+ 10000

From this you need to subtract the integers in this list that are divisible by 3. I call this S3, that is

S3 = 3 + 6 + 9 +...+ 9999

You need also to subtract the sum of the integers that are divisible by 7. This I call S7

S7 = 7 + 14 + 21 +...+ 9996

Thus far you have S - S3 - S7. You are not finished because you have subtracted some integers twice. For example 21 is divisible by both 3 and 7 so it has been subtracted twice. In fact every integer that is divisible by both 3 and 7 has been subtracted twice so you need to add them back in once. These are the integers that are divisible by 21. Again I will cal the sum S21, that is

S21 = 21 + 42 + 63 +...+ 9996

Hence the sum you want is

S - S3 - S7 - S21

Penny

 

 
 

Go to Math Central