Problems & Puzzles: Puzzles

Puzzle 177. Primes in a square (*)

Here we will ask you to distribute the first nxn integers (from 1 to nxn) in a square nxn such that:

• Every integer is used only once
• The sum of every two contiguous (vertical and horizontal) numbers is a prime

Example for n=4:

 9 14 5 12 8 3 2 11 15 16 1 6 4 13 10 7

I believe that the strategy that I have used to generate at least one solution for squares from n=4 to 28 is valid in general for any n>3.

Questions:

1.  Find the strategy in order to make that kind of assignations.
2. Find a solution for n=30x30
3. Explain why there is not any solution for n=3.

_________
* In the puzzle 120 we asked the same but not general strategy was reported then. Now at least I have one supposed general strategy.

Solution

I shared my strategy with Jud McCranie in order him to confirm if it this strategy continues giving solutions for n>28. Jud made the corresponding code for it and calculated solutions for every n up to 74. On my request he also printed to a .txt file the solution for n=80.

***

 Records   |  Conjectures  |  Problems  |  Puzzles