Prime Magic Square/Examples/Order 12/Smallest with Consecutive Primes from 3

Example of Order $12$ Prime Magic Square
This order $12$ prime magic square is the smallest whose elements are consecutive odd primes starting from $3$ (including $1$).

The primes themselves are the $143$ consecutive odd primes from $3$ up to $827$.

This magic square has magic constant $4514$.


 * $\begin{array}{|c|c|c|c|c|c|c|c|c|c|c|c|}

\hline  1 & 823 & 821 & 809 & 811 & 797 &  19 &  29 & 313 &  31 &  23 &  37 \\ \hline 89 &  83 & 211 &  79 & 641 & 631 & 619 & 709 & 617 &  53 &  43 & 739 \\ \hline 97 & 227 & 103 & 107 & 193 & 557 & 719 & 727 & 607 & 139 & 757 & 281 \\ \hline 223 & 653 & 499 & 197 & 109 & 113 & 563 & 479 & 173 & 761 & 587 & 157 \\ \hline 367 & 379 & 521 & 383 & 241 & 467 & 257 & 263 & 269 & 167 & 601 & 599 \\ \hline 349 & 359 & 353 & 647 & 389 & 331 & 317 & 311 & 409 & 307 & 293 & 449 \\ \hline 503 & 523 & 233 & 337 & 547 & 397 & 421 & 17 & 401 & 271 & 431 & 433 \\ \hline 229 & 491 & 373 & 487 & 461 & 251 & 443 & 463 & 137 & 439 & 457 & 283 \\ \hline 509 & 199 & 73 & 541 & 347 & 191 & 181 & 561 & 577 & 571 & 163 & 593 \\ \hline 661 & 101 & 643 & 239 & 691 & 701 & 127 & 131 & 179 & 613 & 277 & 151 \\ \hline 659 & 673 & 677 & 683 & 71 &  67 &  61 &  47 &  59 & 743 & 733 &  41 \\ \hline 827 &  3 &   7 &   5 &  13 &  11 & 787 & 769 & 773 & 419 & 149 & 751 \\ \hline \end{array}$

Proof
We just need to show that for $n \le 11$, there is no order $n$ prime magic square.

We will show this fact regardless of whether $1$ is included in the magic square.

Firstly, there is no order $2$ magic square:

Consider:


 * $\begin{array}{|c|c|}

\hline a & b \\ \hline c & d \\ \hline \end{array}$

Then we must have $a + b = a + c$.

So $b = c$, so they are not distinct, so this array cannot be a magic square.

Secondly, the sum of all entries of the magic square of order $n$ must be divisible by $n$, since each row adds up to the magic constant.

Here is a list of $1 + $ the sums of the first $n^2 - 1$ odd primes and sums of the first $n^2$ odd primes, and their divisibility by $n$:


 * $\begin{array}{|c|c|c|}

\hline   & \text{Including } 1 & \text{Divisible by } n? & \text{Not including } 1 & \text{Divisible by } n? \\ \hline 3 &    99 & \text{Yes} &   127 & \text{No} \\ \hline 4 &   380 & \text{Yes} &   438 & \text{No} \\ \hline 5 &  1059 & \text{No}  &  1159 & \text{No} \\ \hline 6 &  2426 & \text{No}  &  2582 & \text{No} \\ \hline 7 &  4887 & \text{No}  &  5115 & \text{No} \\ \hline 8 &  8892 & \text{No}  &  9204 & \text{No} \\ \hline 9 & 15115 & \text{No}  & 15535 & \text{No} \\ \hline 10 & 24132 & \text{No} & 24678 & \text{No} \\ \hline 11 & 36887 & \text{No} & 37559 & \text{No} \\ \hline \end{array}$

So the only potential magic squares are of order $3$ or $4$.

These magic squares, if they exist, must have magic constants $33$ and $95$.

The first $8$ primes are $3, 5, 7, 11, 13, 17, 19, 23$.

Since every prime and $1$ appears once in the magic squares, they contribute to at least $2$ sums: the row and column sums.

However, there is only one way to express $32$ as a sum of $2$ primes less than $23$:


 * $32 = 19 + 13$

On the other hand, every row of an order $4$ magic square contains $4$ odd numbers, which sums to an even number, so it cannot be $95$.

So these arrays cannot be magic squares.

Thus the order $12$ prime magic square is the smallest whose elements are consecutive odd primes starting from $3$ (including or not including $1$).

Also see

 * Magic Constant of Smallest Prime Magic Square with Consecutive Primes from 3