find the sum of all numbers less than 500 which are exactly divisible by 3,4,6,8
Answers
4.8.3.6
Hope I Help You❤️
How many natural numbers below 500 are divisible by at least one of the numbers 2, 3, 4, 6, 8, 10, 12 and 20?
You can just check for the numbers which are divisible by 2,3.
No need to check for other numbers because they too are the multiples of either 2 or 3. Hence whichever the numbers divisible by above given numbers other than 2 and 3 are also divisible by either 2 or 3.
Let's start to count the numbers divisible by either 2 or 3.
Number of multiples of 3 under 500 is given by x=integerpartof(500/3)=166. So there will be 166 numbers below 500 which are divisible by 3. Of these 166 numbers 83 are even(as you can observe multiples of 3 are 3,6,9,12…I.e., alternative odd and even numbers). So there will be 83 numbers which are divisible by 3 but not divisible by 2.
Now number of numbers divisible by 2 are 500/2=250.
so totally 250+83 numbers are divisible by the above given numbers(in the question) which are under 500.