# How to fill below the diagram in order to receive a magic square:

How to fill below the diagram in order to receive a magic square:

• I'd fill in the empty top cells with $ax+by$ and $cx+dy$ and then you can solve the other cells and have linear conditions on $a,b,c,d$ – Thomas Andrews May 15 at 22:46
• (You can solve for the center right cell directly, getting $-7x+9y.$) – Thomas Andrews May 15 at 22:48
• Actually you can just fill in the upper right corner with $ax+by$ if your magic square includes the diagonal sums, as usual. (I was only solving for rows and columns equal in my original comment.) – Thomas Andrews May 15 at 22:51

To do it mechanically, let the magic constant be $$z$$. Then the center left is $$z+3x-8y$$. Anywhere you have two cells in a row filled in you can fill in the third. When you finish you can add the cells in rows or columns you didn't use. The sum must equal $$z$$. You will get equations that give you $$z$$ in terms of $$x,y$$ and can replace $$z$$ everywhere.

Added: you can also prove that the magic constant is three times the central square. If you add the three columns you get all the numbers in the grid for three times the magic constant. If you add the four lines through the center you get all the numbers in the grid plus three times the center square for four times the magic constant. Subtracting these give the magic constant is three times the central square, so $$z=12x-3y$$. You can now fill in the rest of the grid.

• I don't have solution. Can someone help with this? – piteer May 16 at 16:53
• Do you understand where $z+3x-8y$ comes from? Do the same for the right column. You have two in a row through each of them – Ross Millikan May 16 at 17:24
• yes I know where z+3x-8 comes from, but I don't know what next. – piteer May 16 at 17:30
• So fill it into your matrix. You can then compute what goes in each cell in the right column because you have two in a row through the middle. The corners will get something like $z-$ some $x$s and $y$s. The middle will just be $x$s and $y$s. When you add the column you will get $2z-$ some $x$s and $y$s. That has to equal $z$, so you will get $z$ expressed in terms of $x,y$. Plug that in, fill in the top and bottom center, and you are done. All the cells will be in terms of $x,y$. – Ross Millikan May 16 at 17:57

Let

$$\begin{matrix} -2x+3y & -- &--\\ ax+by & 4x-y &-- \\-x+5y &-- &--\end{matrix}$$

Addition of first column gives $$(-3+a)x+(8+b)y$$. Using this for second row (taking hints from Thomas Andrews) gives

$$\begin{matrix} -2x+3y & -- &--\\ ax+by & 4x-y &-7x+9y \\-x+5y &-- &--\end{matrix}$$

Again considering

$$\begin{matrix} -2x+3y & -- &--\\ -- & 4x-y &-7x+9y \\-x+5y &-- &ax+by\end{matrix}$$

Summing up main the main diagonal gives $$(2+a)x+(2+b)y$$, using this for last row gives

$$\begin{matrix} -2x+3y & -- &--\\ -- & 4x-y &-7x+9y \\-x+5y &3x-3y &--\end{matrix}$$

Again considering

$$\begin{matrix} -2x+3y & -- &ax+by\\ -- & 4x-y &-7x+9y \\-x+5y &3x-3y &--\end{matrix}$$

summing up the other diagonal gives $$(3+a)x+(4+b)y$$, using this for first row gives

$$\begin{matrix} -2x+3y & 5x+y &--\\ -- & 4x-y &-7x+9y \\-x+5y &3x-3y &--\end{matrix}$$

and we are done as second column sums up to $$12x-3y$$