It is possible to use a 4x4 panmagic square and a 5x5 panmagic square to construct a 20x20 magic square.
The first grid is 4x4 the panmagic 5x5 square and the second grid is 5x5 the panmagic 4x4 square.
Take a number from a cell of the first grid and add (number -/- 1) x 25 from the same cell of the second grid.
1x number
1 | 15 | 22 | 18 | 9 | 1 | 15 | 22 | 18 | 9 | 1 | 15 | 22 | 18 | 9 | 1 | 15 | 22 | 18 | 9 |
23 | 19 | 6 | 5 | 12 | 23 | 19 | 6 | 5 | 12 | 23 | 19 | 6 | 5 | 12 | 23 | 19 | 6 | 5 | 12 |
10 | 2 | 13 | 24 | 16 | 10 | 2 | 13 | 24 | 16 | 10 | 2 | 13 | 24 | 16 | 10 | 2 | 13 | 24 | 16 |
14 | 21 | 20 | 7 | 3 | 14 | 21 | 20 | 7 | 3 | 14 | 21 | 20 | 7 | 3 | 14 | 21 | 20 | 7 | 3 |
17 | 8 | 4 | 11 | 25 | 17 | 8 | 4 | 11 | 25 | 17 | 8 | 4 | 11 | 25 | 17 | 8 | 4 | 11 | 25 |
1 | 15 | 22 | 18 | 9 | 1 | 15 | 22 | 18 | 9 | 1 | 15 | 22 | 18 | 9 | 1 | 15 | 22 | 18 | 9 |
23 | 19 | 6 | 5 | 12 | 23 | 19 | 6 | 5 | 12 | 23 | 19 | 6 | 5 | 12 | 23 | 19 | 6 | 5 | 12 |
10 | 2 | 13 | 24 | 16 | 10 | 2 | 13 | 24 | 16 | 10 | 2 | 13 | 24 | 16 | 10 | 2 | 13 | 24 | 16 |
14 | 21 | 20 | 7 | 3 | 14 | 21 | 20 | 7 | 3 | 14 | 21 | 20 | 7 | 3 | 14 | 21 | 20 | 7 | 3 |
17 | 8 | 4 | 11 | 25 | 17 | 8 | 4 | 11 | 25 | 17 | 8 | 4 | 11 | 25 | 17 | 8 | 4 | 11 | 25 |
1 | 15 | 22 | 18 | 9 | 1 | 15 | 22 | 18 | 9 | 1 | 15 | 22 | 18 | 9 | 1 | 15 | 22 | 18 | 9 |
23 | 19 | 6 | 5 | 12 | 23 | 19 | 6 | 5 | 12 | 23 | 19 | 6 | 5 | 12 | 23 | 19 | 6 | 5 | 12 |
10 | 2 | 13 | 24 | 16 | 10 | 2 | 13 | 24 | 16 | 10 | 2 | 13 | 24 | 16 | 10 | 2 | 13 | 24 | 16 |
14 | 21 | 20 | 7 | 3 | 14 | 21 | 20 | 7 | 3 | 14 | 21 | 20 | 7 | 3 | 14 | 21 | 20 | 7 | 3 |
17 | 8 | 4 | 11 | 25 | 17 | 8 | 4 | 11 | 25 | 17 | 8 | 4 | 11 | 25 | 17 | 8 | 4 | 11 | 25 |
1 | 15 | 22 | 18 | 9 | 1 | 15 | 22 | 18 | 9 | 1 | 15 | 22 | 18 | 9 | 1 | 15 | 22 | 18 | 9 |
23 | 19 | 6 | 5 | 12 | 23 | 19 | 6 | 5 | 12 | 23 | 19 | 6 | 5 | 12 | 23 | 19 | 6 | 5 | 12 |
10 | 2 | 13 | 24 | 16 | 10 | 2 | 13 | 24 | 16 | 10 | 2 | 13 | 24 | 16 | 10 | 2 | 13 | 24 | 16 |
14 | 21 | 20 | 7 | 3 | 14 | 21 | 20 | 7 | 3 | 14 | 21 | 20 | 7 | 3 | 14 | 21 | 20 | 7 | 3 |
17 | 8 | 4 | 11 | 25 | 17 | 8 | 4 | 11 | 25 | 17 | 8 | 4 | 11 | 25 | 17 | 8 | 4 | 11 | 25 |
+ (number -/- 1) x 25
1 | 8 | 13 | 12 | 1 | 8 | 13 | 12 | 1 | 8 | 13 | 12 | 1 | 8 | 13 | 12 | 1 | 8 | 13 | 12 |
14 | 11 | 2 | 7 | 14 | 11 | 2 | 7 | 14 | 11 | 2 | 7 | 14 | 11 | 2 | 7 | 14 | 11 | 2 | 7 |
4 | 5 | 16 | 9 | 4 | 5 | 16 | 9 | 4 | 5 | 16 | 9 | 4 | 5 | 16 | 9 | 4 | 5 | 16 | 9 |
15 | 10 | 3 | 6 | 15 | 10 | 3 | 6 | 15 | 10 | 3 | 6 | 15 | 10 | 3 | 6 | 15 | 10 | 3 | 6 |
1 | 8 | 13 | 12 | 1 | 8 | 13 | 12 | 1 | 8 | 13 | 12 | 1 | 8 | 13 | 12 | 1 | 8 | 13 | 12 |
14 | 11 | 2 | 7 | 14 | 11 | 2 | 7 | 14 | 11 | 2 | 7 | 14 | 11 | 2 | 7 | 14 | 11 | 2 | 7 |
4 | 5 | 16 | 9 | 4 | 5 | 16 | 9 | 4 | 5 | 16 | 9 | 4 | 5 | 16 | 9 | 4 | 5 | 16 | 9 |
15 | 10 | 3 | 6 | 15 | 10 | 3 | 6 | 15 | 10 | 3 | 6 | 15 | 10 | 3 | 6 | 15 | 10 | 3 | 6 |
1 | 8 | 13 | 12 | 1 | 8 | 13 | 12 | 1 | 8 | 13 | 12 | 1 | 8 | 13 | 12 | 1 | 8 | 13 | 12 |
14 | 11 | 2 | 7 | 14 | 11 | 2 | 7 | 14 | 11 | 2 | 7 | 14 | 11 | 2 | 7 | 14 | 11 | 2 | 7 |
4 | 5 | 16 | 9 | 4 | 5 | 16 | 9 | 4 | 5 | 16 | 9 | 4 | 5 | 16 | 9 | 4 | 5 | 16 | 9 |
15 | 10 | 3 | 6 | 15 | 10 | 3 | 6 | 15 | 10 | 3 | 6 | 15 | 10 | 3 | 6 | 15 | 10 | 3 | 6 |
1 | 8 | 13 | 12 | 1 | 8 | 13 | 12 | 1 | 8 | 13 | 12 | 1 | 8 | 13 | 12 | 1 | 8 | 13 | 12 |
14 | 11 | 2 | 7 | 14 | 11 | 2 | 7 | 14 | 11 | 2 | 7 | 14 | 11 | 2 | 7 | 14 | 11 | 2 | 7 |
4 | 5 | 16 | 9 | 4 | 5 | 16 | 9 | 4 | 5 | 16 | 9 | 4 | 5 | 16 | 9 | 4 | 5 | 16 | 9 |
15 | 10 | 3 | 6 | 15 | 10 | 3 | 6 | 15 | 10 | 3 | 6 | 15 | 10 | 3 | 6 | 15 | 10 | 3 | 6 |
1 | 8 | 13 | 12 | 1 | 8 | 13 | 12 | 1 | 8 | 13 | 12 | 1 | 8 | 13 | 12 | 1 | 8 | 13 | 12 |
14 | 11 | 2 | 7 | 14 | 11 | 2 | 7 | 14 | 11 | 2 | 7 | 14 | 11 | 2 | 7 | 14 | 11 | 2 | 7 |
4 | 5 | 16 | 9 | 4 | 5 | 16 | 9 | 4 | 5 | 16 | 9 | 4 | 5 | 16 | 9 | 4 | 5 | 16 | 9 |
15 | 10 | 3 | 6 | 15 | 10 | 3 | 6 | 15 | 10 | 3 | 6 | 15 | 10 | 3 | 6 | 15 | 10 | 3 | 6 |
= Composite 20x20 magic square
1 | 190 | 322 | 293 | 9 | 176 | 315 | 297 | 18 | 184 | 301 | 290 | 22 | 193 | 309 | 276 | 15 | 197 | 318 | 284 |
348 | 269 | 31 | 155 | 337 | 273 | 44 | 156 | 330 | 262 | 48 | 169 | 331 | 255 | 37 | 173 | 344 | 256 | 30 | 162 |
85 | 102 | 388 | 224 | 91 | 110 | 377 | 213 | 99 | 116 | 385 | 202 | 88 | 124 | 391 | 210 | 77 | 113 | 399 | 216 |
364 | 246 | 70 | 132 | 353 | 239 | 71 | 145 | 357 | 228 | 64 | 146 | 370 | 232 | 53 | 139 | 371 | 245 | 57 | 128 |
17 | 183 | 304 | 286 | 25 | 192 | 308 | 279 | 11 | 200 | 317 | 283 | 4 | 186 | 325 | 292 | 8 | 179 | 311 | 300 |
326 | 265 | 47 | 168 | 334 | 251 | 40 | 172 | 343 | 259 | 26 | 165 | 347 | 268 | 34 | 151 | 340 | 272 | 43 | 159 |
98 | 119 | 381 | 205 | 87 | 123 | 394 | 206 | 80 | 112 | 398 | 219 | 81 | 105 | 387 | 223 | 94 | 106 | 380 | 212 |
360 | 227 | 63 | 149 | 366 | 235 | 52 | 138 | 374 | 241 | 60 | 127 | 363 | 249 | 66 | 135 | 352 | 238 | 74 | 141 |
14 | 196 | 320 | 282 | 3 | 189 | 321 | 295 | 7 | 178 | 314 | 296 | 20 | 182 | 303 | 289 | 21 | 195 | 307 | 278 |
342 | 258 | 29 | 161 | 350 | 267 | 33 | 154 | 336 | 275 | 42 | 158 | 329 | 261 | 50 | 167 | 333 | 254 | 36 | 175 |
76 | 115 | 397 | 218 | 84 | 101 | 390 | 222 | 93 | 109 | 376 | 215 | 97 | 118 | 384 | 201 | 90 | 122 | 393 | 209 |
373 | 244 | 56 | 130 | 362 | 248 | 69 | 131 | 355 | 237 | 73 | 144 | 356 | 230 | 62 | 148 | 369 | 231 | 55 | 137 |
10 | 177 | 313 | 299 | 16 | 185 | 302 | 288 | 24 | 191 | 310 | 277 | 13 | 199 | 316 | 285 | 2 | 188 | 324 | 291 |
339 | 271 | 45 | 157 | 328 | 264 | 46 | 170 | 332 | 253 | 39 | 171 | 345 | 257 | 28 | 164 | 346 | 270 | 32 | 153 |
92 | 108 | 379 | 211 | 100 | 117 | 383 | 204 | 86 | 125 | 392 | 208 | 79 | 111 | 400 | 217 | 83 | 104 | 386 | 225 |
351 | 240 | 72 | 143 | 359 | 226 | 65 | 147 | 368 | 234 | 51 | 140 | 372 | 243 | 59 | 126 | 365 | 247 | 68 | 134 |
23 | 194 | 306 | 280 | 12 | 198 | 319 | 281 | 5 | 187 | 323 | 294 | 6 | 180 | 312 | 298 | 19 | 181 | 305 | 287 |
335 | 252 | 38 | 174 | 341 | 260 | 27 | 163 | 349 | 266 | 35 | 152 | 338 | 274 | 41 | 160 | 327 | 263 | 49 | 166 |
89 | 121 | 395 | 207 | 78 | 114 | 396 | 220 | 82 | 103 | 389 | 221 | 95 | 107 | 378 | 214 | 96 | 120 | 382 | 203 |
367 | 233 | 54 | 136 | 375 | 242 | 58 | 129 | 361 | 250 | 67 | 133 | 354 | 236 | 75 | 142 | 358 | 229 | 61 | 150 |
This 20x20 magic square is panmagic and each random chosen 4x5 of 5x4 rectangle inside the square gives the magic sum of 4010.
I have used the method composite, AxB compact to construct
12x12, 15x15, 20x20, 21x21, 24x24, 28x28, 30x30a and 30x30b