The number of integers between 1 and 500 (both inclusive) that are divisible by 3 or 5 or 7 is …
Topic-wise GATE CS PYQs with verified steps
GATE CSE 2017 Set 1 · Q47
Time
Your answerNumerical answer
Solution
Official answer: 271 (±0)
CombinatoricsLet , so .
Let:
be the set of integers divisible by 3
be the set of integers divisible by 5
be the set of integers divisible by 7
Using the Principle of Inclusion-Exclusion (PIE):
Calculating individual cardinalities:
Calculating pairwise intersections:
Calculating three-way intersection:
Applying PIE:
Thus, the answer is 271 [cite: 2].
Try the question first, then check your work.
Examiner trap
Use the Principle of Inclusion-Exclusion: .
This Combinatorics previous year question is Q47 of the GATE CSE 2017 Set 1 paper. Find more GATE CSE PYQs on Combinatorics in Engineering Mathematics, or browse all GATE CSE PYQs.
Free diagnostic
Take the 20-minute diagnostic: the 3 topics that cost you the most marks, and a rank range. Or sit 5 related Combinatorics PYQs now with no account.
An official question by email at 7 AM IST, with a link to its verified solution. Unsubscribe in one click.
Combinatorics has 19 GATE CSE PYQs across 15 papers from 2012 to 2025. 7 of them are 2-mark NAT questions like this one, and it is the only one in GATE CSE 2017 Set 1.
How GATE tests CombinatoricsIndependent practice explanation verified by the GateAI team. GATE is conducted by the IITs; question text follows the official paper.