Problems & Puzzles: Collection 20th

Coll.20th-003. Primeful Heterosquares

On March 12, 2018, Dmitry Kamenetsky posed the following puzzle:

Place distinct positive integers on a NxN grid, such that their sum is minimal and:

1. The sums of all rows, all Columns and two main diagonals are distinct primes

or

2. The sums of all rows, all Columns and all broken diagonals (diagonals that wrap around) are distinct primes

Examples sent by Dmitry:

1. TWO DIAGONALS
 
N=3, score=57
8 5 4 
7 3 1 
16 11 2 
Unique primes: 7 11 13 17 19 23 29 31
2. ALL DIAGONALS
 
N=3, score=129
13 5 49 
7 27 9 
3 15 1 
Unique primes: 13 17 19 23 37 41 43 47 59 67 71 79
 
Q. Sent your minimal solutions for K>3 as large as you can.

 

Contributions came from Claudio Meller, Michael Hürter, Emmanuel Vantieghem and Dmitry Kamenetski.

***

Claudio sent two solutions for N=4:

 

***

Michael wrote:

Q1.
 
For k > 3, 1 .. k^2 can be placed and the minimal score is k^2/2*(k^2+1).
 
k = 4, score = 136
15 16 10 12
6 8 1 2
7 5 3 4
13 14 9 11
Unique primes: 53 17 19 47 41 43 23 29 37 31
 
k = 5, score = 325
18 25 16 20 4
23 15 10 19 12
13 24 17 21 14
9 11 3 6 2
8 22 7 1 5
Unique primes: 83 79 89 31 43 71 97 53 67 37 61 59
 
k = 7, score = 1225
27 5 29 34 45 9 44
35 20 16 10 46 33 31
19 6 14 32 30 12 38
39 22 26 15 36 48 47
18 13 25 21 23 8 49
41 24 28 42 40 17 37
2 7 1 43 3 4 11
Unique primes: 193 191 151 233 157 229 71 181 97 139 197 223 131 257 127 173
 
For k = 100, my program runs few minutes.
 
Q2.
 
k = 4, score = 234
2 18 7 16
32 14 12 43
3 15 10 39
4 6 8 5
Unique primes: 43 101 67 23 41 53 37 103 47 61 97 29 31 71 59 73
 
k = 5, score = 525
12 37 3 46 5
4 13 7 9 28
24 20 11 39 33
30 47 2 41 17
1 32 36 22 6
Unique primes: 103 61 127 137 97 71 149 59 157 89 73 113 151 79 109 83 53 181 107 101

***

Emmanuel wrote:

4x4, two diagonals :
   13, 14, 3,  17
   20,  6,  5,  12
   18,  7,  1,  15
    8,   4,  2,   9
Sum : 154
Unique primes : 11, 23, 29, 31, 37, 41, 43, 47, 53, 59

 
4x4, all diagonals :
   1,  2,   3,   5
  26, 12, 17, 6
  25, 14,  9, 23
  37, 15,  8,  7 
Sum : 210
Unique primes : 11, 29, 31, 37, 41, 43, 47, 49, 53, 59, 61, 67, 71, 73, 79, 89

 
5x5, two diagonals
   1, 2, 3, 4, 7
   5, 6, 8, 9, 13
   12, 16, 11, 18, 26
   30, 19, 14, 10, 28
   25, 24, 23, 20, 15
Sum : 349
Unique primes : 17, 41, 43, 59, 61, 67, 71, 73, 83, 89, 101, 107

 
5x5, all diagonals
   1, 2, 3, 4, 7
   5, 6, 8, 9, 13
   12, 10, 17, 37, 55
   15, 20, 11, 53, 28
   14, 21, 22, 4, 36
Sum : 413
Unique primes :17, 37, 41, 47, 53, 59, 61, 67, 71, 73, 83, 89, 97, 103, 107, 113, 127, 131, 137, 139

***

Dmitry sent the following solutions:

For Q1: N=4 to 9

For Q2: N=4 to 13, except N=6 and 10.

I will show today only the solutions for N=4 because we do not want to spoil the work that other puzzlers could be making.

Question 1:
 
N=4, sum=136
12 14 11 16 
10 13 9 15 
3 8 1 7 
4 6 2 5 
Unique primes: 17 19 23 29 31 37 41 43 47 53
 

Question 2:
 

N=4, sum=178
4 19 8 16 
15 7 17 2 
3 11 1 14 
9 6 41 5 
Unique primes: 13 17 19 23 29 31 37 41 43 47 53 59 61 67 83 89

***


Records   |  Conjectures  |  Problems  |  Puzzles