AMC 10 · 2005 · #18

Grade 10 number-theory
principle-of-inclusion-exclusionprime-numbersmultiples complementary-countingidentify-subproblems ↑ Prerequisites: prime-numbersmultiplesfloor-function
📏 Medium solution 💡 3 insights
Problem
A number is prime-looking when it is composite but has none of 2, 3 or 5 as a factor. Exactly 168 primes lie below one thousand. Count the prime-looking numbers below one thousand.

Pick an answer.

(A)
100
(B)
102
(C)
104
(D)
106
(E)
108
How to solve
Strategy Change Focus / Count the Complement

Prime-looking is defined by two negatives at once: not prime, and not divisible by 2, 3, or 5. Hunting for such numbers one at a time is slow, and that is exactly why the problem hands over the count of primes. Instead, sort all 999 numbers into four groups that overlap nowhere and miss nothing, count the three easy groups, and read off the fourth.

1STEP 1

Fix the range and the definition

The range holds 999 numbers, and the definition needs both parts.

1 ≤ n ≤ 999 ⟹ 999 numbers in total
2STEP 2

Split 1 to 999 into four groups

Sorting into disjoint groups makes the four counts add to the whole.

999 = 1 + |S₂ ∪ S₃ ∪ S₅| + 165 + N
3STEP 3

Count the multiples of 2, 3, and 5

Dividing and dropping remainders counts each factor's multiples.

|S₂| = ⌊ 999/2 ⌋ = 499, |S₃| = ⌊ 999/3 ⌋ = 333, |S₅| = ⌊ 999/5 ⌋ = 199
4STEP 4

Turn the overlaps into single divisors

Overlaps become single divisors through the least common multiple.

|S₆| = 166, |S₁₀| = 99, |S₁₅| = 66, |S₃₀| = 33
5STEP 5

Apply inclusion and exclusion

Inclusion and exclusion gives 733 with a small factor.

|S₂ ∪ S₃ ∪ S₅| = 499 + 333 + 199 - 166 - 99 - 66 + 33 = 733
6STEP 6

Subtract down to the answer

Removing one and the remaining primes leaves 100, choice (A).

999 - 733 = 266, N = 266 - 1 - 165 = 100
Answer
100
Recount the 266 survivors a different way. Divisibility by 2, 3, and 5 repeats with period 30, and among any 30 consecutive numbers exactly 8 escape all three, namely the residues 1, 7, 11, 13, 17, 19, 23, 29. From 1 to 990 there are 33 whole blocks, giving 33 times 8 = 264, and from 991 to 999 only 991 and 997 survive, for 266 in total. That matches, so the subtraction 266 - 1 - 165 = 100 stands. The answer also sits well against the problem's own hint: a prime-looking number has every prime factor at least 7, so the smallest possible one is 7 times 7 = 49, which is precisely the first number the problem lists.
💡Key takeaway

When a group is described by what it is not, count the whole crowd, count everybody else, and subtract.

  • Fix the range and the definition
  • Split 1 to 999 into four groups
  • Count the multiples of 2, 3, and 5
  • Turn the overlaps into single divisors
  • Apply inclusion and exclusion
  • Subtract down to the answer