GATE / CS ARCHIVE

GATE CSE 1995 / QUESTION 25(b)

Counting integers coprime to30

Discrete Mathematics · Proof Techniques & Number Theory · Full GATE CSE 1995 paper

GATE 1995, Q25(b) Descriptive
Report issue

Proof Techniques & Number Theory

Question 25(b), GATE 1995: How many positive integers at most 720 are divisible by none of 2,3,5?
Tap to enlarge
Answer & solution

Answer: 192. (no official key was published)

Let A,B,C be the subsets of {1,…,720} divisible by 2,3,5 respectively. Their sizes are 360,240,144. Because the divisors are pairwise coprime, the pair intersections count multiples of 6,10,15, giving 120,72,48; the triple intersection counts multiples of 30, giving 24.

Inclusion–exclusion gives |A∪B∪C|=360+240+144−120−72−48+24=528. These are exactly the integers disqualified by at least one divisibility condition. Subtract from all 720 positive integers to obtain 720−528=192. The subtraction of pair intersections corrects double counting, while adding the triple intersection restores numbers removed too many times.

An independent way to see the count is to use blocks of 30. In each block the allowed residue classes are 1,7,11,13,17,19,23,29 modulo 30, eight in total. There are 720/30=24 complete blocks, hence 24×8=192. The residue 0 is not allowed, and the positive-integer domain excludes 0 anyway.

Original paper, page 8