Monday, December 22, 2025

No $4\times 4$ Prime Magic for 2026

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?

Well first thing's first. We see from the prompt and from Dürer's engraving that 4-by-4 magic squares do exist. In fact, OEIS A006052 shows that there are 880 distinct natural 4-by-4 magic squares, which contain the numbers $1, 2, \dots, 16,$ that is which a magic number of $$M=\frac{1}{4} \sum_{i=1}^{16} i = 34.$$ The question is whether or not one exists with added constriants of including only prime numbers and having a magic number of $M=2026.$

First we notice that the numbers $1$ through $16$ form an arithmetic progression. With not so much checking (see the figure below), we see that if $$a_i = a + r(i-1), \,\,i= 1,\dots, 16,$$ for some $a, r \in \mathbb{Z},$ that if we replace each integer $i$ in Dü rer's magic square with $a_i$, that we again retrieve a magic square but this time with magic number $$M=M(a,r)=\frac{1}{4} \sum_{i=1}^{16}\left(a+ r(i-1)\right)= 4a+30r.$$ What's more is that we can actually have a system of arithmetic progressions, namely for any $j\gt 1$ with $j \mid 16,$ we can define $$a_i = \begin{cases} a+(i-1)r, & i=1, \dots, j\\ a+(i-j-1)r + s, & i=j+1, \dots, 2j\\ \dots & \\ a + (i+j-17)r + (16/j-1)s, & i=17-j, \dots, 16.\end{cases}$$ We see in the figures below the cases for $j=2$ and $j=16$ (which was the case covered earlier. In this case the generic magic number formula is \begin{align*}M=M(a,j,r,s)&=\frac{1}{4} \sum_{i=1} a_i \\ &= 4a + 2(j-1)r + 2\left( \frac{16}{j} - 1 \right) s.\end{align*}

4-by-4 Magic square with j=16
a+15r a+2r a+r a+12r
a+4r a+9r a+10r a+7r
a+8r a+5r a+6r a+11r
a+3r a+14r a+13r a


4-by-4 Magic square with j=2
a+r+7s a+s a+r a+6s
a+2s a+r+4s a+5s a+r+3s
a+4s a+r+2s a+3s a+r+5s
a+r+s a+7s a+r+6s a

Ok now with all the arts and crafts out of the way lets use the formula for $M=M(a,j,r,s)$ to see if we can end up with any prime magic squares with $M=2026.$ Since we wnat to have a prime square we must have $a$ prime and $a \ne 2.$ Similarly, since we will have a bunch of odd primes in our arithmetic progressions we will need to have the differences $r, s \in 2\mathbb{Z}.$ However, we then quickly see that no matter what value of $j \in \{2, 4, 8, 16\},$ if $r, s \in 2\mathbb{Z},$ then there are $p, q \in \mathbb{Z}$ such that $r=2p$ and $s=2q,$ so we have \begin{align*} M=M(a,j,r,s) &= 4a+2(j-1)r + 2\left(\frac{16}{j}-1\right) s \\ &= 4\left( a + (j-1) p + \left(\frac{16}{j}-1\right) q \right) \in 4\mathbb{Z}.\end{align*} Since $2026 \not\in 4\mathbb{Z}$, there are no prime 4-by-4 magic squares with magic number $M=2026.$

No comments:

Post a Comment