Question 382148
You use 6*(n-2)^2 because we want to count the number of cubes that are in the "middle" of each face (i.e. all of the cubes not on an edge or vertex) which would be (x-2)^2 for a sufficiently large n. There are 6 faces, so we multiply by 6.