AMC 8 · 2025 · #23

Grade 5 number-theory
prime-numbersperfect-squaresprimality-testplace-value systematic-enumerationidentify-subproblems ↑ Prerequisites: prime-numbersprimality-testplace-value
📏 Medium solution 💡 3 insights
📘 View easy version →
Problem
Count the four-digit whole numbers N (from 1000 to 9999) that satisfy all three of: (I) the last two digits of N are both 9, (II) N + 1 is a perfect square, and (III) N has exactly two prime factors when written as a product of primes.

Pick an answer.

(A)
0
(B)
1
(C)
2
(D)
3
(E)
4

AMC 8 2025 problem © Mathematical Association of America (MAA AMC). Reproduced for educational use.

How to solve
Strategy Make a Systematic List

Combining conditions (I) and (II) is a small subproblem: N ends in 99 means N + 1 = k² ends in 00, which forces k to be a multiple of 10. That collapses the search from thousands of four-digit numbers down to a tiny finite list of k values (Tool #7 splits the work cleanly). Tool #2 (Systematic List) then enumerates every candidate k = 40, 50, …, 100 in order. For each, condition (III) is checked by noting k²-1 = (k-1)(k+1) — both factors must be prime — which is Tool #3 (Eliminate Possibilities) crossing off any k where k-1 or k+1 is composite. No algebra needed beyond grade-school multiplication and primality checks.

1STEP 1

Ends in 99 means N + 1 ends in 00 — a square ending in 00 forces its root to be a multiple of 10, so k = 10m.

N + 1 ≡ 00 (mod 100) → k² ends in 00 → k = 10m
2STEP 2

With 1001 ≤ k² ≤ 10000 and k a multiple of 10, the only candidates are k = 40, 50, 60, 70, 80, 90, 100.

1001 ≤ k² ≤ 10000, k=10m → k ∈ {40, 50, 60, 70, 80, 90, 100}
3STEP 3

Factor N = k² - 1 = (k-1)(k+1): N is a product of two primes exactly when both k-1 and k+1 are prime.

N = k² - 1 = (k-1)(k+1)
4STEP 4

Only k = 60 survives — 59 and 61 are both prime, giving N = 59 × 61 = 3599; every other k has a composite neighbor.

k=40:& (39,41), 39=3· 13 X ; k=50:& (49,51), 49=7² X ; k=60:& (59,61) both prime ✓ ; k=70:& (69,71), 69=3· 23 X ; k=80:& (79,81), 81=3⁴ X ; k=90:& (89,91), 91=7· 13 X ; k=100:& (99,101), 99=9· 11 X
5STEP 5

Exactly one four-digit number works: N = 3599 = 59 × 61 — the count is 1, choice (B).

count = 1 → (B)
Answer
1
Sanity check the winner: 3599 ends in 99 (condition I), 3599 + 1 = 3600 = 60² is a perfect square (condition II), and 3599 = 59 × 61 with both factors prime, so exactly two prime factors (condition III). All three hold. Also, the answer of 1 is consistent with how AMC 8 typically rewards twin-prime-style observations — twin primes thin out fast, so finding only one match in a small window is expected, not suspicious.
💡Key takeaway

This AMC 8 problem only needs Grade 5 place-value patterns plus the Grade 4 "is this number prime?" check you already know!