### Shift method (1)

The 21x21 magic square is odd but also a multiple of 3. You can use the shift method to construct a 21x21 magic square but with boundary conditions. Take as first row of the first and/or second grid 0-1-2-3-4-5-6-7- 8-9-10-11-12-13-14-15-16-17-18-19-20-21and you get only a semi-magic 21x21 square. Take as first row of the first and/or second grid 0-2-1-3-4-5-8-7-6-11-10-9-13-12-14 and you get a panmagic 21x21 square.

The row 0-2-1-4-3-5-8-7-6-9-10-11-13-12-14-17-16-15-19-20-18 leads to a valid 21x21 panmagic square, because [yellow marked] 0+4+8+9+13+17+19 = [blue marked] 2+3+7+10+12+16+20 = [pink marked] 1+5+6+11+14+15+18 = 70, that is 1/3 of (0+1+2+3+4+5+6+7+8 +9+10+11+12+13+14+ 15+16+17+18+19+20=) 210.

Take 1x number from first grid (shift 2 to the left) +1

 0 2 1 4 3 5 8 7 6 9 10 11 13 12 14 17 16 15 19 20 18 1 4 3 5 8 7 6 9 10 11 13 12 14 17 16 15 19 20 18 0 2 3 5 8 7 6 9 10 11 13 12 14 17 16 15 19 20 18 0 2 1 4 8 7 6 9 10 11 13 12 14 17 16 15 19 20 18 0 2 1 4 3 5 6 9 10 11 13 12 14 17 16 15 19 20 18 0 2 1 4 3 5 8 7 10 11 13 12 14 17 16 15 19 20 18 0 2 1 4 3 5 8 7 6 9 13 12 14 17 16 15 19 20 18 0 2 1 4 3 5 8 7 6 9 10 11 14 17 16 15 19 20 18 0 2 1 4 3 5 8 7 6 9 10 11 13 12 16 15 19 20 18 0 2 1 4 3 5 8 7 6 9 10 11 13 12 14 17 19 20 18 0 2 1 4 3 5 8 7 6 9 10 11 13 12 14 17 16 15 18 0 2 1 4 3 5 8 7 6 9 10 11 13 12 14 17 16 15 19 20 2 1 4 3 5 8 7 6 9 10 11 13 12 14 17 16 15 19 20 18 0 4 3 5 8 7 6 9 10 11 13 12 14 17 16 15 19 20 18 0 2 1 5 8 7 6 9 10 11 13 12 14 17 16 15 19 20 18 0 2 1 4 3 7 6 9 10 11 13 12 14 17 16 15 19 20 18 0 2 1 4 3 5 8 9 10 11 13 12 14 17 16 15 19 20 18 0 2 1 4 3 5 8 7 6 11 13 12 14 17 16 15 19 20 18 0 2 1 4 3 5 8 7 6 9 10 12 14 17 16 15 19 20 18 0 2 1 4 3 5 8 7 6 9 10 11 13 17 16 15 19 20 18 0 2 1 4 3 5 8 7 6 9 10 11 13 12 14 15 19 20 18 0 2 1 4 3 5 8 7 6 9 10 11 13 12 14 17 16 20 18 0 2 1 4 3 5 8 7 6 9 10 11 13 12 14 17 16 15 19

+ 21x number from second grid (shift 2 to the right)

 0 2 1 4 3 5 8 7 6 9 10 11 13 12 14 17 16 15 19 20 18 20 18 0 2 1 4 3 5 8 7 6 9 10 11 13 12 14 17 16 15 19 15 19 20 18 0 2 1 4 3 5 8 7 6 9 10 11 13 12 14 17 16 17 16 15 19 20 18 0 2 1 4 3 5 8 7 6 9 10 11 13 12 14 12 14 17 16 15 19 20 18 0 2 1 4 3 5 8 7 6 9 10 11 13 11 13 12 14 17 16 15 19 20 18 0 2 1 4 3 5 8 7 6 9 10 9 10 11 13 12 14 17 16 15 19 20 18 0 2 1 4 3 5 8 7 6 7 6 9 10 11 13 12 14 17 16 15 19 20 18 0 2 1 4 3 5 8 5 8 7 6 9 10 11 13 12 14 17 16 15 19 20 18 0 2 1 4 3 4 3 5 8 7 6 9 10 11 13 12 14 17 16 15 19 20 18 0 2 1 2 1 4 3 5 8 7 6 9 10 11 13 12 14 17 16 15 19 20 18 0 18 0 2 1 4 3 5 8 7 6 9 10 11 13 12 14 17 16 15 19 20 19 20 18 0 2 1 4 3 5 8 7 6 9 10 11 13 12 14 17 16 15 16 15 19 20 18 0 2 1 4 3 5 8 7 6 9 10 11 13 12 14 17 14 17 16 15 19 20 18 0 2 1 4 3 5 8 7 6 9 10 11 13 12 13 12 14 17 16 15 19 20 18 0 2 1 4 3 5 8 7 6 9 10 11 10 11 13 12 14 17 16 15 19 20 18 0 2 1 4 3 5 8 7 6 9 6 9 10 11 13 12 14 17 16 15 19 20 18 0 2 1 4 3 5 8 7 8 7 6 9 10 11 13 12 14 17 16 15 19 20 18 0 2 1 4 3 5 3 5 8 7 6 9 10 11 13 12 14 17 16 15 19 20 18 0 2 1 4 1 4 3 5 8 7 6 9 10 11 13 12 14 17 16 15 19 20 18 0 2

= panmagic 21x21 square

 1 45 23 89 67 111 177 155 133 199 221 243 287 265 309 375 353 331 419 441 397 42 103 64 108 170 152 130 195 219 239 280 262 305 369 350 328 414 438 395 16 62 79 125 189 166 127 192 212 236 277 258 303 365 343 325 410 432 392 13 57 39 101 186 164 142 209 231 250 274 255 296 362 340 321 408 428 385 10 53 33 98 76 120 139 204 228 248 289 272 315 376 337 318 401 425 382 6 51 29 91 73 116 180 161 222 245 286 267 312 374 352 335 420 439 379 3 44 26 88 69 114 176 154 136 200 283 263 306 371 349 330 417 437 394 20 63 40 85 66 107 173 151 132 198 218 238 302 364 346 326 411 434 391 15 60 38 100 83 126 187 148 129 191 215 235 279 261 342 324 407 427 388 11 54 35 97 78 123 185 163 146 210 229 232 276 254 299 361 404 424 384 9 50 28 94 74 117 182 160 141 207 227 247 293 273 313 358 339 317 381 2 47 25 90 72 113 175 157 137 201 224 244 288 270 311 373 356 336 418 421 61 22 87 65 110 172 153 135 197 217 241 284 264 308 370 351 333 416 436 398 21 104 84 124 169 150 128 194 214 237 282 260 301 367 347 327 413 433 393 18 59 37 122 184 167 147 208 211 234 275 257 298 363 345 323 406 430 389 12 56 34 99 81 162 144 206 226 251 294 271 295 360 338 320 403 426 387 8 49 31 95 75 119 181 203 223 246 291 269 310 377 357 334 400 423 380 5 46 27 93 71 112 178 158 138 242 285 266 307 372 354 332 415 440 399 19 43 24 86 68 109 174 156 134 196 220 259 304 368 348 329 412 435 396 17 58 41 105 82 106 171 149 131 193 216 240 281 366 344 322 409 431 390 14 55 36 102 80 121 188 168 145 190 213 233 278 256 300 319 405 429 386 7 52 32 96 77 118 183 165 143 205 230 252 292 253 297 359 341 422 383 4 48 30 92 70 115 179 159 140 202 225 249 290 268 314 378 355 316 402

Use the shift method to construct magic squares of odd order from 5x5 to infinity.

See

21x21, shift method (1).xls