# Arithmetic sequence magic square

If I know that for all $z*z$ magic squares, I can have a magic square consisting of all the terms of the set (1,2,3,...$z^2$), then how do I prove that I can have a magic square consisting of an arithmetic sequence? For example, since 1,2,3,4,...$z^2$ is an arithmetic sequence of length $z^2$ and common difference of 1, can I have a magic square made of the terms in an arithmetic sequence of length $z^2$ and common difference of $d$. Also would this apply to all even and odd ordered magic squares?

For example, a common 3 by 3 magic square made by the De la Loubère method:

(8 1 6)

(3 5 7)

(4 9 2)

can be modified into:

(15 1 11)

(5 9 13)

(7 17 3)

and is still a magic square. How can I prove that this modification of making the common difference different between each of the terms in a magic square happens for ALL even and odd ordered magic squares?

• Digits? Not clear what you mean by "all the digits of $(1,2,\dots,z^2)$. – Thomas Andrews Apr 11 '17 at 20:53
• um. Multiply the first by d? – steven gregory Apr 11 '17 at 20:54
• @ThomasAndrews I meant terms of the magic square. Sorry – jk23541 Apr 11 '17 at 21:06

The transformation can be done in 2 easy steps:

1. First, multiply all entries in the square by $d$. Ths will make the entries $d,2d,3d,...$. Also, note how the sum of each row, column, and diagonal gets multiplied by $d$ as well, so the square remains a magic square.

2. Subtract $d-1$ from each entry. So now the entries are $1, d + 1, 2d +1, ...$ as desired. Moreover, not how again the sum of each rom, column, and diagonal gets lowered by $z\cdot (d-1)$ from the previous square, so their sums yet again are all the same, so the resulting square is still a magic square.

(8 1 6)

(3 5 7)

(4 9 2)

Multiply by $d=2$:

(16 2 12)

(6 10 14)

(8 18 4)

subtract $d-1=1$:

(15 1 11)

(5 9 13)

(7 17 3)

Finally, notice that the method I described does not depend on $z$ being even or odd, so this always works.

• How would that make a magic square where all the terms increase with a common difference? – jk23541 Apr 11 '17 at 21:10
• @jk23541 Because if the rows, columns, and diagonals of the original square add up to the same sum, and you multiply all entries by $d$, then in the resulting square each of the rows, columns, and diagonals add up to $d$ times that sum, and are thus the same sum. So, the resulting square is a magic square itself. And if you have 1,2,3,... In the original square, then in the resulting square you will have the terms $d,2d,3d,..$ – Bram28 Apr 11 '17 at 21:23
• I meant if I start at a term k, I would have all the terms increase by a common difference. So I would have a sequence of 1, 3, 5, 7, 9... in my magic square instead of 1,2,3,4,5,6... – jk23541 Apr 11 '17 at 21:55
• For example, I can modify this: (8 1 6) (3 5 7) (4 9 2) into: (15 1 11) (5 9 13) (7 17 3) – jk23541 Apr 11 '17 at 21:56
• OK, if you want to start with 1, then after multiplying each entry by $d$, subtract $d-1$ from each entry. So, from $1,2,3,..$ you first get $d,2d,3d,...$ and that becomes $1,d +1, 2d+1,...$ – Bram28 Apr 11 '17 at 22:09

I typed this all out and fiddled with the formatting, but in the meantime Bram updated his answer. It doesn't really add to Bram's answer so I'll post it and mark it as community wiki.

I'll expand on Bram28's answer to clarify how arithmetic sequences can be transformed while still ensuring a magic square is valid.

It's easy to see that if we add a constant to every number in a magic square we get another valid magic square. Similarly, if we multiply every number in a magic square by a constant we'll produce a different magic square.

Suppose we have two arithmetic sequences: $$a_1,a_1+d_1,a_1+2d_1,\ldots,a_1+(z^2-1)d_1$$ $$a_2,a_2+d_2,a_2+2d_2,\ldots,a_2+(z^2-1)d_2$$ To transform the first sequence to the second we can start by multiplying each term by $\frac{d_2}{d_1}$, giving: $$\frac{d_2}{d_1}a_1,\frac{d_2}{d_1}a_1+d_2,\frac{d_2}{d_1}a_1+2d_2,\ldots,\frac{d_2}{d_1}a_1+(z^2-1)d_2.$$ Then we just need to add the constant $(a_2-\frac{d_2}{d_1}a_1)$ to each term and we produce the second arithmetic sequence as required.

Hence, if we have already created a magic square using an arithmetic sequence we can transform it to any other arithmetic sequence simply by adding and multiplying by constants and this will still produce a valid magic square.