0

How can I find the sum of numbers divisible by 3 that are between 1 and 1000 if I don't know how many elements there are in the arithmetic progression?

juliano.net
  • 321
  • 3
  • 14

2 Answers2

1

For guidance, I'll work a general problem:

How can I find the sum of numbers divisible by 17 between 432 and 6789?

I need to find the first element, the last element and the number of elements.

The first element $a_S =17 \left\lceil \frac{432}{17} \right\rceil = 17\times 26 = 442$

The last element $a_E = 17 \left\lfloor \frac{6789}{17} \right\rfloor = 17\times 399 = 6783$

Number of elements $N= 399-26+1 = 374$

Sum: $$S=\frac{N(a_S+a_E)}{2}=\frac{374(442+6783)}{2} = 13521075$$


Note: $\lceil x\rceil$ means round $x$ up to the nearest integer, and $\lfloor x\rfloor$ means round down.

Joffan
  • 39,627
0

Well you can easily find the number of elements. Consider that three is the common difference, and the starting number is 3 (first number divisible by three in the given range). Find the maximum value of $n$ for which we are still within the range. Then you can apply the formula for finding the sum of an arithmetic progression with $n$ terms, first term 3 and common difference as 3.

Gummy bears
  • 3,408
  • 2
    Or you could sum 1 to 333 and multiply by 3. – Kimball Jan 22 '15 at 16:41
  • @Kimball Either way of course. But I believe to actually earn the basics of sequences and progression, it's important to learn the actual method too. Then you can apply shortcuts. :) – Gummy bears Jan 22 '15 at 16:44