The standard cube painting question asks how many unit cubes in an n × n × n grid have a given number of painted faces, and the answer is found by separating positions into four disjoint classes — 8 corners, 12(n − 2) edge-interior cubes, 6(n − 2)² face-interior cubes, and (n − 2)³ unpainted core cubes — with the "any painted face" count equal to n³ − (n − 2)³. Every painted-cube counting problem reduces to choosing the right class and writing the matching expression, so the same method handles questions about three painted faces, two painted faces, exactly one painted face, no painted face, or at least one painted face. Because the four classes partition all n³ unit cubes, summing them always recovers the total, which is the fastest way to check an answer before submitting. The setup is also fixed across all questions: every outside face of one large cube is painted, then the cube is sliced into equal unit cubes, so the only thing that changes between problems is the grid size n and which position class the prompt asks about. Once those two pieces are known, the answer is a one-line formula, not a guess.

The Position-Class Method for Counting Painted Cubes
The reason the formulas work is that a painted face can only touch a unit cube through one of three places: a corner of the large cube, an edge (but not a corner) of the large cube, or the interior of a face (but not on any edge). Those three places are mutually exclusive, and every cube outside the hidden core falls into exactly one of them. The hidden core — the small cube of side n − 2 left after peeling away one unit-thick layer on every side — touches no paint at all. Because the four classes do not overlap and together they account for every one of the n³ unit cubes, arithmetic on them stays consistent no matter how big n gets.
Classification is what prevents the most common error in a cube painting question. People who count "edges" and "corners" together tend to count the eight corner positions twice, which inflates the answer. People who forget to subtract the corners from the edge count end up with 12n instead of 12(n − 2). People who treat "exactly one painted face" as "any painted face" include edge cubes by mistake. Writing the four classes separately, in the same order, on a mental worksheet removes all three errors at once and keeps the answer ready for any wording the prompt uses.
The Four Disjoint Position Classes
Once n is known, each class has a closed-form expression:
| Position class | Painted faces | Count |
|---|---|---|
| Corners of the large cube | 3 | 8 |
| Edge interiors (not corners) | 2 | 12(n − 2) |
| Face interiors (not on any edge) | 1 | 6(n − 2)² |
| Hidden core | 0 | (n − 2)³ |
| At least one painted face | 1, 2, or 3 | n³ − (n − 2)³ |
The first four rows partition the cube. The last row combines the painted classes and is also equal to the total minus the hidden core, which gives a quick cross-check. For n = 2 the edge-interior and face-interior rows both evaluate to zero, because a 2 × 2 × 2 cut leaves only eight corners and no interior layer, which is a useful sanity check before trusting a calculation.
Two phrasings in a cube painting question change which row applies. "Exactly one painted face" means the face-interior row only and excludes every corner and edge cube. "At least one painted face" means every painted class, so it equals the sum of the first three rows or, equivalently, n³ − (n − 2)³. Reading the prompt carefully is the difference between 6(n − 2)² and n³ − (n − 2)³ for the same n.
Worked Example: A 4 × 4 × 4 Cut Cube
A common version of the cube painting question uses a 4 × 4 × 4 cut, which produces 64 unit cubes. Substituting n = 4 into each formula gives:
- Corners: 8
- Edge-interior cubes: 12(4 − 2) = 12 × 2 = 24
- Face-interior cubes: 6(4 − 2)² = 6 × 4 = 24
- Unpainted core: (4 − 2)³ = 8
- Any painted face: 4³ − (4 − 2)³ = 64 − 8 = 56
The four classes sum to 8 + 24 + 24 + 8 = 64, which matches the total number of unit cubes. The "any painted" count also equals 8 + 24 + 24 = 56, so both routes agree. This is the same distribution that Math Is Fun publishes for a 4 × 4 × 4 cut cube, and it is the pattern every other painted-cube question follows.
For a larger cut such as an 8 × 8 × 8, the edge and face counts dominate while the corner count stays at 8, which is why n has to be read off the prompt every time rather than memorized.
Solving the Five Questions in Painted Cube Puzzle
Painted Cube Puzzle takes the position-class method above and turns it into a five-round practice game. Each round asks for the count of one specific class on an n × n × n cut cube, and the four multiple-choice answers are arranged in a two-by-two grid that you can move through with the arrow keys, Tab, Enter, or Space, or by tapping on a phone. Touch, pointer, and keyboard input all behave the same way, so the same procedure works on any device.
- Read the grid size in the prompt and identify which position class the question asks about: corner, edge-interior, face-interior, core, or any painted face.
- Substitute n into the matching formula on a mental worksheet. Write only the factors that belong to that class so the corner count of 8 does not bleed into the edge count.
- Check the wording. If the prompt says "exactly one painted face," use 6(n − 2)². If it says "at least one painted face," use n³ − (n − 2)³ instead.
- Compare your result against the four options on screen, then move to that option with the arrow keys and confirm with Enter or Space, or simply tap the option.
- Repeat for the remaining rounds. Each correct answer adds 200 points, and the puzzle ends after five rounds, a Restart, or a deadlock.
The puzzle is deterministic, so the same five questions appear on every run. That turns it into a method drill rather than a guessing exercise: once the formulas are memorized, every restart is a chance to sharpen the classification step before the arithmetic.
How Scoring, Mistakes, and Restart Work
Each round in Painted Cube Puzzle is worth exactly 200 points, and five correct rounds produce the exact maximum score of 1,000. The puzzle handles errors in a way that rewards reading carefully without punishing an accidental double tap. Your first distinct wrong option on a round can be replaced by a different option, and only that first distinct mistake counts against you. Repeating the same wrong option on the same round does not consume a second mistake, so an accidental double click will not end a run on its own.
A second distinct wrong option, however, locks the run. Once locked, score and progress stay where they are and no further changes are accepted. The Restart control resets the puzzle completely and starts the five fixed questions over from the beginning. Because the rounds are fixed, a second run is a chance to apply the position-class method more cleanly, not a hope for easier numbers.
Where the Position-Class Formulas Come From
The corner, edge-interior, face-interior, and core expressions are not invented for the quiz. The position-class framework and worked tables for several cube sizes are documented by NRICH at the University of Cambridge. The same expressions appear in the Snow College Mathematics Contest answer key for the standard painted-cube question, and Math Is Fun publishes a worked distribution for the 4 × 4 × 4 cut cube that matches the four-class partition exactly. Automated checks in Painted Cube Puzzle also verify conservation of the partition for n from 2 through 20, confirm that every round has exactly one correct option, and lock scoring, repairs, deduplication, deadlock, Restart, cursor boundaries, and terminal immutability against regressions.
For readers who also enjoy unpacking three-dimensional stacks, the same habit of separating visible from hidden cubes applies to counting blocks puzzles with hidden cubes, where columns must be reconstructed before totals are trusted. The classification-first habit transfers directly from a cube painting question to any puzzle where some pieces sit behind others.