Skip to content
GATEiit

GATE CSE 2017 Session 1 Q57: Integers from 1 to 500 divisible by 3 or 5 or 7

Syllabus topic: Combinatorics: counting, recurrence relations and generating functions

Question

The number of integers between 1 and 500 (both inclusive) that are divisible by 3 or 5 or 7 is ______.

Try it: numerical answer: type the value

Numerical answer. No negative marking.
Show answer and explanation

Answer: 271 (official GATE 2017 final answer key)

Concept used: Inclusion–exclusion over three sets, with counts ⌊500/d⌋ for each divisor d (and for products of the divisors).

Concept notes

Loading notes…

First step: Compute ⌊500/3⌋,⌊500/5⌋,⌊500/7⌋, the pairwise counts for 15, 21, 35 and the triple count for 105, then apply inclusion–exclusion.

Full step-by-step solution

Loading…

Answer from the official final answer key. Found a mistake? Use Report issue and we will fix it.

More questions on Combinatorics: counting, recurrence relations and generating functions

Every PYQ on this topic →

Share this question

WhatsAppDownload image

Source: official GATE 2017 Session 1 CS question paper and final answer key, organised by IIT Roorkee. Question paper · Answer key