According to legend, as the Sage King Yu the Great (d. 2197 B.C.E.) stood on the banks of the Luo River, a tortoise emerged from the water bearing on its undershell a 3x3 array of the numbers 1 through 9 encoded in dots. The numbers were placed as in the diagram on the cover above. Yu was astonished to find that the numbers in each row, the numbers in each column, and the numbers in each of the two diagonals had the same sum. This was the Luoshu, the unique (up to rotations and reflections) perfect magic square of order three. It was interpreted as a supernatural sign of order in the universe.
I like to imagine an alternate explanation: a mathematically inclined child playing with pebbles in the sand by the riverbank wishes to preserve in more permanent form a newly discovered numerical pattern, and carves it into the softer lower shell of a tortoise. Perhaps it gives the child pleasure to think of the pattern making its slow, hidden way along the riverbank for years. It seems to me, you see, that a God would have had no trouble carving the array into the harder upper shell, where it would be more likely to be noticed by passing Sage Kings.
Whether carved by Heaven or a budding mathematician, the Luoshu played an extraordinary role in Chinese thought for the next four thousand years. The first half of this book chronicles a wide variety of its appearances. Mingtang temples were built with nine rooms in a 3x3 array numbered as in the Luoshu, which were thought of as representing both the nine palaces of heaven and the nine provinces of China. Daoists thought of the odd numbers in the central cross as yang numbers and the even numbers as yin numbers, with the Luoshu representing a state of balance and harmony between them. The Daoist dance known as the "steps of Yu" was built from the Luoshu-123 giving an out-and-back motion from the lower center to the upper right and back to the middle left, 456 a long sweep from the upper left to the lower right, and 789 a symmetrical out-and-back motion toward the lower right. The martial art t'ai chi used the Luoshu to describe positions; 852, for example, is the classic position where energy flows from the rear leg through the waist to the forward hand. In popular culture the Luoshu was used in charms, in fortune-telling, and in the art of fengshui.
Although the 3x3 magic square was an object of great ceremonial and metaphysical importance, magic squares in general were not objects of mathematical investigation in China until the time of Yang Hui, who in 1275 published a compilation which included magic squares of orders up through nine and a collection of fascinating interlocking magic circles.
The second half of Swetz's book gives brief accounts of the development of magic squares in other cultures and a "miscellanea" of other topics loosely related to the Luoshu. In India, the Luoshu seems to have first appeared about 400 C.E. in a book on divination, where it was recommended as a tool to pacify the nine planets. Magic squares of order four are engraved in Jaina temple complexes dating from about 1200. The most widely used method of constructing magic squares of any odd order, known in the West as De la Loubere's method of 1693, was clearly described by Hindu mathematicians several centuries earlier. Magic squares were embraced in Islam for their mystical and therapeutic properties, and were studied by mathematicians like Thabit ibn Qurra, Ibn Sina and al-Biruni. Through Islam, they were transmitted to Europe in the fifteenth century in the form of seven magic squares of order 3 through order 9, representing the planets from the Moon (the Luoshu) to Saturn (order 9).
If you like numerical patterns, you should also look at Clifford Pickover's The Zen of Magic Squares, Circles and Stars (Princeton University Press, 2002, reviewed in the AMS Notices, March 2003). It contains a much wider collection of examples, more magic figure lore and more mathematical argument than Swetz's slender volume, and it is probably more popularly written. On the other hand, Swetz's history is careful and balanced, while Pickover's is — shall we say — more impressionistic.
The other distinctive feature of Swetz's book is his respectful treatment of the metaphysical ideas associated with the Luoshu and other magic squares in many cultures, but most extensively in Chinese culture. For him, numerology is not something to look back at (or down on) from an enlightened modern viewpoint, but a window into culture. The numerical order in the Luoshu absorbed and came to symbolize fundamental religious and cosmological beliefs in ancient China in a way which deeply affected lives at many levels. The modern viewpoint might even be cause for regret: "By the 19th century, the magic square that had dominated early Chinese cosmological thinking... had been reduced in status to a mathematical curiosity, a mere intellectual diversion."
Phil Straffin (email@example.com) is Thomas White Professor of Mathematics at Beloit College, where he regularly teaches a course on mathematics in other cultures. His survey of Chinese mathematics from the third to the fifth century C.E. appeared as "Liu Hui and the First Golden Age of Chinese Mathematics," in Mathematics Magazine (volume 71 (1998), pages 163-181).