A magic square is recorded in the Ta Tai Li Chi, compiled
by Tai the Elder in the first century before or after the Christian
era, in China. The book gives a sequence of the numbers 2, 9,
4, 7, 5, 3, 6, 1, 8, which, when arranged in a square having three
rows of three cells each, proves to be a magic square of order
three (Fig. 1.1). This is the first instance of magic squares so
far known to us. There are later occasional references to the
same magic square, or its variations, in Chinese literature, but
it is not until the 13th century that magic squares of higher orders
appear in China. Ting I-Tung discusses in his Ta Yen So Yin
(ca. A.D. 1270) the relationship between numbers and I (divination),
by using a number of diagrams made of numerical
figures and dots, among which occur magic squares of order
three and nine. Yang Hui records in his Hsii Ku Chai Ch'i Suan
Fa (written in A.D. 1274 but published in A.D. 1378) magic
squares of order three to ten.
The first example hitherto known of a magic square of
order four occurs in the Brhatsanzhita (ca. A.D. 550), written by
Varahamihira, an Indian authority on astronomy and divination
(Fig. 1.3). The Kaksaputa, a work on magic ascribed to the
famous Buddhist philosopher Nagarjuna (2nd century A.D.),
contains a magic square of order four, but the authenticity of the
work is doubtful. Varahamihira's square is made of two sets of
the natural numbers 1 to 8. One of the four possible forms
(Fig. 1.4a) of the original square reconstructed from Varahamihira's
square, with a rotation of 90 degrees, coincides exactly with
the famous Islamic square (Fig. 1.5), that al-Bani (d. A.D. 1225)
and al-Zinjani (ca. A.D. 1250) used frequently as a basic pattern
for talismans. This cannot be a mere coincidence because
880 magic squares of order four are known to exist. This seems
to indicate that magic squares were transmitted from India to
the Islamic world either directly, or, as in the case of chess
(Indian caturariga), by way of Persia. It is also interesting that
Varahamihira calls his square kacchaputa(=kaksaputa)or the
carapace of a turtle. This immediately reminds one of the
title of the above-mentioned work ascribed to Nagarjuna, as well
as of the old Chinese legend that, when the Emperor Yii visited
the river Lo, a miraculous turtle, on the back of which a diagram
called the Lo Shu was written, came out of the river. The
diagram was interpreted as a magic square of order three by
later Chinese writers from the 10th century onward (Fig. 1.2a),
although the original form of the Lo Shu itself can no longer be
reconstructed on a well-documented basis.
In the Islamic world discovery of magic squares is often
connected with the ancient Greeks. According to al-Bani, for
example, the above-mentioned Islamic square of order four was
invented by the philosopher Plato. None of those Islamic
legends, however, is verified in the Greek literature. It is certain
that Theon of Smyrna (2nd century A.D.) made use of a natural
square of nine cells in order to illustrate the significant position
that the number five occupies among the natural numbers from
one to nine (Fig. 1.6), but he seems not to have been aware of the
concept of magic squares.
In India a magic square of order three appears for the first
time in Vrnda's medical work, Siddhayoga (ca. A.D. 900), although
a legend asserts that Garga (in the first century before or after
the Christian era?), a legendary authority on divination, recommended
the use of magic squares of order three in order to
pacify the nine planets (navagrahas). Vrnda recommends his
magic square (Fig. 1.7) to women in labor for an easy delivery.
The same usage of magic squares was recorded also in the
Islamic world from the 9th century A.D. onward. Al-Tabari,
for example, describes it in his medical work, Firdaus al-hikma
(A.D. 850), and adds that it was his father's prescription.
Magic squares of order five and higher appear for the first
time in the Rasa'il of the Ikhwan al-Safa' (ca. A.D. 983), an
encyclopaedic work on Islamic theology. The book illustrates
magic squares of order three to nine. It seems that there was no
general method for constructing those squares, but the Muslims
seem to have begun to investigate general construction methods
at about the same time. In fact, several rules of Ibn al-Haytham
(ca. A.D. 965-1039) and al-Isfard'ini (d. ca. A.D. 1120) have
been handed down to us in an Arabic manuscript. It is, however,
in the works of al-Buni and al-Zinjani that fully generalized
methods are stated. Interestingly, they flourished in the same
century as Ting I-Tung and Yang Hui. About the same time
a magic square of order six, which had been constructed according
to the framing method of the Muslims and incised on
an iron plate with Arabic numerals, was transmitted to China.
A little later in India Thakkura Pherii and Narayana gave
general methods in their mathematical works, Ganitasara (ca.
A.D. 1315) and Ganitakaurnudi (A.D. 1356), respectively.
Narayana, in particular, discusses magic squares in a systematic
fashion, and correctly gives the number 384 of pandiagonal
magic squares of order four.
Their elder contemporary, Moschopoulos (ca. A.D. 1300),
of Byzantin, also gave general methods, in which Islamic influences
are evident. For example, he uses the reversed form of
the above-mentioned Islamic square of order four as a basic
pattern for constructing his evenly-even magic squares. Similarities
with Indian methods are also found in his methods. It is
probable that he transmitted magic squares from the Orient to
Europe, but his exact role has yet to be investigated.
As has been mentioned above, Indian and Islamic peoples
used magic squares of order three for magical effects in obstetrics,
and in China magic squares were studied in connection with I
(divination). Magic squares certainly had "magical" significances
in those days, and it is highly probable that knowledge
of magic squares, and especially their construction methods, were
transmitted only orally. That generalized construction methods
began to be written down and published in the 13th and the 14th
centuries in the Islamic world, China, Byzantin, and India may
imply that magic squares were losing their secrecy almost
simultaneously throughout the Old World.
In Europe "planetary" squares, which too have their roots in
the Islamic world, are mentioned even in the 15th and the 16th
centuries, but from the 17th century onward magic squares began
to attract purely mathematical minds, such as Fermat, Frenicle
and Euler. It is in the same centuries that Japanese mathematicians,
Takakazu Seki (A.D. 1642-1708) and others, began to study
them under the influence of the Yang Hui Suan Fa and Ch'eng
Ta-Wei's Suan Fa T'ung Tsung (A.D. 1593).
I have restricted this study to the periods before the 17th
century. It should be noted also that, except for Indian literature,
I have relied mainly on secondary sources. This is
especially so in the case of Arabic literature, for which I owe
much to Ahrens, Bergstrasser, Hermelink, Saidan, Cammann,
Schuster, and Sesiano, through their articles.
Chapter 1 is an introduction, and gives a brief sketch of the
history of magic squares before the 17th century; Chapter 2 is
a chronological table of authors of magic squares; Chapter 3 is
an alphabetical list of the authors referred to in Chapter 2
(under each item the following information is given: 1) original
sources, 2) descriptions of the magic squares, 3) secondary
sources, and 4) references to the list in Chapter 5). In Chapter
4 I classify the construction methods actually prescribed by the
ancient and medieval authors, and describe each of them with
illustrations; and Chapter 5 is an annotated list of all the magic
squares, as far as I know, that belong to the periods before the
17th century, according to their dimensions and constant sums.