Problems & Puzzles: Puzzles

 

 

Problems & Puzzles: Puzzles

Puzzle 1277 Square grids and coprimes touching pairs

On July 19, 2026, Gioregos Kalogeropoulos wrote:

Reed Silverstein who is a member of "Recreational Maths & Math Puzzles" discord server gave me the permission to send you this original puzzle that he made:

The puzzle: arrange the numbers 1 through n^2 in an n×n grid to minimize how many touching pairs are coprime. Touching means sharing an edge (up/down/left/right) aka von neumann neighborhood. Here are optimal grids for 2×2 through 7×7, with minimums 3, 6, 6, 10, 11, 16...

Reading the picture: green line = coprime pair, dashed red = shared factor, shaded cells = evens.




Q1. Can you verify these results?
Q2. Can you extend the sequence?
Q3. Send your best result for a grid 100x100

 





From July 25 to Aug-1, 2026. contributions came from Paul Cleary, Michael Hürter, Giorgos Kalogeropoulos

But first of all taking the idea from one of the puzzler I will transform the solutions given by Reed Silverstein the following new way:

Instead of simply: 3, 6, 6, 10, 11, 16 I will add each as a quotient using in the denominator the quantity of the "von newman neighbour links", 2n*(n-1), as shown in the beautiful image that Silvestein produced...

3/4, 6/12, 6/24, 10/40, 11/60, 16/84, ... or 75%, 50%, 25%, 25%, 18%, 19%,... 

 
***
Paul wrote:

Q1. Couldn't get better scores but with mostly different configurations.

Q2.

8 X 8

grid8={{59,11,55,25,30,9,45,5},{1,22,10,20,15,27,21,35},{17,34,8,6,3,63,28,49},{51,54,44,16,60,33,42,7},{57,36,50,64,32,18,2,56},{19,38,12,14,48,40,24,52},{31,62,58,46,4,26,39,13},{47,37,29,23,41,53,43,61}};

Scores 18/112= 16%.

9 X 9

 grid9={{67,29,71,73,43,31,47,41,59},{26,58,30,57,18,62,44,22,11},{34,42,54,6,3,78,40,14,66},{17,51,72,2,12,8,28,7,77},{68,48,32,20,80,52,50,35,49},{74,38,56,4,64,10,55,25,70},{37,19,76,16,24,60,33,15,5},{1,79,46,36,27,21,81,45,65},{53,61,23,69,9,75,63,39,13}};

Score 24/144 = 16,7.

10 X 10

grid10={{97,85,5,45,36,74,37,79,73,67},{59,65,55,20,2,98,92,23,83,71},{19,95,25,100,26,4,12,46,52,13},{38,50,35,28,32,42,15,10,56,91},{16,76,84,40,30,3,60,6,63,70},{34,64,80,22,72,39,27,21,7,49},{17,68,8,66,81,9,78,96,14,77},{43,86,44,33,57,69,90,54,88,11},{53,62,18,75,99,48,58,94,82,61},{89,31,93,51,24,87,29,47,41,1}};

Score 26/180 = 14%.

11 X 11

grid11={{97,77,121,110,65,95,57,93,31,79,41},{107,11,55,25,5,40,24,36,62,8,82},{83,99,120,115,10,12,69,51,42,22,52},{37,111,48,90,108,45,39,21,117,26,13},{74,54,66,105,9,27,3,87,96,6,78},{100,72,70,35,15,33,81,30,32,18,64},{14,56,49,7,63,102,75,20,44,88,84},{58,104,28,91,119,17,85,50,98,16,38},{29,116,92,112,68,34,80,2,4,76,19},{113,103,23,46,106,94,60,114,86,118,1},{61,101,109,71,53,47,73,89,43,59,67}};

Score 32/220 = 14,5%.

12 X 12

grid12={{73,53,1,139,103,71,59,29,116,92,23,46},{127,106,68,2,26,142,118,58,4,80,115,50},{37,74,88,130,13,52,66,56,104,110,10,95},{111,144,14,35,91,143,121,22,12,128,120,76},{129,18,98,49,133,77,11,99,96,132,114,19},{43,86,28,119,7,63,33,51,93,75,36,38},{107,124,136,84,21,24,27,138,87,78,64,112},{137,31,62,102,57,135,9,15,81,60,108,8},{83,89,54,39,69,3,105,70,42,82,44,16},{109,41,123,45,117,90,65,25,40,32,6,30},{97,131,141,126,48,140,5,20,34,122,72,134},{79,101,47,94,100,125,55,85,17,61,113,67}};

Score 36/264 = 13.6%.


100 X 100

pu 1277 PC.txt

Score 2601/19800 = 13%


***
Michael wrote:
For Q3. I found the following solution:
Score 2075/19800 coprime = 10%

And he sent his 100x100 matix, that unfortuntely is too big to be shown here, so I will show here only the first line with 100 elements:

8171  1361  7237  1493  6221  7687  7079  4987  9109  4657  6451  2971  3517  1427  6089  4289  2467  4547  7703  1993  1559  1619  1447  1187  1811   797  1481  1723  1571  1933  1459  1567  4099  6257  8423  4339  5051  8291  2039  4967  4003  6151  9511  9343  3343  8269  8009  2437  7349  9293 7753  4639  7213  4091  4481  7591  9371  3307  7127  7853  1801  7309  3613  1823  4073  4133  1483  8629  1907  8263  3119  8669  8237  1741  7867 2017  4217  4259  5903  6229  4001  1471  5477  5531  6653  9587  4651  4591  6907  6971  6271  6427  8467  1181  6827  2441  5407  6287  8389  5927
...


99 more lineas


***
Giorgos wrote:

Q1: I got the same results
Q2: The best values for a(8) to a(16) that I got are: 18, 24, 25, 32, 34, 40, 46, 48, 56
8->18->
 61 47 29 31 23 43 53 41
59 1 58 62 46 34 17 37
49 7 56 16 28 36 51 9
21 35 63 14 54 44 30 39
3 15 6 12 32 2 52 13
27 24 40 64 8 22 20 26
33 45 25 60 48 4 42 38
11 55 5 10 50 18 57 19
9->24-> 
61 29 58 2 32 6 78 13 71
47 37 74 26 64 50 40 65 80
73 17 34 16 48 10 55 70 25
53 68 4 38 20 44 22 60 5
31 62 30 52 42 28 12 14 35
67 46 36 39 18 8 56 49 7
41 23 69 75 15 54 63 21 77
43 1 57 24 9 51 27 66 11
79 59 19 76 72 81 45 3 33
10->25->
 73 61 29 87 99 77 11 88 98 7
23 92 58 48 27 33 44 42 49 21
46 14 66 3 81 9 12 69 63 91
84 40 55 75 72 45 90 78 39 13
34 30 35 95 15 18 20 28 52 26
17 51 85 5 65 10 56 2 38 4
68 60 25 100 80 64 16 24 57 96
62 6 70 8 54 50 22 76 19 59
31 93 36 74 94 86 32 82 79 1
53 71 67 37 47 43 83 41 97 89
11->32-> 
67 37 111 75 15 20 32 56 94 47 89
61 74 102 110 5 40 96 84 42 79 107
41 82 24 12 10 66 51 27 33 11 121
59 118 108 54 45 69 9 3 63 77 44
113 76 8 26 65 30 81 57 6 98 28
101 19 38 90 25 120 87 78 72 18 62
103 114 50 95 55 99 39 13 117 93 31
43 86 70 105 60 88 48 104 91 21 97
53 106 22 112 4 52 2 14 49 7 71
1 116 80 36 34 16 46 100 35 119 73
109 29 58 64 68 92 23 115 85 17 83
12-> 34-> 
131 67 61 53 59 97 71 113 137 139 83 109
103 134 122 106 118 2 142 116 29 58 52 1
41 82 16 34 136 104 14 126 87 90 76 19
123 72 102 17 68 56 49 133 105 25 30 95
48 9 96 51 119 7 112 35 115 125 135 40
120 81 15 39 91 70 28 80 50 85 5 130
129 66 93 45 21 75 20 4 44 55 65 13
43 86 6 54 57 36 64 22 77 11 143 78
127 42 27 99 18 10 32 38 132 121 88 144
73 74 24 117 63 108 114 98 46 110 84 140
79 37 111 141 60 33 3 138 26 8 128 62
101 107 89 47 94 12 69 23 92 100 124 31
13->40-> 
113 1 53 159 147 7 133 19 152 94 47 103 157
127 97 106 138 63 49 35 95 100 150 141 129 43
89 29 116 114 33 21 120 85 125 25 75 66 86
55 145 90 123 15 99 9 105 60 155 50 54 112
11 165 153 27 144 3 168 28 80 5 20 84 161
121 77 132 57 81 87 102 119 70 140 42 46 23
143 91 39 69 135 51 17 68 104 32 22 92 115
169 13 156 96 110 126 136 48 34 98 130 108 45
117 65 30 128 52 58 2 88 26 40 160 18 111
93 78 16 4 44 14 62 10 72 8 64 74 37
31 124 164 56 6 148 76 12 162 24 154 118 59
131 151 41 82 146 142 122 158 36 166 38 134 67
137 163 139 107 73 71 61 79 167 83 101 149 109
14-> 46-> 
109 173 131 181 79 73 1 97 127 71 83 139 103 163
193 53 159 96 158 146 74 194 44 142 166 134 67 191
167 106 108 128 162 116 8 70 186 176 16 188 47 113
41 82 2 34 120 98 136 24 130 32 90 152 94 107
164 10 14 88 104 91 28 184 170 156 87 42 86 43
80 18 126 22 84 35 196 140 6 174 29 58 102 172
124 110 33 144 147 49 7 161 63 60 145 20 40 148
31 155 15 123 105 112 56 133 171 180 150 5 185 37
62 93 135 75 36 54 38 19 190 55 85 160 195 111
4 72 141 12 129 3 132 76 95 25 165 100 192 183
138 48 81 168 51 153 78 64 30 125 65 50 122 61
23 69 189 119 17 68 92 26 182 175 115 46 178 89
157 179 99 77 187 154 52 13 39 21 45 114 118 151
101 149 66 121 11 143 169 117 57 27 9 177 59 137
15-> 48-> 
157 137 127 167 197 37 222 87 29 203 133 19 114 146 73
113 163 71 142 46 74 168 57 174 147 224 76 44 132 219
179 191 213 138 23 184 128 6 111 102 4 176 11 187 153
199 47 141 42 161 112 14 22 120 68 220 209 198 51 17
193 94 188 182 98 7 49 56 160 180 154 121 33 117 221
43 172 48 186 30 175 119 140 115 95 150 55 143 169 13
129 162 99 204 159 21 77 165 80 215 145 105 65 208 91
201 78 81 189 69 75 35 85 205 5 185 15 125 210 217
67 134 126 9 27 45 155 225 50 25 110 70 200 124 31
79 158 170 135 39 123 93 72 8 100 40 86 28 90 62
89 178 192 171 3 63 96 64 136 38 144 66 2 52 148
103 206 104 195 207 12 32 26 34 88 16 196 108 216 92
83 166 106 20 36 116 58 10 152 190 60 130 54 18 164
223 1 53 212 218 118 156 24 122 194 84 214 202 82 41
151 181 149 131 109 59 177 183 61 97 211 107 101 173 139
16->56->
167 251 229 233 59 236 242 184 23 115 15 220 172 94 47 223
1 179 67 201 177 162 70 132 253 165 175 225 250 76 188 137
239 173 134 210 36 126 7 63 161 147 90 25 145 20 146 73
191 83 166 204 3 114 14 49 28 168 35 45 5 30 180 219
181 249 18 189 81 192 80 56 10 96 190 95 100 228 87 111
71 213 243 75 39 104 128 136 182 152 19 209 154 32 222 37
199 57 141 171 174 66 216 26 13 247 133 77 203 42 200 74
193 129 105 150 9 93 207 117 169 91 119 252 196 24 34 58
241 43 215 55 99 51 21 102 221 65 245 60 92 62 232 29
197 86 110 11 121 187 238 17 85 235 185 120 124 164 256 116
109 218 12 176 88 33 78 255 125 170 240 38 72 224 144 106
113 226 98 82 130 198 143 231 195 138 160 22 142 50 212 53
127 254 40 208 2 46 52 54 69 135 230 4 8 118 194 97
89 178 44 112 64 6 156 27 48 153 108 244 16 148 206 103
227 68 248 217 140 246 159 84 158 234 183 61 122 202 214 163
131 186 31 155 205 41 123 237 79 211 149 151 139 101 107 157

Q3: a(100) <= 2103/19800 = 10.6%
see the attached file which includes the matrix as a list of 10.000 terms

***
N,b by Carlos Rivera

All the before results can be condensed in the following Table:

Quantity of von Newman coprime neighbour links
n Paul C. Giorgo K Michael H Reed S
2 --- --- --- 3
3 --- --- --- 6
4 --- --- --- 6
5 --- --- --- 10
6 --- --- --- 11
7 --- --- --- 16
8 18 18 --- ---
9 24 24 --- ---
10 26 25 --- ---
11 32 32 --- ---
12 36 34 --- ---
13 --- 40 --- ---
14 --- 46 --- ---
15 --- 48 --- ---
16 --- 56 --- ---
100 2601 2103 2075 ---


***

Records   |  Conjectures  |  Problems  |  Puzzles