Magic squares of squares over a finite field
A magic square M M over an integral domain D D is a 3 × 3 3\times 3 matrix with entries from D D such that the elements from each row, column, and diagonal add to the same sum. If all the entries in M M are perfect squares in D D , we call M M a magic square of squares over D D . In 1984, Martin LaBar raised an open question: “Is there a magic square of squares over the ring Z \mathbb {Z} of the integers which has all the nine entries distinct?” We approach to answering a similar question when D D is a finite field. We claim that for any odd prime p p , a magic square over Z p \mathbb Z_p can only hold an odd number of distinct entries. Corresponding to LaBar’s question, we show that there are infinitely many prime numbers p p such that, over Z p \mathbb Z_p , magic squares of squares with nine distinct elements exist. In addition, if p ≡ 1 ( mod 120 ) p\equiv 1\pmod {120} , there exist magic squares of squares over Z p \mathbb Z_p that have exactly 3, 5, 7, or 9 distinct entries respectively. We construct magic squares of squares using triples of consecutive quadratic residues derived from twin primes.