Find the sum of all positive integers less than 1000 that are divisible by 3 but not by 2
Rimas and I are friends, and you seem to have read the problem wrong like I did intially. The problem asks for the sum of the integers, not how many integers.
I already determined that the sum of all integers divisible by 3 and 2 is 82,170 if that helps any.
To solve this problem, you have to know this formula: n/2 * (a + L), where a is the first number in the series, L is the last number in the series, and n is the number of numbers in the series. It gives the sum of the series.
So... you have to sum every multiple of 3 first. As there are 333 of them, the first is 3, and the last is 999, sub that in to find the sum:
333/2 * (3 + 999) = 166833
Next, subtract all the number divisible by both 2 and 3 (that is, numbers divisible by 2*3 = numbers divisible by 6). As there are 166 of them, the first is 6 and the last is 996, sub that in to find the sum:
166/2 * (6 + 996) = 83166
Now, simply subtract 83166 from 166833:
166833 - 83166 = 83667
If you have any questions regarding the formula or anything else feel free to ask.
The numbers divisible by 3 are: .3, 6, 9, 12, 15, 18, ... , 999Find the sum of all positive integers less than 1000 that are divisible by 3 but not by 2
We see that every other number is divisible by 2, so we omit those.
And we have: .3, 9, 15, 21, ..., 999, .an arithmetic sequence
. . with first term a = 3, common difference d = 6, and n = 167 terms.
The sum of the series is: .½(167) [2(3) + 166(6)] .= .83,667