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 have a set of numbers from $0$ to $2^7$. I need to arrange these numbers in a matrix where each number is surrounded by a different arrangement of numbers. So basically, I need to obtain as many permutations as I can for each number with respect to the adjacent elements which of which I am using $4$ (out of the $8$ that surround each number). But, I also need all of these numbers to form 1 matrix, which might be the difficult part here.

Is this possible? How can I calculate the number of permutations that I can obtain for each number?

share|cite|improve this question

Your Answer


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

Browse other questions tagged or ask your own question.