Thank you for your interest in NCTM’s Illuminations. Beginning in mid-April, all Illuminations content will be moving to Interactives will remain openly available and NCTM members will have access to all Illuminations lessons with new filtering and search options. We hope you will continue to utilize and enjoy these resources on

Pin it!
Google Plus

Magic Squares

  • Lesson
Number and OperationsAlgebra
Dawn L. Anderson
Athens, GA

This lesson explores magic squares from both a historical and mathematical perspective. The mathematical analysis leads into symbolic algebraic representation of the patterns. This lesson is based upon an article from the April 2001 edition of Mathematics Teaching in the Middle School. 

Magic squares have long been considered a mathematical recreation providing entertainment and an interesting outlet for creating mathematical knowledge. An nth-order magic square is a square array of n2 distinct integers in which the sum of the n numbers in each row, column, and diagonal is the same. The magic lies in the fact that the numbers in each row, column, and diagonal always sum to the same number, called the magic constant. Below is an example of a third-order magic square with a magic constant of 15. 

655 square third order

A third-order magic square

A Brief History of Magic Squares 

Magic squares have a rich history dating to around 2200 B.C. A Chinese myth claimed that while the Chinese Emperor Yu was walking along the Yellow River, he noticed a tortoise with a unique diagram on its shell (see the picture to the right). The Emperor decided to call the unusual numerical pattern lo shu. The earliest magic square on record, however, appeared in the first-century book Da-Dai Liji.

655 turtleMagic squares in China have been used in various areas of study, including astrology; divination; and the interpretation of philosophy, natural phenomena, and human behavior. Magic squares also permeated other areas of Chinese culture. For example, Chinese porcelain plates on display in museums and private collections were decorated with Arabic inscriptions and magic squares. 

Magic squares most likely traveled from China to India, then to the Arab countries. From the Arab countries, magic squares journeyed to Europe, then to Japan. Magic squares in India served multiple purposes other than the dissemination of mathematical knowledge. For example, Varahamihira used a fourth-order magic square to specify recipes for making perfumes in his book on seeing into the future, Brhatsamhita (ca. 550 A.D.). The oldest dated third-order magic square in India appeared in Vrnda's medical work Siddhayoga (ca. 900 A.D.), as a means to ease childbirth. 

The construction of 
magic squares 
is an amusement 
of great antiquity. 
 -Major P. A. MacMahon 

Little is known about the beginning of research on magic squares in Islamic mathematics. Treatises in the ninth and tenth centuries revealed that the mathematical properties of magic squares were already developed among what were then Islamic Arabic-speaking nations. Further, history suggests that the introduction of magic squares was entirely mathematical rather than magical. The ancient Arabic designation for magic squares, wafq ala'dad, means "harmonious disposition of the numbers." Later, during the eleventh and twelfth centuries, Islamic mathematicians made a grand leap forward by proposing a series of simple rules to create magic squares. The thirteenth century witnessed a resurgence in magic squares, which became associated with magic and divination. This idea is illustrated in the following quotation by Camman, who speaks of the spiritual importance of magic squares: 

If magic squares were, in general, small models of the Universe, now they could be viewed as symbolic representations of Life in a process of constant flux, constantly being renewed through contact with a divine source at the center of the cosmos. (Prussin 1986, p. 75) 

Considerable interest in magic squares was also evident in West Africa. Magic squares were interwoven throughout the culture of West Africa. The squares held particular spiritual importance and were inscribed on clothing, masks, and religious artifacts. They were even influential in the design and building of homes. In the early eighteenth century, Muhammad ibn Muhammad, a well-known astronomer, mathematician, mystic, and astrologer in Muslim West Africa, took an interest in magic squares. In one of his manuscripts, he gave examples of, and explained how to construct, odd-order magic squares. 

During the fifteenth century, the Byzantine writer Manuel Moschopoulos introduced magic squares in Europe, where, as in other cultures, magic squares were linked with divination, alchemy, and astrology. The first evidence of a magic square appearing in print in Europe was revealed in a famous engraving by the German artist Albrecht Durer. In 1514, Durer incorporated a magic square into his copperplate engraving Melencolia I in the upper-right corner. 

Chen Dawei of China launched the beginning of the study of magic squares in Japan with the import of his book Suan fa tong zog, published in 1592. Because magic squares were a popular topic, they were studied by most of the famous wasan, who were Japanese mathematics experts. In Japanese history, the oldest record of magic squares was evident in the book Kuchi-zusam, which described a 3-by-3 square. 

During the seventeenth century, serious consideration was given to the study of magic squares. In 1687-88, a French aristocrat, Antoine de la Loubere, studied the mathematical theory of constructing magic squares. In 1686, Adamas Kochansky extended magic squares to three dimensions. During the latter part of the nineteenth century, mathematicians applied the squares to problems in probability and analysis. Today, magic squares are studied in relation to factor analysis, combinatorial mathematics, matrices, modular arithmetic, and geometry. The magic, however, still remains in magic squares.

Pheru's Method of Constructing Magic Squares  

The first known mathematical use of magic squares in India was by Thakkura Pheru in his work Ganitasara (ca. 1315 A.D.). Pheru provided a method for constructing odd magic squares, that is, squares in which n is an odd integer. Start by placing the number 1 in the bottom cell of the central column (see the figure below). To obtain the next cell above it, add n + 1, getting n + 2. To obtain the next cell above n + 2, add n + 1 again, getting 2n + 3. Continuing to add in this way to obtain the cell values in the central column results in an arithmetic progression with a common difference of n + 1. Continue adding n + 1 until reaching the central column's top cell, which has a value of n2

655 pherus square

The first steps in Pheru's method for constructing odd-order magic squares

The remaining cells in the square are obtained by starting from the numbers in the central column. The figure below illustrates Pheru's method. Consider making a 9-by-9 magic square, hence n = 9. Pick any number in the central column, for example, 1. Add n to 1, in this example getting 9 + 1 = 10. Next move as a knight in chess would, beginning at 1 and moving one cell to the left, then two cells up. In this cell, place the 10. From this cell, repeat the same process. Add 10 + 9 to get 19, complete the knight move, and place 19 in the resulting cell. Continue this process until arriving at the cell with a value of 37. Adding 9 and completing the knight move places 46 outside of the original 9-by-9 square. To remedy this situation, pretend that you have 9-by-9 squares on each side and corner of the original 9-by-9 square. Notice that the cell where 46 is located is in the outside square above the original square and off to the left-hand corner. Simply move 46 to the corresponding cell in the original 9-by-9 square. 

655 square odd order

An odd-order magic square completed with a constant of 369 by using Pheru's method

When arriving at a number that exceeds 81, simply subtract 81 from the number. For example, locate 77 in figure 4. Adding 9 and completing the knight move arrives at a sum of 86, which is greater than 81 and so outside the original square. The difference between 86 and 81 is 5. Next place 5 in the corresponding cell in the original square. Continuing to follow these instructions, which were given by Pheru, produces a 9‑by‑9 magic square with a magic constant of 369. To summarize, to obtain the rest of the cells after finding the center column, move one cell to the left and two cells up while increasing the number by n. When this move causes a number to fall outside the square, move the number to its corresponding cell inside the square. When the number exceeds n2, subtract n2 from the number.

Using the Activity Sheet 

pdficonUncovering the Magic in Magic Squares Activity Sheet 

The Uncovering the Magic in Magic Squares Activity Sheet allows students to explore the magic in magic squares embedded in a historical context. The brief history outlined here gives teachers a starting point for the activities. 

The background for activity 2 is that Laghunandana, in his work on Hindu law, Smrtitattva (ca. 1500 A.D.), explained a method for constructing fourth-order magic squares, which were prescribed for specific purposes. For example, a magic square of order four with a magic constant of 84 was prescribed to soothe a crying child. The parent could find reprieve by constructing this particular magic square using Laghunandana's instructions. 

For activity 3, students will need to be shown Pheru's method of constructing an odd magic square. 

For activity 4, the student sheet contains a shortened version of the following explanation. Teachers may want to work through the example, explaining the historical context to students before they continue with the rest of the activity. A magic square is said to be normal if the n2 numbers are the first n2 positive integers. Antoine de la Loubere, who was the envoy of Louis XIV to Siam from 1687 to 1688, created a simple method for finding a normal magic square of any odd order. Students are shown the following method for a fifth-order magic square: 

Draw a square, and divide it into twenty-five cells (see the second figure on the activity sheet). Border the square with cells along the top and right edges, and shade the added cell in the top-right corner. Regard this shaded cell as occupied. Begin by writing 1 in the middle-top cell of the original square. The general rule is to proceed diagonally upward and to the right with successive integers. This rule has two exceptions. First, if you land in a cell that is out of the original square, then you can get back into the original square by shifting completely across the square, either from top to bottom or from right to left, and continuing with the general rule. Second, if you land in a cell that is already occupied, then you must write the number in the cell immediately beneath the one last filled, then continue with the general rule. 

When they have worked through the example for a fifth-order magic square, ask students to compare Loubere's method with Pheru's in activity 3. 


  • Gerdes, Paulus. Geometry from Africa: Mathematical and Educational Explorations. Washington, D.C.: Mathematical Association of America, 1999.
  • Andrews, W. S., et al. Magic Squares and Cubes. New York: Dover Publications, 1960.
  • Hayashi, Takao. "Magic Squares in Indian Mathematics." In Encyclopedia of the History of Science, Technology, and Medicine in Non-Western Cultures, edited by Helaine Selin, pp. 529-36. Dordrecht, Netherlands: Kluwer Academic Publishers, 1997.
  • Michiwaki, Yoshimasa. "Magic Squares in Japanese Mathematics." In Encyclopedia of the History of Science, Technology, and Medicine in Non-Western Cultures, edited by Helaine Selin, pp. 538-40. Dordrecht, Netherlands: Kluwer Academic Publishers, 1997.
  • Prussin, Labelle. Hatumere: Islamic Design in West Africa. Berkeley, Calif.: University of California Press, 1986.
  • Sesiano, Jacques. "Magic Squares in Islamic Mathematics." In Encyclopedia of the History of Science, Technology, and Medicine in Non-Western Cultures, edited by Helaine Selin, pp. 536-37. Dordrecht, Netherlands: Kluwer Academic Publishers, 1997.
  • Zaslavsky, Claudia. Africa Counts: Number and Pattern in African Culture. Brooklyn N.Y.: Lawrence Hill Books, 1979.
  • Yoke, Ho Peng. "Magic Squares in Chinese Mathematics." In Encyclopedia of the History of Science, Technology, and Medicine in Non-Western Cultures, edited by Helaine Selin, pp. 528-29. Dordrecht, Netherlands: Kluwer Academic Publishers, 1997.

Assessment Option 

You may wish to collect the activity sheets to assess your students.  

Solutions to the Activity Sheet  

1a. The magic square is of the fifth order because its dimensions are 5 by 5. 

1b. The magic constant is 65 because each row, column, and diagonal sums to 65. 

2a. A fourth-order magic square with a magic constant of 34 was used to protect travelers. 

655 square fourth order

Solution for Activity Sheet Question 2a.

2b. A fourth-order magic square with a magic constant of 64 was used to protect warriors. 

655 square fourth constant

Solution for Activity Sheet Question 2b.

3. The following is a solution for n = 5. 

655 square n equals five

Solution for Activity Sheet Question 3

4. The following is a third order magic square using de la Loubere's method. 

655 square laLoubere

Solution for Activity Sheet Question 4



  1. An extension activity would be to first find the formula for the magic constant of an nth-order normal magic square, which is [n(n2 + 1)] / 2 , and then to find the formula for the middle number of an nth order normal magic square, which is 
    (n2 + 1)/2.
  2. Magic squares are deeply woven throughout African culture. Magic squares were seen in the artwork, dress, and living spaces of African people. They were also used for divination purposes. Students can investigate this topic further by using the Internet or beginning with the following sources, then write a brief report and present their findings to the class. 
    • Gerdes, Paulus. Geometry from Africa: Mathematical and Educational Explorations. Washington, D.C.: Mathematical Association of America, 1999.
    • Prussin, Labelle. Hatumere: Islamic Design in West Africa. Berkeley, Calif.: University of California Press, 1986.
    • Zaslavsky, Claudia. Africa Counts: Number and Pattern in African Culture. Brooklyn, N.Y.: Lawrence Hill Books, 1979. 

Learning Objectives

Students will be able to:

  • Use operations with integers to solve problems.
  • Analyze and represent patterns with symbolic rules.

NCTM Standards and Expectations

  • Develop meaning for integers and represent and compare quantities with them.
  • Develop and use strategies to estimate the results of rational-number computations and judge the reasonableness of the results.
  • Represent, analyze, and generalize a variety of patterns with tables, graphs, words, and, when possible, symbolic rules.

Common Core State Standards – Mathematics

Grade 7, The Number System

  • CCSS.Math.Content.7.NS.A.3
    Solve real-world and mathematical problems involving the four operations with rational numbers.

Grade 7, Expression/Equation

  • CCSS.Math.Content.7.EE.B.3
    Solve multi-step real-life and mathematical problems posed with positive and negative rational numbers in any form (whole numbers, fractions, and decimals), using tools strategically. Apply properties of operations to calculate with numbers in any form; convert between forms as appropriate; and assess the reasonableness of answers using mental computation and estimation strategies. For example: If a woman making $25 an hour gets a 10% raise, she will make an additional 1/10 of her salary an hour, or $2.50, for a new salary of $27.50. If you want to place a towel bar 9 3/4 inches long in the center of a door that is 27 1/2 inches wide, you will need to place the bar about 9 inches from each edge; this estimate can be used as a check on the exact computation.

Common Core State Standards – Practice

  • CCSS.Math.Practice.MP2
    Reason abstractly and quantitatively.
  • CCSS.Math.Practice.MP6
    Attend to precision.
  • CCSS.Math.Practice.MP8
    Look for and express regularity in repeated reasoning.