Sum of all three digit number which are not divisible by 7 = sum of all three digit numbers - sum of all three digit numbers divisible by 7
Sum of all three digit numbers,
100 + 101 + 102..... + 999
an = a + (n - 1)d
999 = 100 + (n - 1) x 1
999 - 100 = n - 1
899 + 1 = n
900 = n
Sum of all three digit numbers (S1)
so we know that,
S1 = n/2 (a + l)
S1 = 900/2 (100 + 999)
S1 = 450 x 1099
S1 = 494550
Now, sum of all three digit numbers divisible by 7 (S2)
105 + 112...... + 994
an = a + (n - 1)d
994 = 105 + (n - 1) x 7
994 - 105 = (n - 1) x 7
889/7 = n - 1
127 + 1 = n
128 = n
Now,
S2 = n/2 (a + l)
S2 = 128/2 (105 + 994)
S2 = 64(1099)
S2 = 70336
Now, sum of all three digit numbers not divisible by 7 = sum of all three digit numbers - sum of all three digit numbers divisible by 7
= 494550 - 70336
= 424214
Therefore, sum of all three digit numbers not divisible by 7 is 424214.