Suppose n3 little cubes have been assembled into one large cube. Find a formula for the maximum number of little cubes that can be seen from a single location.
Three faces of the big cube are the most that can be seen at any one time. We might be tempted to answer a quick 3n2, but then we remember that we can’t count the edge cubes twice.
Total small ones:
n2 + n(n – 1) + (n – 1)2
= n2 + n2 – n + n2 – 2n + 1
= 3n2 – 3n + 1.
We see that we can take our quick answer of 3n2 and subtract 3n (the three edges we counted twice) and then add back 1 (the vertex cube we counted 3 times and subtracted 3 times, so we have to put back in once).