Ok, so I think I found a neat way to solve a $4\times4$ regular magic square (A regular square has one of each number from $0$ to $n^2-1$ and is base $n$. So here's how I did it. We have $16$ possible combinations. So first I enter the $00, 11, 22$ and $33$ into the diagonal of the $4\times4$ matrix so that I now have some restrictions on every row and column. Then I set the $(B,1)$ position to $23$ and the $(A,2)$ position with $32$. It would of course work if I switched the positions of the $23$ and the $32$.
Now after this, its like a sudoku game of filling it in and we get a regular square which is magic of course. Now why exactly does this work? I have a vague idea but I wanted to know if this has been done.
Now I think it can, but can this be generalized for any $n\times n$ magic square?
