magic: using the numpy() library to construct a magic matrix whose rows, columns, diagonals and antidiagonals all have a common sum. Simple commands allow us to check all the sums. We only consider magic matrices with an odd number of rows and columns. The even case is much harder to construct.
Lecture notes: