🇺🇸 AMC 8 ⇄ switch contest
2025 AMC 8

Problem 23

Problem 23 · 2025 AMC 8 Hard
Number Theory primesdifference-of-squaresprime-test

How many four-digit numbers have all three of the following properties?

  1. The tens digit and ones digit are both 9.
  2. The number is 1 less than a perfect square.
  3. The number is the product of exactly two prime numbers.
Show answer
Answer: B — Exactly 1.
Show hints
Hint 1 of 2
Translate each clue into a structural fact. Ending in 99 means "add 1" gives a number ending in 00 — and a perfect square ending in 00 forces its square root to be a multiple of 10. That alone cuts the candidates to a handful.
Still stuck? Show hint 2 →
Hint 2 of 2
Now the number is (10k)2 − 1 = (10k − 1)(10k + 1), already factored. "Product of exactly two primes" means both of those factors must themselves be prime — you're hunting twin primes straddling a multiple of 10.
Show solution
Approach: turn the clues into structure: square ends in 00, then seek twin primes
  1. Decode the conditions instead of testing thousands of numbers. "Ends in 99" + 1 = ends in 00, and a square ending in 00 must be (10k)2. So the number is (10k)2 − 1 = (10k − 1)(10k + 1) — a difference of squares, factored for free.
  2. Four-digit size forces 10k ∈ {40, 50, 60, 70, 80, 90, 100}, just 7 cases.
  3. "Product of exactly two primes" now means both 10k − 1 and 10k + 1 are prime. Check: 39×41 (39 = 3×13, no), 49×51 (49 = 72, no), 59×61 (both prime ✓), 69×71 (69 = 3×23, no), 79×81 (81 = 34, no), 89×91 (91 = 7×13, no), 99×101 (99 = 9×11, no).
  4. Only 59 × 61 = 3599 survives, so exactly 1.
  5. Why this transfers: "one less than a perfect square" should instantly trigger the difference-of-squares factoring a2 − 1 = (a−1)(a+1) — turning a vague property into a concrete factorization you can prime-test.
Mark: · log in to save