The regular octagon has its center at . Each of the vertices and the center are to be associated with one of the digits through , with each digit used once, in such a way that the sums of the numbers on the lines , , , and are all equal. In how many ways can this be done?

- A)
- B)
- C)
- D)
- E)
Answer
C
Key insight
J is on every line, so the lines have equal sums exactly when the four opposite pairs have equal sums. The eight outer numbers add to 45 - J.
Solution
- Every line goes through the center . So each line's sum is plus the two opposite corners on it. The four line sums are equal exactly when the four opposite pairs , , , all have the same sum. Call that pair sum .
- The digits to add up to . The eight corners use every digit except , so they add up to . They form four pairs, each adding to , so .
- That means must be a multiple of . Check each :
| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | |
|---|---|---|---|---|---|---|---|---|---|
| 44 | 43 | 42 | 41 | 40 | 39 | 38 | 37 | 36 |
Only , and are multiples of , so , or .
4. In each case, the pairs are forced. Pair the smallest remaining digit with the one that completes the sum, and repeat:
- , : .
- , : .
- , : .
5. Now place the pairs. The four pairs go on the four lines in ways. On each line, either number of the pair can go at either end, which is ways per line and ways for all four lines. That gives ways for each choice of .
6. Total: .
The answer is .
Why this works
The center is shared by every line, so it drops out when you compare the sums. That turns "four equal line sums" into "four equal pair sums", which a quick divisibility check settles. After that, counting is just arranging: which pair goes on which line, and which way round.
The trap
Forgetting that the four pairs can be placed on the lines in 24 orders, or that each pair can be flipped end to end, 16 ways in all.
Concise solution
Each of the four lines passes through the center , so its sum is plus the sum of a pair of opposite vertices. The lines have equal sums exactly when the four opposite pairs all have the same pair-sum .
The eight vertex numbers are everything except , so . Thus must be a multiple of , which happens for only.
- : , pairs .
- : , pairs .
- : , pairs .
In every case the eight remaining digits split into four pairs in exactly one way. Assign the four pairs to the four lines: ways. Within each line, decide which end gets which number: ways. Each case contributes labelings.
Total: .
The answer is .
Review in the AoPS books
- Introduction to Counting & Probability, Chapter 2: Basic Counting Techniques (§2.5)
- Introduction to Number Theory, Chapter 12: Introduction to Modular Arithmetic
- Introduction to Counting & Probability, Chapter 3: Correcting for Overcounting (§3.2, §3.4)
- Introduction to Number Theory, Chapter 10: Units Digits
Techniques
Split into exhaustive cases and handle each · Set up the equation/formula and compute; no special trick needed