AMC 10 · 2009 · #19

Grade 9 number-theory
difference-of-squarespolynomial-factoringprime-numberscompleting-the-square pattern-recognitionbound-inequality-then-enumerate ↑ Prerequisites: polynomial-factoringprime-numbers
📏 Long solution 💡 3 insights
Problem
A quartic rule is applied to every positive integer. Find the sum of the prime values it ever produces.

Pick an answer.

(A)
794
(B)
796
(C)
798
(D)
800
(E)
802
How to solve
Strategy Organize Information in More Ways

Tool #15 (Organize Information in More Ways) is the spine. The expression n⁴ - 360n² + 400 says nothing about primality as written, because primality is about factoring, and this form shows no factors. Regrouping the same expression as a difference of two squares turns it into a product, and a product is exactly what a primality question can be answered from. Tool #6 (Guess and Check) opens the work — a few sample values show the shape of the outputs — and closes it, by testing the two surviving candidates. Tool #14 (Extreme Principle) pins down the smallest possible value of the larger factor, which is the hinge of the whole argument. Tool #3 (Eliminate Possibilities) uses that bound to knock out every n except a handful, in one stroke rather than range by range. Tool #11 (Work Backwards) then starts from the condition the factor must satisfy and solves for the n that produce it.

1STEP 1

Sample a few values

A few values show the outputs are mostly composite.

f(1) = 41, f(2) = -1024, f(19) = 761, f(20) = 16400
2STEP 2

Spot a hidden difference of squares

The expression hides a difference of squares.

(n²+20)² = n⁴ + 40n² + 400 → f(n) = (n²+20)² - 400n² = (n²+20)² - (20n)²
3STEP 3

Factor and confirm the identity

That factors it into two brackets.

f(n) = (n² - 20n + 20)(n² + 20n + 20) = A · B
4STEP 4

Bound the larger factor

The larger bracket is always well above one.

B = (n+10)² - 80 ≥ 11² - 80 = 41 for all n ≥ 1
5STEP 5

Force the small factor to be 1

So primality forces the smaller bracket to equal one.

f(n) prime, B ≥ 41 → A ≥ 1; A ≥ 2 → f(n) = A · B composite → A = 1
6STEP 6

Solve for the surviving inputs

Solving gives just two inputs.

n² - 20n + 20 = 1 → n² - 20n + 19 = 0 → (n-1)(n-19) = 0 → n = 1, 19
7STEP 7

Verify both candidates, then add

Verifying both and adding gives 802, choice (E).

f(1) = 41, f(19) = 761, 41 + 761 = 802 → (E)
Answer
802
Three independent checks. First, the factorization: at n = 3, A = 9 - 60 + 20 = -31 and B = 9 + 60 + 20 = 89, so A · B = -2759, matching f(3) = 81 - 3240 + 400 = -2759. Second, the logic covers every input with no gaps: B ≥ 41 holds for all n ≥ 1, and the split 'A ≤ 0, A = 1, or A ≥ 2' is exhaustive over the integers, so no n escapes. Third, the sufficiency check was actually performed — 41 and 761 were each tested for primality rather than assumed, which matters because A = 1 alone proves only that these are the only possible inputs, not that they work. One warning about the answer choices: 802 is the largest option, so a solver who finds 41 and 761 and stops because the running total already reaches the top choice has guessed, not proved. The choices sit within 8 of each other precisely to make that shortcut tempting; the factorization is what turns it into an argument.
💡Key takeaway

A quartic that looks unfactorable can hide a difference of squares: once f(n) = (n²-20n+20)(n²+20n+20), the second factor is always at least 41, so being prime forces the first factor to be exactly 1 — leaving only n = 1 and n = 19, whose primes 41 and 761 add to (E) 802.

  • Sample a few values
  • Spot a hidden difference of squares
  • Factor and confirm the identity
  • Bound the larger factor
  • Force the small factor to be 1
  • Solve for the surviving inputs
  • Verify both candidates, then add