Each of the 25 cells in a five-by-five grid of squares is filled with a 0, 1, or 2 in such a way that the numbers written in neighboring cells differ from the number in that cell by 1. Two cells are considered neighbors if they share a side. How many different arrangements are possible?


closed as off-topic by Silvia Ghinassi, Shailesh, user91500, user296602, Claude Leibovici Mar 10 '16 at 5:50

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question is missing context or other details: Please improve the question by providing additional context, which ideally includes your thoughts on the problem and any attempts you have made to solve it. This information helps others identify where you have difficulties and helps them write answers appropriate to your experience level." – Silvia Ghinassi, Shailesh, user91500, Community, Claude Leibovici
If this question can be reworded to fit the rules in the help center, please edit the question.


Even and odd numbers must alternate, so we can checker the grid odd and even and put $1$s on the odd squares and arbitrary even numbers on the even squares.

If we make $12$ squares odd and $13$ even, that yields $2^{13}$ possibilities, and if we make $13$ squares odd and $12$ even, that yields another $2^{12}$ possibilities, for a total of $2^{12}+2^{13}=3\cdot2^{12}=12288$.


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