Beside the standard $3\times3\times3$ Rubik’s cube, there are other cubes where each side is divided into $n$ pieces ($n = 3$ for the standard Rubik’s cube). Ignoring the colors, the small squares on each surface of a Rubik’s cube may be combined to form larger rectangular shapes. For an $n\times n\times n$ Rubik’s cube, compute the total number of different rectangles (including squares) that can be obtained this way. For the $2 \times 2 \times 2$ cube, the answer should be $54$.
My solution: I tried to induce my answer from the fact that every cube has 6 faces, so in a $2 \times 2 \times 2$ cube, one face has $4$ squares, so we can get $4$ rectangles, and since $6$ such faces $6 \times 4=24$ and now we convert it with the bigger squares which form a rectangle, but I am not sure how to convert my answer into a formula for $n \times n \times n$ Rubik's cube.
Every rectangle occupies only one face and the faces are equal, so the answer is $6$ times the number of rectangles on a face. Such a rectangle is specified by a choice of two horizontal lines and two vertical lines out of a pool of $n+1$ for each, so the final answer is $6\binom{n+1}2^2=\frac32n^2(n+1)^2$.