Abū’l-Wafāʾ al-Būzjānī and magic squares

8 February 2026

Abū’l-Wafāʾ al-Būzjānī (940–77/8 CE) wrote one of the earliest extant treatises dedicated to magic squares, focused on constructions. He repeatedly referred to the aesthetic value of the methods of he described.1

For instance, he wrote about a method of constructing a magic square of order $4$:

‘It is possible to arrive at the magic arrangement in this square by means of methods without displacement showing regularity and elegance [niẓām wa-tartīb ḥasan نظام وترتيب حسن]’ (trans. Sesiano)2

Such a method with ‘regularity and elegance’ was: (1) place the number $1$ in a corner, $2$ and $3$ adjacent to the opposite corner, and $4$ diagonally adjacent to $1$; (2) place $5$ to $8$ in reverse order in positions horizontally symmetrically opposite to $1$ to $4$; (3) place $17 − n$ diagonally two places away from $n$ for $n = 1,\ldots,8$:

Three stages in building a 4×4 magic square whose rows are 8,11,14,1; 10,5,4,15; 3,16,9,6; 13,2,7,12. In the first stage, the numbers 1 to 4 are placed as described in the text; in the second, the numbers 5 to 8. In the last stage, the remaining numbers are placed. The last stage also indicates how the rows, columns, and diagonals sum to 34.

His method, which had ‘regularity and elegance’ was to be contrasted with ‘displacement’ (or rearrangement) methods. One such method was as follows: (1) start with a square filled naturally with the numbers $1$ to $16$; (2) swap the middle two entries between the outer rows and between the outer columns; (3) swap the middle two entries within each outer row and each outer column.

Three stages in building a 4×4 magic square whose rows are 4,14,15,1; 9,7,6,2; 5,11,10,8; 16,2,3,13. In the first stage, the numbers 1 to 16 are placed starting at the top right and proceeding leftwards along each row. In the second stage, the middle two entries have been swapped between the outer rows and between the outer columns. In the last stage, the middle two entries are swapped within the outer rows and outer columns. The last stage also indicates how the rows, columns, and diagonals sum to 34.

For Abū’l-Wafāʾ, absence of displacement was not a necessary condition for elegance, since he characterized a method for constructing a magic square of order $6$ involving displacement using exactly the same form of words: ‘showing regularity and elegance’.2

In mediaeval Arabic, the equal sum of each row, column, and diagonal was often simply called the ‘harmony’ [wafq لوفق] or ‘harmonious number’ [ʿadad al-wafq العدد الوفق]. The adjective ‘wafq’ has the sense of ‘harmonious’ or ‘fitting’, which hints at aesthetic appreciation.3

The term ‘magic square’, common in European languages (mágico, magique, magisches, magisk, magiczny, …), comes from their introduction to European thought via a treatise by Ibn al-Zarqālluh (al-Zarqālī/Azarquiel; d. 1100) on their use in talismanic magic.4

Notes

  1. A. J. Cain. Form & Number: A History of Mathematical Beauty. Lisbon, 2024. pp. 179–80. 

  2. Abū’l-Wafāʾ al-Būzjānī. ‘On Magic Arrangement in Squares’. In: J. Sesiano Magic Squares in the Tenth Century: Two Arabic Treatises by Anṭākī and Būzjānī. Sources and Studies in the History of Mathematics and Physical Sciences. Springer, 2017. ISBN978-3-319-52113-8. DOI10.1007/978-3-319-52114-5. pp. 217–19.  2

  3. B. Hallum. New Light on Early Arabic Awfāq Literature. In: L. Saif, F. Leoni, M. Melvin-Koushki & F. Yahya, eds. ‘Islamicate Occult Sciences in Theory and Practice’. Handbook of Oriental Studies: Section One: The Near and Middle East, no.140. Leiden & Boston: Brill, 2020. ISBN978-90-04-42696-2. p. 88, n. 80. 

  4. J. Samsó. ‘al-Zarḳālī, Abū Isḥāḳ Ibrāhīm’. In: Encyclopaedia of Islam, vol. XI. Ed. by P. J. Bearman, Th. Bianquis, C. E. Bosworth, E. van Donzel & W. P. Heinrichs. Leiden: Brill, 2002. ISBN978-90-04-12756-2. p. 462. 

Image source

«
Fibonacci, Archimedes, π, beauty, proof, and misunderstanding
Al-Kūhī on geometrical constructions and mathematical beauty
»