# Arrange numbers to 5 x 5 table, with some constraints

Arrange numbers 1 to 25 to each cell, so :

• Difference between 2 adjacent numbers (horizontally and vertically) is bigger than 1 and smaller than 6
• The bigger-smaller sign is correct between 2 adjacent numbers.

  4 >  2 <  5 >  1 <  3
^    ^    ^    ^    ^
9 >  7 < 10 >  6 <  8
^    ^    ^    ^    ^
14 > 12 < 15 > 11 < 13
^    ^    ^    ^    ^
19 > 17 < 20 > 16 < 18
^    ^    ^    ^    ^
24 > 22 < 25 > 21 < 23

Reasoning:

the lower rows numbers are bigger that the upper rows for each column.
This means we can split the numbers in groups of 5 like this:
(1,2,3,4,5) goes on the first row, (6,7,8,9,10) go on the second row and so on. and on each column row[i] = row[i-1] + 5.
We just need to find a way to match the columns to the signs.
Most probably we can permute the columns 2 & 4 and 1 & 5 (both permutations at once).

• columns 2 and 4 cannot be permuted without 1 and 5 permuted as well, because then number 2 would be adjacent to number 3, which is not allowed – elias Aug 23 '16 at 8:18
• @elias. That's what I meant. I thought that and would clear it. Apparently I need to change this. – Marius Aug 23 '16 at 8:19
• oh, sorry. maybe it was just my misinterpretation – elias Aug 23 '16 at 8:19

Besides the solutions listed in @JamalSenjaya's answer, I think

  4  2  5  1  3
9  7 10  6  8
14 12 15 11 13
19 17 20 16 18
24 22 25 21 23

,

  4  2  5  3  1
9  7 10  8  6
14 12 15 13 11
19 17 20 18 16
24 22 25 23 21

,

  5  2  4  1  3
10  7  9  6  8
15 12 14 11 13
20 17 19 16 18
25 22 24 21 23

and

their mirrorings around a vertical axis.

are

six correct solutions.

• There is 2 more correct answer. – Jamal Senjaya Aug 23 '16 at 9:50

These 2 are the last another correct answers

  3  1  4  2  6
8  5  9  7 11
13 10 14 12 16
18 15 19 17 21
23 20 24 22 25

and it's mirror arround vertical axis

  6  2  4  1  3
11  7  9  5  8
16 12 14 10 13
21 17 19 15 18
25 22 24 20 23