No of multiples of 2 between 1 and 500 (inclusive) = [(500-2)/2]+1 = 249+1= 25
No of multiples of 3 between 1 and 500 (inclusive) = [(498-3)/3]+1 = 165+1= 166
No of multiples of 5 between 1 and 500 (inclusive) = [(500-5)/5]+1 = 99+1= 100
Less :- No of multiples of 6 (LCM of 2 and 3) between 1 and 500 = [(498-6)/6]+1 = 82+1= 83
Less :- No of multiples of 10 (LCM of 2 and 5) between 1 and 500= [(500-10)/10]+1=49+1=50
Less :- No of multiples of 15 (LCM of 3 and 5) between 1 and 500= [(495-15)/15]+1= 32+1=33
Add :- No of multiples of 30 (LCM of 2,3 and 5) between 1 and 500= [(480-30)/30]+1= 15+1=16
No of multiples 2 or 3 or 5 between 1 and 500 (inclusive) = 366
Anyone with quicker approach to solve the problem?