🇺🇸 AMC 8 ⇄ switch contest
2020 AMC 8

Problem 19

Problem 19 · 2020 AMC 8 Medium
Number Theory divisibilitydigit-sum

A number is called flippy if its digits alternate between two distinct digits. For example, 2020 and 37373 are flippy, but 3883 and 123123 are not. How many five-digit flippy numbers are divisible by 15?

Show answer
Answer: B — 4 numbers.
Show hints
Hint 1 of 2
Break the scary ‘divisible by 15’ into two friendly tests: divisible by 5 (look at the last digit) and divisible by 3 (look at the digit sum). Handle them one at a time.
Still stuck? Show hint 2 →
Hint 2 of 2
A 5-digit flippy looks like ababa, so the first and last digit are the same a. Div-by-5 wants the last digit to be 0 or 5 — but it's also the first digit, which can't be 0. That forces a = 5; then chase div-by-3 on what's left.
Show solution
Approach: split 15 = 3 × 5, and let the ‘same first/last digit’ force a
  1. Divisible by 15 means divisible by both 5 and 3 — two simple digit tests instead of one hard division.
  2. A flippy 5-digit number is ababa, so its first and last digits are both a. Div-by-5 needs the last digit 0 or 5; since it's also the leading digit it can't be 0, so a = 5. The number is 5b5b5.
  3. Div-by-3 looks at the digit sum: 5+b+5+b+5 = 15 + 2b. Since 15 is already a multiple of 3, we just need 2b (hence b) divisible by 3: b ∈ {0, 3, 6, 9}, all different from 5.
  4. That's 4 flippy numbers.
  5. You'll see this again as: to test divisibility by a composite, split it into coprime factors and apply each rule separately (15 → 3 and 5; 12 → 3 and 4; 6 → 2 and 3). And in ‘flippy’-style patterns, the repeated-digit structure often pins a digit before you do any real work.
Mark: · log in to save