Arithmetic · real student question

Let X = {5, 6, ..., 200}. How many elements of X are divisible by 2 or by 5?

Question

Let X={5,6,,200}X=\{5,6,\ldots,200\}. How many elements of XX are divisible by 22 or by 55?

Step-by-step solution

  1. Choose inclusion–exclusion, and read "or" inclusively. Let AA be the multiples of 22 in XX and BB the multiples of 55. "Divisible by 22 or 55" means ABA\cup B, and

    AB=A+BAB|A\cup B|=|A|+|B|-|A\cap B|

    The subtraction matters: numbers such as 1010, 2020, 3030 are in both lists and must not be counted twice.

  2. Count the multiples of 2. Use 200242\big\lfloor \tfrac{200}{2}\big\rfloor-\big\lfloor \tfrac{4}{2}\big\rfloor — multiples up to 200200 minus those up to 44 (the numbers below the start of the range):

    A=1002=98|A|=100-2=98

    (The excluded ones are 22 and 44; the list runs 6,8,,2006,8,\ldots,200.)

  3. Count the multiples of 5.

    B=200545=400=40|B|=\left\lfloor\frac{200}{5}\right\rfloor-\left\lfloor\frac{4}{5}\right\rfloor=40-0=40

    (The list is 5,10,,2005,10,\ldots,200, and 55 itself is inside the range.)

  4. Count the overlap. A number divisible by both 22 and 55 is divisible by lcm(2,5)=10\operatorname{lcm}(2,5)=10:

    AB=20010410=200=20|A\cap B|=\left\lfloor\frac{200}{10}\right\rfloor-\left\lfloor\frac{4}{10}\right\rfloor=20-0=20

  5. Apply the formula.

    AB=98+4020=118|A\cup B|=98+40-20=118

    118\boxed{118}

  6. Cross-check with the complement. The set XX has 2005+1=196200-5+1=196 elements. Numbers coprime to 1010 in a block of 1010 consecutive integers number 44 (those ending in 1,3,7,91,3,7,9); from 55 to 200200 there are 1919 full decades 1111200200 minus... more simply, the count of numbers ending in 1,3,7,91,3,7,9 between 55 and 200200 is 7878 (from 7,97,9 then four per decade for the 1919 decades 1111200200: 2+4×19=782+4\times 19=78). Then 19678=118196-78=118, matching.

Answer

118118

Need to solve a different problem like this? Open the solver →