Sum of Divisible Integers

What is the sum of all integers N N , that are divisible by 3 or 5 and satisfy 1 N 61 1 \leq N \leq 61 ?


The answer is 870.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

19 solutions

Ajay Maity
Dec 23, 2013

First find the sum of all numbers which are divisible by 3, and are less than 61. i.e. there are 61 3 = 20 \left \lfloor \frac{61}{3} \right \rfloor = 20 numbers divisible by 3 and are less than 61.

So, their sum

S 1 = 3 + 6 + 9 + . . . . . . + ( 20 S_1 = 3 + 6 + 9 + ...... + (20 terms ) = 3 ( 1 + 2 + 3 + 4 + . . . . + 20 ) = 3 × 20 × 21 2 = 630 ) = 3(1 + 2 + 3 + 4 + .... + 20) = 3 \times \frac{20 \times 21}{2} = 630

Now, the sum of all numbers which are divisible by 5, and are less than 61. i.e. there are 61 5 = 12 \left \lfloor \frac{61}{5} \right \rfloor = 12 numbers divisible by 5 and are less than 61.

So, their sum

S 2 = 5 + 10 + 15 + . . . . . . + ( 12 S_2 = 5 + 10 + 15 + ...... + (12 terms ) = 5 ( 1 + 2 + 3 + 4 + . . . . + 12 ) = 5 × 12 × 13 2 = 390 ) = 5(1 + 2 + 3 + 4 + .... + 12) = 5 \times \frac{12 \times 13}{2} = 390

But, there are some numbers which are divisible by both 3 3 and 5 5 and have been included twice. So, we have to subtract them once. The common multiples can be obtained by taking L C M ( 3 , 5 ) = 15 LCM(3, 5) = 15 . Hence, there are 61 15 = 4 \left \lfloor \frac{61}{15} \right \rfloor = 4 numbers which are divisible by both 3 and 5 and are less than 61.

Their sum

S 3 = 15 + 30 + . . . . . . + ( 4 S_3 = 15 + 30 + ...... + (4 terms ) = 15 ( 1 + 2 + 3 + 4 ) = 150 ) = 15(1 + 2 + 3 + 4) = 150

So, the final answer is

S = S 1 + S 2 S 3 = 630 + 390 150 = 870 S = S_1 + S_2 - S_3 = 630 + 390 - 150 = \boxed{870}

That's the answer!

very nice solution !

Devesh Rai - 7 years, 5 months ago

Good!

Soham Dibyachintan - 7 years, 5 months ago

nice

Benjamin Fonua - 7 years, 4 months ago

I really thought this solution but... I had a pen mistake :( SO SAD.

Leslie Brenes - 7 years, 4 months ago

Best solution...

Heder Oliveira Dias - 7 years, 3 months ago
Pranav Arora
Nov 18, 2013

The numbers divisible by 3 in the given range are 3 , 6 , 9......60 3,6,9......60 . The sum of these numbers is

3 + 6 + 9 + . . . . . + 60 = 3 ( 1 + 2 + 3 + . . . . + 20 ) = 3 × 20 × 21 2 = 630 \displaystyle 3+6+9+.....+60=3(1+2+3+....+20)=3\times \frac{20\times 21}{2}=630

The numbers divisible by 5 in the given range are 5 , 10 , 15....60 5,10,15....60 . The sum of these numbers is

5 + 10 + 15 + . . . . . . . + 60 = 5 ( 1 + 2 + . . . . . . + 12 ) = 5 × 12 × 13 2 = 390 \displaystyle 5+10+15+.......+60=5(1+2+......+12)=5\times \frac{12\times 13}{2}=390

The sum of integers either divisible by 3 or 5 is not simply 390+630. If we do this, we double-count those numbers divisible by both 3 and 5. In other word, we need to subtract those numbers which are divisible by 15. The numbers divisible by 15 are 15 , 30 , 45 15,30,45 and 60 60 . The sum of these numbers is

15 + 30 + 45 + 60 = 150 \displaystyle 15+30+45+60=150

Hence, our final answer is 630 + 390 150 = 870 630+390-150=\fbox{870} .

One more thing to note that 630+390>999 so that should probably give you a hint. :P

Pranav Arora - 7 years, 6 months ago

This seems like it has better explanation than Ayon Pal's one. That's just in my opinion. :)

Adam Zaim - 7 years, 6 months ago

Log in to reply

Thanks Adam! :)

Pranav Arora - 7 years, 6 months ago

There are 20 multiples of 3 in the given interval, so to find that sum we simply add the positive integers from 1 to 20 and multiply the result by 3; this yields N 3 = 630 N_3=630 .

There are 12 multiples of 5 in the given range, so we can find the sum in a similar manner: N 5 = 390 N_5=390 .

From these we can conclude that N 3 + N 5 = 1020 N_3+N_5=1020 . However, we counted multiples of 15 in both N 3 N_3 and N 5 N_5 ; hence we will subtract the multiples of 15 ( N 15 = 150 N_{15}=150 )from our previously obtained sum.

Therefore, the required sum is N = N 3 + N 5 N 15 = 870 N=N_3+N_5-N_{15}=870 .

Ayon Pal
Nov 18, 2013

The number divisible by 3 3 for value N N are 3 , 6 , 9 , 12....60 3, 6, 9, 12 .... 60 which is an A.P. series.

Then the 1st number of the series a 1 = 3 a_1 = 3 ; the common difference d 1 = 3 d_1 = 3 ; the total number of the sequence n 1 = 60 3 = 20 n_1 =\frac{60}{3} = 20 [60 is the last number, because 61 can not divisible by 3]

So, the sum of all sequence if the A.P. s 1 = n 1 2 [ 2 a 1 + d 1 ( n 1 1 ) ] 20 2 [ 2 × 3 + 3 ( 20 1 ) ] 10 × ( 6 + 57 ) 630 s_1 = \frac{n_1}{2} [2a_1 + d_1(n_1-1)] \implies \frac{20}{2} [2 \times 3 + 3(20-1)] \implies10 \times (6 + 57) \implies 630

Using the same method : The number divisible by 5 5 for value N N are 5 , 10 , 15 , 20....60 5, 10, 15, 20 .... 60 which is also an A.P. series.

Then the 1st number of the series a 2 = 5 a_2 = 5 ; the common difference d 2 = 5 d_2 = 5 ; the total number of the sequence n 2 = 60 5 = 12 n_2 =\frac{60}{5} = 12 [60 is the last number, because 61 is not divisible by 5]

So, the sum of all sequence if the A.P. s 2 = n 2 2 [ 2 a 2 + d 2 ( n 2 1 ) ] 12 2 [ 2 × 5 + 5 ( 12 1 ) ] 6 × ( 10 + 55 ) 390 s_2 = \frac{n_2}{2} [2a_2 + d_2(n_2 -1)] \implies \frac{12}{2} [2 \times 5 + 5(12-1)] \implies 6 \times (10 + 55) \implies 390

And the number we counted twice in these two sequence are value of N N from 1 t o 61 1 to 61 which are multiple of 3 × 5 o r 15 3 \times 5 or 15 . And there is 4 multiples of 15 between 1 and 61 and there sum is 15 + 30 + 45 + 60 = 150 15 + 30 + 45 + 60 = 150

We get the sum of all integers value of N = 630 + 390 150 870 N = 630 + 390 - 150 \implies \boxed{870}

Sameer L.
Dec 23, 2013

We need to find the sum of the sequences: 3 , 6 , 9 , 12 , 15 , 18 , 21 57 , 60 3, 6, 9 , 12, 15, 18, 21\ldots 57,60 and 5 , 10 , 15 , 20 55 , 60 5, 10, 15, 20 \ldots 55, 60 and subtract out the common terms. The sum of the first sequence is just ( 60 + 3 ) 20 2 = 630 \dfrac{(60+3)20}{2} = 630 , and the sum of the second is ( 5 + 60 ) 12 2 = 390 \dfrac{(5+60)12}{2} = 390 . Summing this gives 1020 1020 . Now, the common terms are multiples of 15, namely 15,30,45, and 60 within the given range. Subtracting this from 1020 gives the answer 870 \boxed{870} , done.

Lorenc Bushi
Dec 23, 2013

The sum of numbers who are divisible by 3 3 in the given limits is: 3 + 6 + 9 + 12 + . . . . . . . + 60 3+6+9+12+.......+60 which is an arithmetic progression with a 1 = 3 a_1=3 , d = 3 d=3 and n = 20 n=20 .Using its formula for sum we obtain S = 630 S=630 .In this sum we have also calculated the numbers which are divisible by 3 3 and 5 5 at the same time and their sum is S = 15 + 30 + 45 + 60 = 150 S=15+30+45+60=150 .The sum of numbers which are divisible by 5 is S = 5 + 10 + 15 + . . . . . . . . + 60 S=5+10+15+........+60 .This is also an arithmetic progression with a 1 = 5 a_1=5 , d = 5 d=5 and n = 12 n=12 .Using its formula for sum we obtain S = 390 S=390 . In this sum we have also calculated those numbers who are divisible by 3 3 and 5 5 in the same time but we have counted them once and that's why we are going to substract 150 150 from 390 390 to obtain 240 240 .Therefore the desired sum is 630 + 240 = 870 630+240=870 .

Mohamed Mahmoud
Nov 23, 2013

integers that are divisible by 3 from 1 to 61 are an Arithmetic Progression starts from 3 and ends at 60 with an increment of 3 then their summation are S = n(a + L)/2 = 20*(3+60)/2=630

integers that are divisible by 5 from 1 to 61 are an Arithmetic Progression starts from 5 and ends at 60 with an increment of 5 then their summation are S = n(a + L)/2 = 12*(5+60)/2=390

integers that are divisible by 5 and 3 from 1 to 61 are an Arithmetic Progression starts from 5x3=15 and ends at 60 with an increment of 15 then their summation are S = n(a + L)/2 = 4*(15+60)/2=150

so the required summation is =630+390-150=870

Shubham Kumar
Nov 20, 2013

Integers between 1 and 61 which are divisible by 3 and 5.

Integers divisible by 3 are 3,6,9,...60. (20 terms). Sum = 630

Integers divisible by 5 are 5,10,15,...60 (12 terms). Sum =390. And we can see that multiples 15 are counted twice in multiples of 3 & 5 both.

Therefore, multiples of 15 (Sum = 150) should be removed from the sum of multiples of 3 & 5.

Net sum = 630 + 390 - 150 = 870. (Ans)

Hello all,

as the range for N is [1,61],

we know that N is divisible by 3 or 5,the numbers that are divisible by both 3 & 5 are 15,30,45 and 60,

therefore,for N divisible by 3 are 3,6,9,12,........60,

60/3=20(20 terms up to 60),

S(20 terms)=20/2.[2(3)+(19)(3)]=630(amongst the sum included the sum of 15,30,45,60 together),

as for N that is divisible by 5,we know that the N are = 5,10,15,20,25,30,35,40,45,60(but we already added up for 15,30,45,60),sum of N/5=5+10+20+25+35+40+50+55=240

Therefore, N(sum of integers)=630 + 240 = 870....

thanks...

Arijit Banerjee
Mar 11, 2014

I did it using Bluej ....

class Divisors

{ public static void main(String args[]) {
int c=0; int i =0; for(i=1;i<=61;i++) { if(i%3 ==0 || i%5 ==0) { c=c+i;

    }
}
System.out.println(c);

} }

Aditya Joshi
Feb 18, 2014

The numbers that are divisible by 3 3 are multiples of three in the range 1 N 61 1 \leq N \leq 61 , thus, 3 , 6 , 9 , 60 3,6,9, \dots 60 There are 20 20 such terms that we need to add.

The numbers that are divisible by 5 5 are multiples of five in the range 1 N 61 1 \leq N \leq 61 , thus, 5 , 10 , 15 60 5,10,15 \dots 60 . There are 12 12 such terms.

But, we overcount numbers that are divisible by both, and these are precisely the numbers divisible by 15 15 , like 15 , 30 , 60 15,30, \dots 60 . There are 4 4 such terms.

Thus, we need to find the sum of these series. We observe that these are just arithmetic series. The sum of arithmetic series of the form a 1 + a 2 + + a n a_1 + a_2 + \dots + a_n is given by n ( a 1 + a n ) 2 \dfrac{n(a_1 + a_n)}{2}

Thus, we have to find

20 ( 3 + 60 ) 2 + 12 ( 5 + 60 ) 2 4 ( 15 + 60 ) 2 \dfrac{20(3 + 60)}{2} + \dfrac{12(5 + 60)}{2} - \dfrac{4(15 + 60)}{2} which is 870 \boxed{870}

There are floor(61/3)=20, floor(61/5) = 12 and floor (61/(3 * 5))=4 numbers divisible by 3, 5, 15 respectively.

Now, sum of the numbers divisible by 3 is = (20/2)*(2 * 3 + (20-1) * 3) = 630

sum of the numbers divisible by 5 is = (12/2)*(2 * 5 + (12-1) * 5) = 390

sum of the numbers divisible by 15 is = (4/2)*(2 * 15 + (4-1) * 15) = 150.

So total sum of the numbers divisible by 3 or 5 = 630 + 390 - 150 = 870

Victor Loh
Jan 4, 2014

Multiples of 3 3 : 3 , 6 , 9 , . . . , 54 , 57 , 60 3, 6, 9, ... ,54, 57, 60

Multiples of 5 5 : 5 , 10 , 15 , . . . , 50 , 55 , 60 5, 10, 15, ... ,50, 55, 60

Multiples of 15 15 : 15 , 30 , 45 , 60 15, 30, 45, 60

Hence, sum of all integers N N = ( 3 + 6 + 9 + . . . + 54 + 57 + 60 ) + ( 5 + 10 + 15 + . . . + 50 + 55 + 60 ) ( 15 + 30 + 45 + 60 ) (3 + 6 + 9 + ... + 54 + 57 + 60) + (5 + 10 + 15 + ... + 50 + 55 + 60) - (15 + 30 + 45 + 60)

= 3 ( 1 + 2 + 3 + . . . + 18 + 19 + 20 ) + 5 ( 1 + 2 + 3 + . . . + 10 + 11 + 12 ) 15 ( 1 + 2 + 3 + 4 ) = 3(1 + 2 + 3 + ... + 18 + 19 + 20) + 5(1 + 2 + 3 + ... + 10 + 11 + 12) - 15(1 + 2 + 3 + 4)

= 3 × 20 × 21 2 + 5 × 12 × 13 2 15 × 4 × 5 2 = 3 \times \frac{20 \times 21}{2} + 5 \times \frac{12 \times 13}{2} - 15 \times \frac{4 \times 5}{2}

= 3 × 210 + 5 × 78 15 × 10 = 3 \times 210 + 5 \times 78 - 15 \times 10

= 630 + 390 150 = 630 + 390 - 150

= 870 = \boxed{870}

  1. Numbers which divisible by 3 are: 3, 6, 9, ... 60. Since 60 = 3 × 20 60=3\times20 then there are 20 numbers incuded to the sequence. The sum of all those numbers are 3 + 6 + 9 + . . . + 60 = 3 ( 1 + 2 + 3 + . . . + 20 ) = 3 × 20.21 2 = 630 3+6+9+...+60=3(1+2+3+...+20)=3\times\frac {20.21}{2}=630
  2. Numbers which divisible by 5 are: 5, 10, 15, ... 60. Since 60 = 5 × 12 60=5\times12 then there are 12 numbers incuded to the sequence. Analogous to point (1), we yield 5 × 12.13 2 = 390 5\times\frac {12.13}{2}=390
  3. Adding the value got from point (1) and (2) gives us the sum of 1020 1020 . But note that in our calculation, we've doublecounted the sum of numbers which are divisible by 3 and 5, those are, 15, 30, 45, and 60 whose the sum is equal 150 150
  4. Therefore the sum of all integers N N is 1020 150 = 870 1020-150=\boxed {870}
Leo Smart
Dec 26, 2013

include<iostream>

include<conio.h>

using namespace std; main(){ int b,hasil=0; int batas=61; for(int i=1;i<b;i++){ if((i%3==0)||(i%5==0)){ hasil +=i; }} cout<<hasil; getch(); }

Budi Utomo
Dec 23, 2013

3 ---> 3, 6, 9, 12, 15, ... , 60 = 3/2 . 20 . 21 = 630 ; 5-----> 5,10,20,25,35,40,50,55 = 240. Thus, 630 + 240 = 870

Vikas Kumar
Nov 23, 2013

sum(3+6+12+......+60)+ sum(5+10+15+......60)-sum(15+30+45+60)

Arkan Megraoui
Nov 23, 2013

Divisible by 3 are: 3, 6, 9, ..., 60.

Divisible by 5: 5, 10, 15, ..., 60.

Divisible by 3 & 5: 15, 30, 45, 60.

By P.I.E., we have that [Sum of divisible by 3 or 5] = [sum of divisible by 3] + [sum of divisible by 5] - [sum of divisible by 3 & 5] = 3(1+2+...+20)+5(1+2+...+12)-15(1+2+3+4)=870

by using the formula 1+2+...+n=n(n+1)/2.

Sudipta Laha
Nov 21, 2013

public static calculateSum() {

int sum=0; for(int i=1;i<=61;i++) { if(i%3==0||i%5==0) sum=sum+i; } System.out.println(sum);

}

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...