2025 AMC 10B Problem 21
Each of the squares in a grid is to be colored red, blue, or yellow in such a way that each red square shares an edge with at least one blue square, each blue square shares an edge with at least one yellow square, and each yellow square shares an edge with at least one red square. Colorings that can be obtained from one another by rotations and/or reflections are to be considered the same. How many different colorings are possible?
Show solution without answering
Key insight
Renaming colors red to blue, blue to yellow, yellow to red keeps every rule, so count only colorings with a red center and multiply by 3.
Solution
Write R, B, Y for the colors. The rules form a loop: R needs a B next to it, B needs a Y, and Y needs an R. "Next to" means sharing an edge.
Name the squares: the center; the four edge squares (top, right, bottom, left); and the four corners. A corner touches only two squares, both edge squares. For example, the top-right corner touches the top and right edge squares. Going around, top, right, bottom and left each share a corner with the next one; top and bottom do not share a corner.
Step 1: make the center red. Rename the colors R → B, B → Y, Y → R. The rule "R needs B" becomes "B needs Y", and so on, so a good coloring stays good. Rotations and flips never move the center, so they do not change its color. Renaming turns the red-center colorings into the blue-center ones, and again into the yellow-center ones, one for one. So
From now on the center is R.
Step 2: what each edge square needs. An edge square touches the center and two corners.
- A Y edge square needs an R: the center is R, so it is always fine.
- An R edge square needs a B. The center is R, so the B must be one of its corners. That B corner needs a Y next to it, and its only other neighbor is the next edge square around. So every R edge square shares a corner with a Y edge square.
- A B edge square needs a Y corner. That Y corner needs an R next to it, so every B edge square shares a corner with an R edge square.
- The center (R) needs a B, so at least one edge square is B.
Follow the chain: there is a B edge square, so there is an R one, so there is a Y one. The four edge squares use all three colors, with one color used twice.
Step 3: which edge patterns work? List the edge squares in order around the ring (top, right, bottom, left) and test the two rules from Step 2.
| Repeated color | Placed | Example ring | Problem? |
|---|---|---|---|
| R | opposite | R, B, R, Y | none: works |
| R | side by side | R, R, B, Y | the second R has no Y beside it |
| B | opposite | B, R, B, Y | R has no Y beside it |
| B | side by side | B, B, R, Y | the first B has no R beside it |
| Y | opposite | Y, R, Y, B | B has no R beside it |
| Y | side by side | Y, Y, B, R | none: works |
Only two edge patterns are possible.
Step 4: fill in the corners. A corner touches two edge squares, and it needs one of them to be "one step ahead" of its own color in the loop R → B → Y → R. That limits each corner to at most two colors.
Pattern 1: top R, right B, bottom R, left Y.
- Corners between R and B can be Y (served by R) or R (served by B). Corners between R and Y can be Y (served by R) or B (served by Y).
- The top square (R) needs a B corner. The top-right corner cannot be B, so the top-left is B. In the same way, the bottom-left is B.
- The right square (B) needs a Y corner: at least one of top-right and bottom-right is Y.
The right corners can be (Y, Y), (Y, R) or (R, Y). Flipping the grid top-to-bottom keeps the edge pattern and swaps (Y, R) with (R, Y), so those two are the same coloring. Two different colorings.
Pattern 2: top Y, right Y, bottom B, left R.
- The top-right corner sits between two Y's, so it must be B.
- The bottom square (B) needs a Y corner. The bottom-right corner (between Y and B) can only be B or R, so the bottom-left is Y.
- The left square (R) needs a B corner. The bottom-left is Y, so the top-left is B.
- The bottom-right corner can be B (it has a Y beside it) or R (it has a B beside it), and every square is already served either way.
No rotation or flip keeps this edge pattern (it would have to keep the single B and the single R in place), so the two choices are different. Two different colorings.
Step 5: total. With a red center there are different colorings. So the answer is .
The answer is .
Why this works
Two ideas do the work. First, the three colors play the same role (they form a loop), so fixing the center's color and multiplying by cuts the job to a third. Second, start with the squares that have the fewest neighbors: a corner touches only two squares, so it has very few choices, and that quickly forces the edge squares into just two patterns. When counting "the same up to rotations and flips", count patterns directly rather than dividing a total by , because symmetric colorings throw the division off.
Alternative approach
Count every coloring of the fixed grid and then group them. With a red center, Pattern 1 can be placed in ways (R's on top and bottom or on left and right, and B on either remaining side), each with corner fillings: . Pattern 2 can be placed in ways, each with fillings: . So colorings have a red center and in all. Grouping them: the Pattern 2 colorings fall into groups of ( groups), while the Pattern 1 colorings with (Y, Y) are each unchanged by a flip, so they form one group of , and the other form one group of . That is again groups per center color, and in total.
Concise solution
A shorter write-up, the way contest solutions are usually written. It may take a different route from the solution above.
Write red , blue , yellow , and read colours modulo . The three rules become a single rule:
> every square has a neighbour whose colour is one more than its own.
Name the cells: the centre ; the four edge cells ; and the four corners, each named by the two edge cells it sits between, so lies between and , and so on. A corner touches only two edge cells; the centre touches only the four edge cells.
Step 1: what a corner can do. Let a corner lie between edge cells of colours and . Its own colour needs a neighbour , and its only neighbours are those two edge cells, so
For that corner to be the neighbour required by the edge cell of colour , we would need . Since , this forces , that is . So:
> a corner can serve an edge cell only when the edge cell on the corner's other side is coloured one less than , and in that case the corner's colour is forced to be .
The centre serves an edge cell exactly when , and the centre itself needs some edge cell coloured .
Step 2: all three colours appear among . Suppose a colour appears on an edge cell while appears on none. By Step 1 no corner can serve those cells, so the centre must, giving ; then the centre needs an edge cell of colour .
- If the edge cells use only one colour , then is missing, so and a cell of colour is required — there is none.
- If they use exactly two colours and , then and cannot both hold (they would give ). So some used colour has missing, forcing and requiring an edge cell of colour , which is missing.
Both are impossible, so the four edge cells carry all three colours: one colour twice and the other two once each.
Step 3: the centre is forced. There are two shapes.
on opposite edge cells. Say ; then , and by reflecting the picture take , . Both cells flanking and both flanking are coloured . A corner serves only if , which is true; it serves only if , which is false. So must be served by the centre: . The centre then needs colour , supplied by .
on adjacent edge cells. Say , with and carrying the other two colours. A corner serves only if one of its flanking cells, or , equals , i.e. only if ; likewise a corner serves only if . Exactly one of equals , so exactly one of must fall to the centre — and either way . The centre then needs colour , which is present.
Step 4: filling in the corners. Take ; the other two values of simply relabel the colours.
Opposite case: , , , . The allowed corner colours from Step 1 are
- needs a : not , not , so . Similarly .
- needs a : the centre supplies it.
- needs a : so at least one of equals .
- needs a : supplies it.
Thus is , or : three colourings.
Adjacent case: , , , . The allowed corner colours are
- and are served by the centre, which is .
- needs a : only can be, so .
- needs a : only can be, so .
- is forced to ; needs a , supplied by .
- is free: either or .
Thus there are two colourings.
Step 5: dividing by the eight symmetries. Fix the repeated colour ; there are choices.
Adjacent case. The eight placements of the pattern (four rotations, then the mirror image ) form one orbit, and no non-identity symmetry fixes a placement: such a symmetry would have to fix the two edge cells carrying the unrepeated colours separately, and the only symmetry fixing other than the identity is the reflection in the line , which moves . So the colourings split into classes.
Opposite case. The four placements form one orbit, and each is fixed by exactly one non-identity symmetry: the reflection in the line , which swaps , hence and . That reflection fixes the completion and interchanges with , so the colourings split into classes.
Each choice of therefore gives classes, and
The answer is .
Review in the AoPS books
- Introduction to Counting & Probability, Chapter 2: Basic Counting Techniques (§2.5)
- Introduction to Counting & Probability, Chapter 1: Counting Is Arithmetic
- Introduction to Algebra, Chapter 22: Special Manipulations (§22.3)
- Introduction to Counting & Probability, Chapter 3: Correcting for Overcounting (§3.2, §3.4)
Similar problems
Problem © Mathematical Association of America (MAA), American Mathematics Competitions. Reproduced for non-commercial educational use. Solution and commentary are original to this site.