# A “fast” way for finding sum of the numbers from $1$ to $100$,which are not divisible by $3$ and $5$

Find sum of numbers from $1$ to $100$ which are not divisible by $3$ and $5$?

I can understand that the here we require to sum up these numbers:

$1+2+4+7+8+11+13+14+16+17+19+22+23+26+28+29+31+32+34$ $+37+38+41+43+44+46+47+49+52+53 +56+58+59+61+62+64+67+68+71$ $+73+74+76+77+79+82+83+86+88+89+91+92+94+97+98$

Which gives the sum $= 2632$,but I any didn't relation among the numbers in this series,any ideas? Also,I am supposed to do this under a mint so please hint/answer accordingly.

-
In my opinion, there would be a problem if a test question was worded exactly like the above, for there is ambiguity. The phrase "not divisible by $3$ and $5$" could be interpreted by a student as meaning not divisible by both of $3$ and $5$, that is, everybody but the multiples of $15$. The wording "divisible neither by $3$ nor by $5$" is, by contrast, unambiguous. –  André Nicolas Jul 20 '11 at 22:23
Yes,initially I was only taking out the multiples of $15$ from $5050$. –  VelvetThunder Jul 22 '11 at 18:27
That was a sensible interpretation of the substandard wording used in the problem. –  André Nicolas Jul 22 '11 at 19:28
but certainly giving me an answer that is not in any of the options and which tends me to check my calculations again and hence waste of precious seconds!:/ –  VelvetThunder Jul 22 '11 at 19:32

This is a combinatorial argument called Inclusion-exclusion principle: $$X=1+\ldots+100 - 3(1+\ldots+33) - 5(1+\ldots+20) + 15(1+\ldots+6)$$

First we add all the numbers, then we remove all those which are divisible by $3$, and those divisible by $5$. But wait a minute! What about $15$? We removed that number twice! We therefore need to add it once, as well the rest of its multiples below $100$.

Now using the summation formula: $1+\ldots+n = \frac{n(n+1)}{2}$ the answer follows.

-
+1,nice explanation. –  VelvetThunder Jul 20 '11 at 22:02

The sum of the numbers which are divisible by $3$ in this range is $$3+6+\cdots+99=3(1+2+\cdots+33)$$ and likewise the sum of those divisible by $5$ is $$5+10+\cdots+100=5(1+2+\cdots+20).$$ You should be aware of a quick formula to add these two sums. Be careful to add back all the numbers that are divisible by $15$, as they have been subtracted twice. Thanks to Gauss, we know that the sum of the first $100$ integers is $5050$, and after doing the arithmetic you get your answer.

-

Hint: First try finding the sum of numbers which are divisible by $3$ or $5$

-
Sub-hint: find the sum of numbers which are divisible by 3, then the sum of those divisible by 5, and finally the sum of those divisible by 15. –  Did Jul 20 '11 at 21:49
Okay,for that I have to sum up two G.P series for $3$ and $5$ respectively,then subtract the $15$ series and then subtract this whole result from $5050$? Do you mean this? –  VelvetThunder Jul 20 '11 at 21:51
@Debanjan: They are not GP. They are AP. –  Aryabhata Jul 20 '11 at 21:54
Yeps,A.P indeed. –  VelvetThunder Jul 20 '11 at 22:01
Accepting this one as hint is enough for me in this case. –  VelvetThunder Jul 20 '11 at 22:02

There's something called inclusion-exclusion you wanna use : sum all integers up to 100, remove those divisible by 3, remove those divisible by 5, then add those divisible by 15. =)

-