Find the sum of all positive integers less than 1000 ending in 3 or 4 or 6 or 9.
Required sum=(3+13+23+⋯+993)+(4+14+24+⋯+994)+(6+16+26+⋯+996)+(9+19+29+⋯+999)=40(1+2+⋯+99)+100(3+4+6+9)=200200
Note that
3 + 9 = 2(6)
13 + 19 = 2(16)
23 + 29 = 2(26)
etc.
And
4 + 6 = 2(5)
14 + 16 = 2(15)
24 + 26 = 2(25)
So
2 ( 6 + 16 + 26 + ....+ 986 + 996) = 2 * [ 6 + 996] (100/2) = 100200
+
2 ( 5 + 15 + 25 + ... + 985 + 995 ) = 2 * (5 + 995) (100/2) = 100000
100200 + 100000 =
200200