Friday, February 17, 2017

Week 2

     Even though the magic squares only requires that the rows, columns, and diagonals sum to the same number and that each entry is the distinct square of an integer, there are many ways to think about the magic square of squares. If we can turn the magic square of squares problem into a different problem, then perhaps we may solve it.


A magic square can be expressed as 3 arithmetic progressions.

     An arithmetic progression is a sequence of numbers where the difference between consecutive terms is constant. For example
$1,2,3$ where consecutive terms differ by $1$
$3,5,7,9,11$ where consecutive terms differ by $2$

If we have 3 arithmetic progressions

$a,a+u,a+2u$
$a+v,a+u+v,a+2u+v$
$a+2v,a+2v+,a+2u+2v$

We can reorganize them into this magic square





$$a+u+2v,\ \ \ \ \ a,\ \ \ \ \ a+2u+v\\a+2u,\ \ \ \ \ a+u+v,\ \ \ \ \ a+2v\\a+v,\ \ \ \ \ a+2u+2v,\ \ \ \ \ a+u$$

Now we just need to ensure that each of these numbers are perfect squares

An arithmetic progression of squares can be expressed as a Pythagorean triple

We can find arithmetic progressions of perfect squares by taking a Pythagorean triple $X^2+Y^2=Z^2$ and letting
$r=X-Y$
$s=Z$
$t=X+Y$

Our arithmetic progression is $r^2,s^2,t^2$

For example $4^2+3^2=5^2$
$r=4-3=1$
$s=5$
$t=4+3=7$

and our arithmetic progression is $1,25,49$ with common difference 24
However, nothing has yet been discovered with this method of generating arithmetic progressions of squares.

     This previous way of expressing a magic square was part of research previously done. Now, I will show my version of this, but first I must prove a few things.

The entries of a magic square are all odd
Let us try organizing all integers into four classes. The first class is $0 \bmod 4$ and numbers that give remainder $0$ when divided by $4$ are in this class. The second class is $1 \bmod 4$ and numbers that give remainder $1$ when divided by $4$ are in this class. This continues up to $3 \bmod 4$. (You can't have a remainder $4$ or higher if you are diving by $4$).

even numbers are in either the $0 \bmod 4$ or $2 \bmod 4$ class while odd numbers are in either the $1 \bmod 4$ or $3 \bmod 4$ class.

What class is the square of even numbers in?
$0 \bmod 4 * 0 \bmod 4 = 0 \bmod 4$
$2 \bmod 4 * 2 \bmod 4 = 4 \bmod 4 = 0 \bmod 4$

Whether the even number is $0 \bmod 4$ or $2 \bmod 4$, it's square is $0 \bmod 4$

What class is the square of odd numbers in?
$1 \bmod 4 * 1 \bmod 4 = 1 \bmod 4$
$3 \bmod 4 * 3 \bmod 4 = 9 \bmod 4 = 1 \bmod 4$

Whether the odd number is $1 \bmod 4$ or $3 \bmod 4$, it's square is $1 \bmod 4$

From one of our previous proofs, for some magic square of squares
$$A\ B\ C\\D\ E\ F\\G\ H\ I$$
we know that $B+H=2E$

Because $B$ and $H$ are squares, they must be either $0 \bmod 4$ or $1 \bmod 4$

If $B$ is $0 \bmod 4$ and $H$ is $1 \bmod 4$, what is $E$?

In other words, for what $n$ does $2 * n \bmod 4 = 1 \bmod 4$?

The answer is there is no $n$. This means that $B$ and $H$ cannot have those values. They must both be $0 \bmod 4$ or both be $1 \bmod 4$


What if $B \equiv 0 \bmod 4$, $H \equiv 0 \bmod 4, D \equiv 1 \bmod 4, F \equiv 1 \bmod 4$?

According to $B$ and $H$, $2 * n \bmod 4 = 0 \bmod 4$ so $n=0$ or $2$ and $E \equiv 0 \bmod 4$ (since $2 \bmod 4$ is not a square)

According to $D$ and $F$, $2 * n \bmod 4 = 2 \bmod 4$ so $n=1$ or $3$ and $E \equiv 1 \bmod 4$ (since $3 \bmod 4$ is not a square)

We have reached a contradiction, so these values for $B,H,D,F$ do not work. Instead they must all have the same value.


What if $B,H,D,F$ are all $ 1 \bmod 4$?
$$A\ 1\ C\\1\ E\ 1\\G\ 1\ I$$
Then $E \equiv 1 \bmod 4$
$$A\ 1\ C\\1\ 1\ 1\\G\ 1\ I$$
Then the sum of each row, column and diagonal is $3 \bmod 4$. This forces the rest of the values to be $ 1 \bmod 4$
$$1\ 1\ 1\\1\ 1\ 1\\1\ 1\ 1$$

What if $B,H,D,F$ are all $ 0 \bmod 4$?
$$A\ 0\ C\\0\ E\ 0\\G\ 0\ I$$
Then $E \equiv 0 \bmod 4$
$$A\ 0\ C\\0\ 0\ 0\\G\ 0\ I$$
Then the sum of each row, column and diagonal is $0 \bmod 4$. This forces the rest of the values to be $ 0 \bmod 4$
$$0\ 0\ 0\\0\ 0\ 0\\0\ 0\ 0$$

However, each of these entries is even and the square is not simplified. It's kind of like writing $\frac{2}{4}$; we would instead write $\frac{1}{2}$. Since all entries are even, we could keep dividing by $2$ until at least one entry is odd. Since we proved the entries are either all even or all odd, repeatedly dividing by $2$ would yield a square with all odd entries.

In short, a magic square of squares with all even entries is just a magic square of squares with all odd entries times an even square

Now, we see that a magic square of squares must have only odd entries.


An arithmetic progression of odd squares can be expressed as an arithmetic progression of triangular numbers
Since each entry is an odd perfect square, each entry can be expressed as 8m+1 where m is a triangular number. A triangular number is the number of points in a triangle like this:
Image result for triangular numbers
For example $8*3+1=25$ and $8*6+1=49$. This means that we can express an arithmetic progression of squares as an arithmetic progression of triangular numbers

An arithmetic progression of triangular numbers can be expressed as halves of an arithmetic series with difference 1

Triangular numbers can be expressed as an arithmetic series with difference 1. For example, $1+2+3+4=10$
$1+2+3+4+5=15$
$1+2+3+4+5+6=21$
For some triangular number, we'll say that it can be expressed as $1+2+...n$

Let's say we have an arithmetic progression of triangular numbers $X,Y, Z$
We know that $Z-Y=Y-X$
This means that
$\left(1+2\ ...\ n_Z \right) - \left(1+2\ ...\ n_Y\right) = \left(1+2\ ...\ n_Y \right) - \left(1+2\ ...\ n_X \right)$
$\left(n_Y+1\ \ \ \ +\ \ \ \ n_Y+2\ \ \ \ ...\ \ \ \ n_Z \right)=\left(n_X+1\ \ \ \ +\ \ \ \ n_X+2\ \ \ \ ...\ \ \ \ n_Y \right)$
By inspecting this equation, we see that we are looking for
an arithmetic series such that it can be split into 2 parts with equal sums.
We could express an arithmetic progression of triangular numbers as such an arithmetic series

With so many different ways to express a magic square of squares, hopefully we will be able to generate one of these and by extension generate a magic square of squares.

I will leave you with a little program that Intro to Categories students might find useful. This is a permutation calculator. In Intro to Categories, we have "permutations" that send one number to another. For example, the permutation $\left(ACBD\right)$ sends A to C, C to B, B to D, and D to A. When we link multiple of these permutations together we can "multiply" them together to get a single permutation. This process of multiplying permutations together can become tedious for larger permutations, so I created a program that multiplies permutations.