Problem of values in a $3\times3$ magic square

88 Views Asked by At

We give the following integers : $$\left[\begin{matrix} -2 & x_2 & x_1 \\ 17 & -8 & 9 \\ 3 & x_3 & x_4 \end{matrix}\right]$$

The magic constant is equal to $18$ then I found two possibilities for the four unknown integers. The first weird thing is the fact that $-8$ is at the center of the square... What value do I have to change to get only one solution?

Thanks in advance!

3

There are 3 best solutions below

1
On BEST ANSWER

Here are how we can readjust the table to make it a complete magic square. That is, both diagonals are also magic (namely, each diagonal sum equals the magic constant, which is the sum of each row or each column). The current magic constant is $18$.


Approach I: Only one previously filled entry can be changed.

Clearly, the magic constant cannot be kept at $18$. Suppose that the new magic constant is $M$. If the entry $17$ is untouched, then either the first column or the second row will still sum to $18\neq M$. Therefore, $17$ has to be changed, and it will become $M-1$.

With this change, we get $x_1=M+5$ by looking at the diagonal containing $x_1$. Similarly, $x_4=M+10$ from the diagonal containing $x_4$. The third column dictates that $x_1+9+x_4=M$, which then mean that $$(M+5)+9+(M+10)=M\,.$$ Thus, $M=-24$. Hence, we obtain $$(x_1,x_2,x_3,x_4)=(-19,-3,-13,-14)\,,$$ and the entry $17$ is now changed to $-25$. Therefore, the table is now $$\begin{array}{|c|c|c|}\hline -2&-3&-19 \\ \hline -25&-8&9\\ \hline 3&-13&-14 \\ \hline \end{array}\,.$$


Approach II: Only two previously filled entries can be changed.

We now want to also keep the magic constant at $18$. Note that the entry $17$ cannot be touched, otherwise at least one other entry in the first column and one other entry in the second row will need to change.

If $-8$ is untouched, then $9$ is also untouched. Hence, $-2$ and $3$ will be readjusted. Suppose that $-2$ is changed to $t$. Thus, $3$ becomes $1-t$. Using the two diagonals, we obtain $x_1=t+25$ and $x_4=26-t$. Nonetheless, the sum of the third column is now $$x_1+9+x_4=(t+25)+9+(26-t)=60\neq 18\,.$$ Therefore, $-8$ has to be changed.

Suppose that $-8$ is changed to $k$. Then $9$ becomes $1-k$. By dealing with the diagonals, we get $x_1=15-k$ and $x_4=20-k$. Thus, the condition on the third column requires that $$18=x_1+(1-k)+x_4=(15-k)+(1-k)+(20-k)=36-3k\,,$$ or $k=6$. Ergo, $8$ and $9$ will now be $6$ and $-5$, respectively. Then, we get $$(x_1,x_2,x_3,x_4)=(9,11,1,14)\,.$$ Therefore, the table is now $$\begin{array}{|c|c|c|}\hline -2&11&9 \\ \hline 17&6&-5\\ \hline 3&1&14 \\ \hline \end{array}\,.$$

7
On

Suppose $x_1$ is known. Then:

  • first row: $x_2=20-x_1$,
  • second column: $x_3=26-x_2=6+x_1$,
  • third column: $x_4=9-x_1$.

And we can check the last row: $3+x_3+x_4=3+6+x_1+9-x_1=18$. (actually this check is not necessary, since the sum of the whole square is $3\times18$ (by construction of columns) and the two first rows do sum to $18$.)

So, for any integer $x_1$, you get a magic square. There are infinitely many solutions.

If you want the diagonals to sum to $18$ too, then necessarily $x_1=23$ and $x_4=9-x_1=-14$. But then $-2-8+x_4\ne 18$, so there is no solution with "magic diagonals". There are two solutions however if you allow only one magic diagonal: either $x_1=23$ or $x_4=28$.


To be able to get a full magic square, with both diagonals, we need to change at least one of the known values, and actually more to keep the magic constant. Let's try:

$$\left[\begin{matrix} -2 & x_2 & x_1 \\ 17+a & -8 & 9-a \\ 3-a & x_3 & x_4 \end{matrix}\right]$$

The we have the same values for $x_2$ and $x_3$ as a function of $x_1$, and $x_4=9+a-x_1$.

Since with haven't changed the diagonals, we still need $x_1=23$, thus $x_4=a-14$. So for $a=32$, we get:

$$\left[\begin{matrix} -2 & -3 & 23 \\ 49 & -8 & -23 \\ -29 & 29 & 18 \end{matrix}\right]$$

1
On

I found a sort of magic solution $$-2,39,-19\\17,-8,9\\3,-13,28$$

It is fine except for one diagonal.

How did you find two solutions.