Friday, February 24, 2017

Week 3

     Last week, I worked on finding ways to express the 3x3 magic square of squares and this week, I found many more ways. Let's pick up where we left off.

We were looking for
$$\left(n_Y+1\ \ \ \ +\ \ \ \ n_Y+2\ \ \ \ ...\ \ \ \ n_Z \right)=\left(n_X+1\ \ \ \ +\ \ \ \ n_X+2\ \ \ \ ...\ \ \ \ n_Y \right)$$
so I thought of this as 
$$\left(m\ \ \ \ +\ \ \ \ m+1\ \ \ \ ...\ \ \ \ n \right)=\left(n+1\ \ \ \ +\ \ \ \ n+2\ \ \ \ ...\ \ \ \ n+k \right)$$
We need to find $m,n,k$ such that
$$\frac{\left( n+m \right) \left( n-m+1 \right) }{2}=\frac{\left( 2n+k+1 \right) \left( k \right) }{2}$$
$$n^2-m^2+n+m=\left(2n+k+1\right)\left(k\right)$$
$$n^2-m^2-n+m=\left(2n+k+1\right)\left(k\right)-2n$$
$$\left(n-m\right)\left(n+m-1\right)=\left(2n+k+1\right)\left(k\right)-2n$$
Let $w=n-m$ and $x=n+m+1$. Also note that $2n=w+x+1$
$$wx=\left(w+x+k+2\right)\left(k\right)-\left(w+x+1\right)$$
$$0=k^2+wk+xk+2k-wx-w-x-1$$
$$0=k^2+k\left(w+x+1\right)-\left(w+1\right)\left(x+1\right)$$
Through the quadratic formula, we get
$$k=\frac{-w-x-2 \pm \sqrt{\left(x+x+2\right)^2 -4\left(-\left(w+1\right)\left(x+1\right)\right)}}{2}$$
Essentially we need the $b^2-4ac$ term to be a perfect square, but first we'll consider $b^2$ and $b^2+4ac$
$$b^2+4ac=\left(w+x+2\right)^2 +4\left(-\left(w+1\right)\left(x+1\right)\right)=w^2-2wx+x^2=\left(x-w\right)^2$$
So $b^2+4ac$ is a perfect square.
$b^2$ is also a perfect square.
This means that if $b^2 -4ac$ is a perfect square, it is the last term in an arithmetic progression of squares which is what we were looking for in the first place.

This seems like all the ways of expressing a magic square I would find, so I decided to take a step back and try a different approach. Besides, I was getting really frustrated anyways
Image result for nichijou gifs popcorn

We need the 8 sums of the magic square to be equal.
$A+B+C=S$
$D+E+F=S$
$G+H+I=S$
$A+D+G=S$
$B+E+H=S$
$C+F+I=S$
$A+E+I=S$
$C+E+G=S$

If the following are true:
$B+H=D+F=2E$
$B+D=2I$
$B+F=2G$
$H+D=2C$
$H+F=2A$

then
$A+B+C=\frac{H+F}{2}+\left(D+F-H\right)+\frac{H+D}{2}=\frac{3F+3D}{2}$
$A+D+G=\frac{H+F}{2}+D+\frac{B+F}{2}=\frac{2D+B+H+2F}{2}=\frac{3F+3D}{2}$
$D+E+F=\frac{2D+2E+2F}{2}=\frac{3D+3F}{2}$
$A+E+I=\frac{H+F}{2}+\frac{D+F}{2}+\frac{B+D}{2}=\frac{2D+B+H+2F}{2}=\frac{3F+3D}{2}$
This continues for all 8 sums we need.

In squares where $B+H=D+F=2E$, we can say $B<D<F<H$ without loss of generality

(By "without loss of generality," I mean a square with $B+H=D+F=2E$ but not $B<D<F<H$ can just be rotated or reflected so that $B<D<F<H$)

We can express the magic square of squares as 6 arithmetic sequences of squares:
$b^2,e^2,h^2$
$d^2,e^2,f^2$
$b^2,i^2,d^2$
$b^2,g^2,f^2$
$d^2,c^2,h^2$
$f^2,a^2,h^2$

Here's my best attempt to visually represent this

Each rectangle is an arithmetic progression of size 3 and each letter is an entry. Let's also give each progression a name.

Each rectangle can be related to another rectangle in a couple of ways

  1. First terms match
  2. Middle terms match
  3. Last terms match
  4. Last term of one matches first term of other
If we draw out these relationships, we get
Where the red line mean the first terms match, green lines mean the middle terms match, blue lines mean the last terms match. and white arrows go from an arithmetic progression whose last term matches the first term of the arithmetic progression it goes to.

An arithmetic progression $r^2,s^2,t^2$ can also be expressed as a Pythagorean triple $X^2+Y^2=Z^2$ through
$r=Y-X$
$s=Z$
$t=X+Y$

For the white arrow this means that $X_1+Y_1=Y_2-X_2$
which we can find in Stifel and Ozanam sequence.

A Stifel sequence generates all primitive triples in the Plato family
$$1\frac13 , 2\frac25 , 3\frac37 ...$$
to get the triples, express them as an improper fraction
$$\frac43 , \frac{12}{5} , \frac{24}{7}...$$
and we get
$3^2+4^2=5^2$, $5^2+12^2=13^2$, $7^2 + 24^2 = 25^2$...

Also notice that $3+4=12-5$, $5+12=24-7$...

This means we would draw white arrows between arithmetic progressions of squares generated by consecutive terms in this progression.

A Ozanam sequence generates all primitve triples in the Pythagoras family
$$1\frac78 , 2\frac{11}{12} , 3\frac{15}{16}...$$
to get the triples, express them as an improper fraction
$$\frac{15}{8} , \frac{35}{12} , \frac{63}{16}...$$
and we get $8^2+15^2=17^2$, $12^2+35^2=37^2$, and $16^2+63^2=65^2$

Again notice that $8+15=35-12$, $12+35=63-16$...


This means we would draw white arrows between arithmetic progressions of squares generated by consecutive terms in this progression.

The primitive triples in the Fermat family have $Y-X=1$ which would yield $1$ as an entry in the magic square of squares. Morgenstern proved that 1 cannot be an entry in a magic square of squares, so we don't need to consider the Fermat family.

So we know to draw arrows between consecutive terms of the Stifel and Ozanam sequences, but should we draw any arrows between them?

We would need
the $X+Y$ of the nth term of Stifel = $Y-X$ of the mth term of Ozanam
$2n^2+4n+1=4m^2+4m-1$
let $n=m+k$
$2m^2+4mk+2k^2+4m+4k+1=4m^2+4m-1$
$0=-2k^2-4mk-4k+2m^2-2$
$0=k^2+k\left(2m+2\right)+\left(1-m^2\right)$
By the quadratic formula, we get
$$\frac{-2m-2 \pm \sqrt{4\left(m+1\right)^2+4\left(m^2-1\right)}}{2}$$
$$-m-1 \pm \sqrt{2\left(m\right)\left(m+1\right)}$$
So we need to prove that $2\left(m\right)\left(m+1\right)$ is a perfect square

By reversing Dickson's method, we can find values for $m$
If there are $u,v,w$ such that $w^2=2uv$, then there is a Pythagorean triple can be made by
$x=w+u$
$y=w+v$
$z=w+u+v$

If we reverse this so that $u=m$ and $v=m+1$, we are looking for a Pythagorean triple where $y-x=1$, or in other words, one from the Fermat family.

So Pythagorean triples from the Fermat family dictate where we can draw arrows from the Stifel sequence to the Ozanam sequence, but what about from the Ozanam sequence from the Stifel sequence?

We would need
$Y-X$ of the nth term of Stifel = $X+Y$ of the mth term of Ozanam
$2n^2-1=4m^2+12m+7$
let $n=m+k$
$2m^2+4mk+2k^2-1=4m^2+12m+7$
$0=-2k^2-4mk+2m^2+12m+8$
$0=k^2+k\left(2m\right)+\left(-6m-m^2-4\right)$
By the quadratic formula,
$$k=\frac{-2m \pm \sqrt{4m^2+4\left(6m+m^2+4\right)}}{2}$$
$$k=-m \pm \sqrt{2\left( m+1\right)\left(m+2\right)}$$

We again use reverse Dickson's method to find that we must find a Pythagorean triple from the Fermat family.

If we visualize Stifel and Ozanam sequences then we get

Our work with arrows between the two sequence would mean that later on we would see multiple of something similar to

So far, I've only considered primitive triples, only considered the white arrow, and only considered Plato and Pythagoras families. So there's a lot to learn.

And that's where I'm currently at.

Here we have a calculator that will let you see the nth triple of the Plato, Pythagoras, or Fermat family. Just enter $n>0$ and select which family you want. For large values of $n$, the Fermat family triples get very large. So large in fact that the programming variables overflow. For $n>20$ it doesn't work properly and for $n>402$ it says "infinity^2 + infinity^2 = infinity^2." Just something I found funny.