If I understand correctly, you start with any pandiagonal square (easy to constuct, e.g. with all numbers equal) and while keeping pandiagonality intact, change terms (N at a time) to arrive at distinct prime terms.
Jarekлукавите насчёт квадрата, состоящего из одинаковых чисел (если я правильно поняла перевод)?
Если мы возьмём пандиагональный квадрат, составленный из одинаковых чисел, то любое прибавление/вычитание одного и того же числа над элементами одной группы этого квадрата будет давать одинаковые числа в этой группе.
I think
Pavlovsky already explained this issue. Note that that is exactly the way one can construct, in case of prime
![$N>3$ $N>3$](https://dxdy-04.korotkov.co.uk/f/7/4/b/74b354694d6e338e93914ac45bd990a382.png)
, pandiagonal square with consecutive integer entries:
Start with the pandiagonal square having all
![$N^2$ $N^2$](https://dxdy-01.korotkov.co.uk/f/4/c/8/4c87ee198ded31321f89b44a38a0ad5a82.png)
terms equal to 0. Note that there are N groups of entries with N entries in each group - with no two entries of one group placed on the same line (row, column or broken diagonal). Add 1 to the first group, 2 to the second group, ..., N to N-th group. Then consider ANOTHER such split of terms of the square into N groups and add respectively 0,
![$N$ $N$](https://dxdy-04.korotkov.co.uk/f/f/9/c/f9c4988898e7f532b9f826a75014ed3c82.png)
,
![$2\cdot N$ $2\cdot N$](https://dxdy-02.korotkov.co.uk/f/d/9/6/d9648726c939e13a0592946ed013551582.png)
, ...,
![$(N-1)\cdot N$ $(N-1)\cdot N$](https://dxdy-02.korotkov.co.uk/f/1/e/4/1e4774881f301669d14764620a66eef182.png)
to those groups. Then you arrive at a pandiagonal square composed of the consecutive integers ranging from 1 to
![$N^2$ $N^2$](https://dxdy-01.korotkov.co.uk/f/4/c/8/4c87ee198ded31321f89b44a38a0ad5a82.png)
.
Whether we start the search with a square having all entries equal or with another pandiagonal square is not essential. I gave example of pandiagonal square with all entries equal as the starting square only to show that constructing initial pandiagonal square is not a difficult problem.
In case of prime N, we have
![$(N-3)\cdot N$ $(N-3)\cdot N$](https://dxdy-04.korotkov.co.uk/f/3/d/3/3d337b0ed8699e4541d288fad7f922ab82.png)
groups of terms, each group having N terms placed on distinct lines. There are 3 problems with that:
1. Number of groups is relatively small.
2. Number of terms in one group is relatively large. For example, for
![$N=17$ $N=17$](https://dxdy-03.korotkov.co.uk/f/e/a/b/eab6d84a2db2c8832e17c6486a40bb9182.png)
each group has 17 terms - it is rather hard to force 17 numbers to be prime at the same time.
3. There is no simple way of applying this method to composite N.