closed by
1,545 views
2 votes
2 votes
closed with the note: got it =D
closed by

2 Answers

Best answer
2 votes
2 votes
let A be the set of numbers divided by 2,
B be the set of numbers divide by 3 and
C be the set of numbers divide by 7

A = {2,4,6,8 .......42 }

B = {3,6,9,....42 }

C = {7,14,21,28,35,42}

|A| = 21 , |B| = 14 , |C| = 6

By principle of inclusion and exclusion,

|A $\cup$ B $\cup$ C| = |A|+|B|+ |C| - |A$\cap$B| - |B$\cap$C| -  |A$\cap$C|  + |A$\cap$B $\cap$ C|

A$\cap$B = {6,12...42}
|A$\cap$B| = 7

B$\cap$C = {21,42}
|B$\cap$C| = 2

A$\cap$C = {14,28,42}
|A$\cap$C |  = 3

A∩B∩C = {42}
|A∩B∩C| =  1

 |A $\cup$ B $\cup$ C| = 21 + 14 + 6 - 7 - 2 - 3  + 1

 |A $\cup$ B $\cup$ C| = 30
selected by
1 votes
1 votes
Total number of integers = 42  (1 to 42)
Number of integers divisible by 2 = floor(42/2) = 21
Number of integers divisible by 3 = floor(42/3) = 14
Number of integers divisible by 7 = floor(42/7) = 6

Number of integers divisible by 2 and 3 both = floor( 42/ lcm(2,3) ) = 7
Number of integers divisible by 2 and 7 both = floor( 42/ lcm(2,7) ) = 3
Number of integers divisible by 3 and 7 both = floor( 42/ lcm(3,7) ) = 2

Number of integers divisible by 2, 3 and 7 all = floor( 42/ lcm(2,3,7) ) = 1
Now,
Number of integers divisible by either 2 or 3 or 7 = 21 + 14 + 6 - 7 - 3 - 2 + 1 = 30

Related questions

0 votes
0 votes
1 answer
2
vijaycs asked Mar 22, 2016
1,251 views
The sum of all integers from 1 to 1000 that are divisible by 2 or 5 but not divisible by 4 equals 175000225500149500124000