# ^NEW^ Magic Lines 3.6 Full 51

In recreational mathematics, a square array of numbers, usually positive integers, is called a magic square if the sums of the numbers in each row, each column, and both main diagonals are the same.[1][2] The 'order' of the magic square is the number of integers along one side (n), and the constant sum is called the 'magic constant'. If the array includes just the positive integers 1 , 2 , . . . , n 2 \displaystyle 1,2,...,n^2 , the magic square is said to be 'normal'. Some authors take magic square to mean normal magic square.[3]

## ^NEW^ Magic Lines 3.6 Full 51

Magic squares that include repeated entries do not fall under this definition and are referred to as 'trivial'. Some well-known examples, including the Sagrada Família magic square and the Parker square are trivial in this sense. When all the rows and columns but not both diagonals sum to the magic constant this gives a semimagic square' (sometimes called orthomagic square).

While ancient references to the pattern of even and odd numbers in the 33 magic square appears in the I Ching, the first unequivocal instance of this magic square appears in the chapter called Mingtang (Bright Hall) of a 1st-century book Da Dai Liji (Record of Rites by the Elder Dai), which purported to describe ancient Chinese rites of the Zhou dynasty.[5] [6][7][8] These numbers also occur in a possibly earlier mathematical text called Shushu jiyi (Memoir on Some Traditions of Mathematical Art), said to be written in 190 BCE. This is the earliest appearance of a magic square on record; and it was mainly used for divination and astrology.[5] The 33 magic square was referred to as the "Nine Halls" by earlier Chinese mathematicians.[7] The identification of the 33 magic square to the legendary Luoshu chart was only made in the 12th century, after which it was referred to as the Luoshu square.[5][7] The oldest surviving Chinese treatise that displays magic squares of order larger than 3 is Yang Hui's Xugu zheqi suanfa (Continuation of Ancient Mathematical Methods for Elucidating the Strange) written in 1275.[5][7] The contents of Yang Hui's treatise were collected from older works, both native and foreign; and he only explains the construction of third and fourth-order magic squares, while merely passing on the finished diagrams of larger squares.[7] He gives a magic square of order 3, two squares for each order of 4 to 8, one of order nine, and one semi-magic square of order 10. He also gives six magic circles of varying complexity.[9]

The 33 magic square first appears in India in Gargasamhita by Garga, who recommends its use to pacify the nine planets (navagraha). The oldest version of this text dates from 100 CE, but the passage on planets could not have been written earlier than 400 CE. The first dateable instance of 33 magic square in India occur in a medical text Siddhayog (c. 900 CE) by Vrnda, which was prescribed to women in labor in order to have easy delivery.[17]

The oldest dateable fourth order magic square in the world is found in an encyclopaedic work written by Varahamihira around 587 CE called Brhat Samhita. The magic square is constructed for the purpose of making perfumes using 4 substances selected from 16 different substances. Each cell of the square represents a particular ingredient, while the number in the cell represents the proportion of the associated ingredient, such that the mixture of any four combination of ingredients along the columns, rows, diagonals, and so on, gives the total volume of the mixture to be 18. Although the book is mostly about divination, the magic square is given as a matter of combinatorial design, and no magical properties are attributed to it. The special features of this magic square were commented on by Bhattotpala (c. 966 CE)[18][17]

The square of Varahamihira as given above has sum of 18. Here the numbers 1 to 8 appear twice in the square. It is a pan-diagonal magic square. Four different magic squares can be obtained by adding 8 to one of the two sets of 1 to 8 sequence. The sequence is selected such that the number 8 is added exactly twice in each row, each column and each of the main diagonals. One of the possible magic squares shown in the right side. This magic square is remarkable in that it is a 90 degree rotation of a magic square that appears in the 13th century Islamic world as one of the most popular magic squares.[19]

The construction of 4th-order magic square is detailed in a work titled Kaksaputa, composed by the alchemist Nagarjuna around 10th century CE. All of the squares given by Nagarjuna are 44 magic squares, and one of them is called Nagarjuniya after him. Nagarjuna gave a method of constructing 44 magic square using a primary skeleton square, given an odd or even magic sum.[18] The Nagarjuniya square is given below, and has the sum total of 100.

The Nagarjuniya square is a pan-diagonal magic square. The Nagarjuniya square is made up of two arithmetic progressions starting from 6 and 16 with eight terms each, with a common difference between successive terms as 4. When these two progressions are reduced to the normal progression of 1 to 8, the adjacent square is obtained.

As far as is known, the first systematic study of magic squares in India was conducted by Thakkar Pheru, a Jain scholar, in his Ganitasara Kaumudi (c. 1315). This work contains a small section on magic squares which consists of nine verses. Here he gives a square of order four, and alludes to its rearrangement; classifies magic squares into three (odd, evenly even, and oddly even) according to its order; gives a square of order six; and prescribes one method each for constructing even and odd squares. For the even squares, Pheru divides the square into component squares of order four, and puts the numbers into cells according to the pattern of a standard square of order four. For odd squares, Pheru gives the method using horse move or knight's move. Although algorithmically different, it gives the same square as the De la Loubere's method.[17]

The next comprehensive work on magic squares was taken up by Narayana Pandit, who in the fourteenth chapter of his Ganita Kaumudi (1356) gives general methods for their construction, along with the principles governing such constructions. It consists of 55 verses for rules and 17 verses for examples. Narayana gives a method to construct all the pan-magic squares of fourth order using knight's move; enumerates the number of pan-diagonal magic squares of order four, 384, including every variation made by rotation and reflection; three general methods for squares having any order and constant sum when a standard square of the same order is known; two methods each for constructing evenly even, oddly even, and of squares when the sum is given. While Narayana describes one older method for each species of square, he claims the method of superposition for evenly even and odd squares and a method of interchange for oddly even squares to be his own invention. The superposition method was later re-discovered by De la Hire in Europe. In the last section, he conceives of other figures, such as circles, rectangles, and hexagons, in which the numbers may be arranged to possess properties similar to those of magic squares.[18][17] Below are some of the magic squares constructed by Narayana:[18]

The order 8 square is interesting in itself since it is an instance of the most-perfect magic square. Incidentally, Narayana states that the purpose of studying magic squares is to construct yantra, to destroy the ego of bad mathematicians, and for the pleasure of good mathematicians. The subject of magic squares is referred to as bhadraganita and Narayana states that it was first taught to men by god Shiva.[17]

The 11th century saw the finding of several ways to construct simple magic squares for odd and evenly-even orders; the more difficult case of evenly-odd case (n = 4k + 2) was solved by Ibn al-Haytham with k even (c. 1040), and completely by the beginning of 12th century, if not already in the latter half of the 11th century.[22] Around the same time, pandiagonal squares were being constructed. Treaties on magic squares were numerous in the 11th and 12th century. These later developments tended to be improvements on or simplifications of existing methods. From the 13th century on wards, magic squares were increasingly put to occult purposes.[22] However, much of these later texts written for occult purposes merely depict certain magic squares and mention their attributes, without describing their principle of construction, with only some authors keeping the general theory alive.[22] One such occultist was the Algerian Ahmad al-Buni (c. 1225), who gave general methods on constructing bordered magic squares; some others were the 17th century Egyptian Shabramallisi and the 18th century Nigerian al-Kishnawi.[27]

Unlike in Persia and Arabia, better documentation exists of how the magic squares were transmitted to Europe. Around 1315, influenced by Arab sources, the Greek Byzantine scholar Manuel Moschopoulos wrote a mathematical treatise on the subject of magic squares, leaving out the mysticism of his Middle Eastern predecessors, where he gave two methods for odd squares and two methods for evenly even squares. Moschopoulos was essentially unknown to the Latin Europe until the late 17th century, when Philippe de la Hire rediscovered his treatise in the Royal Library of Paris.[36] However, he was not the first European to have written on magic squares; and the magic squares were disseminated to rest of Europe through Spain and Italy as occult objects. The early occult treaties that displayed the squares did not describe how they were constructed. Thus the entire theory had to be rediscovered.

Magic squares had first appeared in Europe in Kitāb tadbīrāt al-kawākib (Book on the Influences of the Planets) written by Ibn Zarkali of Toledo, Al-Andalus, as planetary squares by 11th century.[32] The magic square of three was discussed in numerological manner in early 12th century by Jewish scholar Abraham ibn Ezra of Toledo, which influenced later Kabbalists.[37] Ibn Zarkali's work was translated as Libro de Astromagia in the 1280s,[38] due to Alfonso X of Castille.[39][32] In the Alfonsine text, magic squares of different orders are assigned to the respective planets, as in the Islamic literature; unfortunately, of all the squares discussed, the Mars magic square of order five is the only square exhibited in the manuscript.[40][32]