Consider the sequence of 9 non zero distinct digits arranged in a 3 by 3 grid , like
547
398
162
Clearly there are 9! (=362880) ways to do it.
If we demand that the consecutive numbers are next-door neighbours
( horizontally or vertically) like
167
258
349
then the number is significantly lower, say N.
Find N & provide your reasoning.
Color the grid chessboard-wise with the upper left black, each move horizontally or vertically changes color and parity<br>
Since 123….89 consists of 5 odd and 4 even digits one must start and end on black square, I.e, either one of the 4 corners or the Center.
There are 5 possible beginnings and correspondingly 4 endings.
Since due to 90 degrees symmetry there are 2 possible choices of routes there are all in all 5*4*2= 40 Ways!
It seems very easy , like d1, but it took considerably long time to simplify it to chessboard model of parity.
Edited on November 5, 2022, 1:58 am