This week the #puzzle is: Happy (Almost) New Year from The Fiddler! #MagicSquare #primes
| A magic square is a square array of distinct natural numbers, where each row, each column, and both long diagonals sum to the same “magic number.” ,,, |
| A prime magic square is a magic square consisting of only prime numbers. Is it possible to construct a 4-by-4 prime magic square with a magic number of 2026? If so, give an example; if not, why not? |
And for extra credit:
| Find all values of N for which it is possible to construct an N-by-N prime magic square with a magic number of 2026. (Remember, the numbers in a magic square must all be distinct!) |

Happy (Almost) New Year from The Fiddler! ![]()
Highlight to reveal (possibly incorrect) solution:
Examples of prime magic squares
OEIS sequence
Magic Squares (4 x 4), Analytic Solution, Pan Magic Squares
Prime Magic Squares (4 x 4), Simple Magic Squares (4 x 4)
Magic Square Generator ![]()
Example of a magic square with magic sum 2026:
Example of a prime magic square with magic sum 240:
| 506 | 509 | 512 | 499 | 47 | 7 | 79 | 107 | |
| 511 | 500 | 505 | 510 | 37 | 101 | 31 | 71 | |
| 501 | 514 | 507 | 504 | 73 | 19 | 89 | 59 | |
| 508 | 503 | 502 | 513 | 83 | 113 | 41 | 3 |
Based on the methods found on entertainmentmathematics.nl, I code my own “find a prime pan magic square, 4×4”. For a magic sum of 240, it correctly finds a solution (see example above). For 2026, it does not. There is no magic square of this kind. However, here’s a few others:
| 43 | 131 | 877 | 977 | 193 | 181 | 809 | 857 | |
| 857 | 997 | 23 | 151 | 653 | 1013 | 37 | 337 | |
| 137 | 37 | 971 | 883 | 211 | 163 | 827 | 839 | |
| 991 | 863 | 157 | 17 | 983 | 683 | 367 | 7 |
And for extra credit:
Thoughts:
- N odd won’t work, as the sum of (odd) primes has to be even.
- N = 2 won’t work, as no magic square of any kind exists for N = 2.
- We’ve already shown that N = 4 doesn’t work.
- There are 305 primes below 2026. N = 18 and above won’t work, because 182 = 324.
- As for the rest…?