I got a task in programming a program that can detect whether a 4x4 square is a magic square or not. At first, I wrote code that met the requirements for all given examples but I noticed one flaw. I used 2 variables to indicate sums. I used them once to calculate the sums of the rows and columns and compare them, then I reset them back to 0 and used them to calculate the diagonal sums and check if they were equal. The thing was, is that I did not actually compare the diagonal sums to the original row and column sums, and that got me thinking. Can there exist a "magic square" where the diagonal sums are equal and the row and column sums are equal, but the diagonal sums are different from the row and column sums? Is there any actual way to prove this? I tried to come up with examples but nothing came to me. An example would disprove this and make me rewrite my code. For simplicity, I would rather know about a 4x4 square, but if you can I'll be happy to hear a proof for any $n$ x $n$ square. Thanks in advance.
Edit: I already check to see if the integers are all different, so I'd rather know if one exists where all of the integers are different.
I wrote a program to search for $4\times 4$ examples by brute force. Here is one. $$\begin{matrix} 1&11&10&12\cr 3&15&7&9\cr 14&2&13&5\cr 16&6&4&8\cr \end{matrix}$$