Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to figure out how many ways are there to stack N cubes on top of each other.

Once you get a particular stack of 4 cubes let's say, the order of the cubes doesn't matter, just which sides are being shown does.

I'm generally finding 2 numbers:

1.) 6 * 24^(n-1)


2.) 3 * 24^(n-1)

Which is the correct answer, and why?

To understand the question better, you can refer to the Instant Insanity puzzle:

share|cite|improve this question
What does "stacking cubes" mean here? It's not clear. – Robin Chapman Oct 7 '10 at 9:57
Think of each cube with a different number on each side. So how many different possible stackings are there, one cube on top of the other. – Sev Oct 7 '10 at 10:00
I've also edited the question to include a link to the original puzzle: and also the same link here - – Sev Oct 7 '10 at 10:01
I LOVED this game when I was little. You have sufficiently allured me to buy a copy for my office. I had kinda forgotten it existed. :) – BBischof Oct 8 '10 at 2:15
up vote 2 down vote accepted

Your solutions presuppose that the cubes are identical; this is not the case in Instant Insanity. If they are all distinguishable you are missing a factor of $N!$.

The smaller possible solution is valid under the assumption that a stack is regarded as identical with that stack produced by turning the original stack upside down. The larger solution regards these two stacks as different.

share|cite|improve this answer
Thank you. Just a comment about the factor of N! I stated above that the order of the cubes don't matter. – Sev Oct 7 '10 at 15:57

I would say 6*24(n-1). The first cube can be placed in 6 ways, just choosing the top face. Then you select one side as the front. The second cube can then be placed in 24 ways as you choose the top and then which one will be front. Each successive cube has 24 ways to be placed. So you multiply all these numbers.

Another way to look at it is that each cube has 24 possibilities, but they fall into groups of four by rotating the whole stack.

share|cite|improve this answer

I suspect that the Wikipedia article's number of $41,472 = 24^4 / 8$ arrangements of the four cubes comes from the idea that each of the four cubes can have 24 orientations. However, the whole stack can be rotated into any of four positions, removing a factor of 4 without altering the four visible side face patterns.

In addition, the whole stack can be turned upside down (or equivalently, since order does not matter, each cube can be turned upside down) without altering the four visible face patterns, just whether you encounter them clockwise or anti-clockwise. That removes a further factor of 2.

So Wikipedia uses your $3 \times 24^{n-1}$ answer.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.