The total number of 4-digit numbers whose greatest common divisor with 54 is 2 , is
Solution
Core idea. A greatest common divisor fixes which prime factors must and must not be shared.
Concept refresher. The greatest common divisor of two numbers contains exactly the prime factors they share. The number of multiples of from to , when both ends are multiples, is
Picture the situation. Since 54 is 2 times 27, its only prime factors are 2 and 3. A greatest common divisor of exactly 2 means the four-digit number shares the factor 2 but not the factor 3. Higher powers of 2 in the number do not matter, because 54 contains only one factor 2.
Approach. Count the even four-digit numbers and remove those divisible by 3.
Step 1: The condition
Since , the greatest common divisor is 2 exactly when the number is even and not divisible by 3.
Step 2: Count
The even four-digit numbers run from 1000 to 9998, which is 4500 numbers. Those also divisible by 3 are the multiples of 6 from 1002 to 9996, which is . So the count is .
Answer. 3000
Sanity check. Among any six consecutive numbers exactly two are even and not multiples of 3, and one third of the 9000 four-digit numbers is 3000.
Common wrong answers
- 1500: Also excluding the multiples of 4 gives 1500; a multiple of 4 that is not divisible by 3 still has greatest common divisor 2 with 54.
- 4500: Counting all even four-digit numbers, without removing the multiples of 3, gives 4500.
Key takeaway
The trap. Only the primes of the given number matter, each up to the power it has there.
How toppers think. They count two suitable numbers in every block of six consecutive numbers.
Remember. Even and not divisible by 3.
More on Inclusion–Exclusion Principle
- The number of seven-digit numbers, that can be formed by using the digits 1, 2, 3, 5 and 7 such that each…
- The number of permutations, of the digits 1, 2, 3, …, 7 without repetition, which neither contain the string…
- Let b₁b₂b₃b₄ be a 4-element permutation with bi ∈ {1, 2, 3, …, 100} for 1 ≤ i ≤ 4 and bi ≠ bj for i ≠ j…
- All 7 on Inclusion–Exclusion Principle ›