### A mathematical model for constructing magic squares

#### Abstract

In this paper, we develop a goal programming model that can be used to construct a magic square of any kind. A magic square is an m x m square array of numbers consisting of the first m^{2} distinct positive integers arranged such that the sum of numbers in every row, every column, and every diagonal is the same number known as the magic total (or magic constant). The commonly used method for constructing magic squares are the Siamese method and Lozenge method for odd order square, the LUX method for singly even order square, and the cross diagonals method for doubly even order square. None of these methods uses a mathematical formula in the construction of the magic squares but uses the rule of thumb. The model developed in this paper is tested on the 3 x 3 magic square and is found to work perfectly well.

**How to Cite this Article:**Effanga Okon Effanga, Uwe Etim Edeke, A mathematical model for constructing magic squares, J. Math. Comput. Sci., 3 (2013), 466-481 Copyright © 2013 Effanga Okon Effanga, Uwe Etim Edeke. This is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

Copyright ©2022 JMCS