As each 5-square section (a cell and its four neighbors) must have five colors, there must be at least that many. That this is possible is shown by the diagram below for the red in each row, with all five colors in each row rotated left two positions as well.
To place the bottom red square where it is, each row of five colors has been shifted as a whole two positions to the left of the preceding and wrapping around cyclically.
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
From Enigma No. 1661, "Latin art", by Bob Walker, New Scientist 27 August 2011, page 30. |