🇺🇸 AMC 8 ⇄ switch contest
2009 AMC 8

Problem 23

Problem 23 · 2009 AMC 8 Medium
Algebra & Patterns quadratic

On the last day of school, Mrs. Awesome gave jelly beans to her class. She gave each boy as many jelly beans as there were boys in the class. She gave each girl as many jelly beans as there were girls in the class. She brought 400 jelly beans, and when she finished, she had six jelly beans left. There were two more boys than girls in her class. How many students were in her class?

Show answer
Answer: B — 28 students.
Show hints
Hint 1 of 2
"Each boy gets one bean per boy" means the boys together get b × b = b2 beans — a square! Likewise girls get g2. Beans handed out = 400 − 6 = 394, so b2 + g2 = 394.
Still stuck? Show hint 2 →
Hint 2 of 2
You now want two squares (with b just 2 more than g) that add to 394. Since 394 ≈ 14² + 14², the numbers sit right near 14 — so a quick guess-and-check beats heavy algebra.
Show solution
Approach: two squares summing to 394, with b = g + 2
  1. Each boy receives b beans and there are b boys ⇒ b2 beans to boys; similarly g2 to girls. Given out: 400 − 6 = 394. So b2 + g2 = 394 with b = g + 2.
  2. The two squares average about 197, and √197 ≈ 14 — so test the consecutive-even-apart pair around 14: g = 13, b = 15 gives 169 + 225 = 394. It works.
  3. Students = 13 + 15 = 28.
  4. Why this transfers: "sum of two squares near a known total" almost always yields to estimating the size (√half-the-total) and checking a couple of nearby values — lighter than expanding a quadratic.
Another way — solve the quadratic:
  1. (g+2)2 + g2 = 394 ⇒ 2g2 + 4g + 4 = 394 ⇒ g2 + 2g − 195 = 0.
  2. Factor: (g + 15)(g − 13) = 0 ⇒ g = 13, b = 15, total 28.
Mark: · log in to save