Explainer
Nārāyaṇa’s knight
Pandiagonal magic squares by the knight’s move
चतुरङ्गतुरगगत्या द्वौ द्वौ श्रेढीसमुद्भवावङ्कौ ।
न्यस्य क्रमोत्क्रमेण च कोष्ठैक्यैकान्तरेण च तौ ॥
सव्यासव्यतुरङ्गमरीत्या कोष्ठान् प्रपूरयेदङ्कैः ।
समगर्भे षोडशगृहभद्रे प्रोक्तो विधिश्चायम् ॥
तिर्यक्कोष्ठगतानामूर्ध्वस्थानां च कर्णगानां च ।
अङ्कानां संयोगः पृथग् मिथो जायते तुल्यः ॥
caturaṅgaturagagatyā dvau dvau śreḍhīsamudbhavāv aṅkau |
nyasya kramotkrameṇa ca koṣṭhaikyaikāntareṇa ca tau ||
savyāsavyaturaṅgamarītyā koṣṭhān prapūrayed aṅkaiḥ |
samagarbhe ṣoḍaśagṛhabhadre prokto vidhiś cāyam ||
tiryakkoṣṭhagatānām ūrdhvasthānāṃ ca karṇagānāṃ ca |
aṅkānāṃ saṃyogaḥ pṛthag mitho jāyate tulyaḥ ||
In the manner of the chessboard, set down the numbers of the progression two by two, in adjoining cells and in alternate cells, in direct and in reverse order; then by the horse’s move to right and to left fill the cells with the numbers. This method for the square of sixteen cells was stated by earlier teachers too. The numbers in the horizontal cells, in the vertical cells and in the diagonal cells, added up separately, come to the same total.
Gaṇitakaumudī, chapter 14, rules 10–12 in Padmākara Dvivedī’s edition · 1356, after the translation of Datta and Singh
What the verses say
The last chapter of the Gaṇitakaumudī, the bhadragaṇita, treats magic squares at length, and for the square of sixteen cells it gives a method that Nārāyaṇa says earlier teachers had taught. Lay the numbers from 1 to 16 out in pairs, in adjoining and in alternate cells, running forward and backward by turns; then fill the square by moving as the horse moves on the chessboard, to the right and to the left. His example asks for the square made from 1 to 16, whose numbers add to 136, so that each row, column and diagonal must come to 34, and he gives two answers. The first is
1, 8, 13, 12; 14, 11, 2, 7; 4, 5, 16, 9; 15, 10, 3, 6,
row by row. In both squares the two main diagonals sum to 34, and so do the six broken diagonals that wrap from one edge of the square to the other. Squares with that property are now called pandiagonal, and the knight’s-move squares have been favourites of Indian astrologers for centuries.
Nārāyaṇa also counts them. With 1 in the first cell the method gives twenty-four squares, which he lists, and as many again for each other starting number, so that the worked solution counts 384. That is exactly the number of pandiagonal squares of order four, a fact proved by Rosser and Walker in 1938 and, more simply, by T. Vijayaraghavan in 1941.
The instrument
The numbers are not placed in their natural order. Nārāyaṇa first arranges them in pairs, 1 2 4 3, 8 7 5 6, 10 9 11 12, 15 16 14 13, and within each group of four the successive numbers lie a knight’s move apart, the square being wrapped round so that its edges meet; each new group starts afresh. The instrument names the next number of that order and outlines the cells a knight’s move from the last one placed; a second order gives his other square, and “any order” lets you try arrangements of your own. The sums of the rows, columns and diagonals update as you go, broken diagonals included, and a finished square is checked for all of them. The two buttons fill in Nārāyaṇa’s own squares.
Sources
- The Gaṇita Kaumudī of Nārāyaṇa Paṇḍita, Part II, edited by Padmākara Dvivedī (Princess of Wales Sarasvati Bhavana Texts 57, Benares, 1942), pp. 358–361.
- Bibhutibhusan Datta and Avadhesh Narayan Singh, “Magic squares in India”, revised by K.S. Shukla, Indian Journal of History of Science 27 (1992), pp. 51–120.
- Takanori Kusuba, Combinatorics and Magic Squares in India: A Study of Nārāyaṇa Paṇḍita’s Gaṇitakaumudī, Chapters 13–14 (PhD dissertation, Brown University, 1993).
- B. Rosser and R.J. Walker, “On the transformation group for diabolic magic squares of order four”, Bulletin of the American Mathematical Society 44 (1938), pp. 416–420; T. Vijayaraghavan, “On Jaina magic squares”, The Mathematics Student 9 (1941), pp. 97–102.