100% found this document useful (1 vote)
384 views27 pages

Magic Squares: An Indian Perspective

This document discusses the history of magic squares in India. It provides examples of different types of magic squares constructed by ancient Indian mathematicians, including pan-diagonal magic squares from the 1st century BCE and 550 CE. It also describes the classification of magic squares into different categories and methods used by mathematicians like Narayana Pandita in the 14th century to construct magic squares with specific properties.

Uploaded by

Shyam Mishra
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
384 views27 pages

Magic Squares: An Indian Perspective

This document discusses the history of magic squares in India. It provides examples of different types of magic squares constructed by ancient Indian mathematicians, including pan-diagonal magic squares from the 1st century BCE and 550 CE. It also describes the classification of magic squares into different categories and methods used by mathematicians like Narayana Pandita in the 14th century to construct magic squares with specific properties.

Uploaded by

Shyam Mishra
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
  • Study of Magic Squares in India
  • Magic Squares in India
  • Kakshuputa of Nagarjuna
  • Sarvatobhadra of Varahamihira
  • Jaina Magic Square
  • Ancient Method for Odd Squares
  • Bhadraganita of Narayana
  • Kuttaka and Magic Squares
  • Pandiagonal 4x4 Squares of Narayana
  • Samagarbha Magic Squares
  • Narayana's Folding Method for Samagarbha Squares
  • Modification for Odd Squares
  • Examples from Ramanujan's Notebook
  • References

STUDY OF MAGIC SQUARES IN INDIA

[Link]

Centre for Policy Studies
Chennai
mdsrinivas50@[Link]
MAGIC SQUARES IN INDIA

The first Chapter of Srinivasa Ramanujans Note Books
is on Magic Squares. It is said to be "much earlier than
the remainder of the notebooks."

T. Vijayaraghavan, in his article on Jaina Magic Squares
(1941) notes: "The author of this note learnt by heart at
the age of nine the following pan-diagonal square which
was taught to him by an elderly person who had not been
to school at all."

8 11 2 13
1 14 7 12
15 4 9 6
10 5 16 3

This shows the extraordinary popularity of Magic Squares
in India. Indian mathematicians specialized in the
construction of a special class of magic squares called
sarvatobhadra or pan-diagonal magic squares.

Pan-diagonal Magic Square: Apart from the sum of the
entries of each row, column and the principal diagonals, the
sum of all "broken diagonals" add up to the same magic
sum.
KAKAPUA OF NGRJUNA (c. 100 BCE)
V
0 1 0 8
0 9 0 2
6 0 3 0
4 0 7 0

n-3 1 n-6 8

n-3 1 n-5 8
n-7 9 n-4 2

n-6 9 n-4 2
6 n-8 3 n-1

6 n-7 3 n-1
4 n-2 7 n-9

4 n-2 7 n-8
Pan-diagonal with total 2n Total 2n+1

The following pan-diagonal magic square totaling to 100
has also been called Ngrjunya

30 16 18 36
10 44 22 24
32 14 20 34
28 26 40 6
SARVATOBHADRA OF VARHAMIHIRA (550 CE)
In the Chapter on Gandhayukti of Bhatsahit
Varhamihira describes the Sarvatobhadra perfumes
z?
? u
( > H
H "
" ~
?

~
2 3 5 8
u 5 8 2 3
4 1 7 6
7 6 " 4 1
In the above Kacchapua with sixteen cells, [are placed]
two parts of Agaru, three parts of Patra, five parts of
Turuka and eight parts of aileya in the cells of the first
row, .... When these are mixed in whatever way, there will
be 18 parts. To such a mixture are added Nakha ..., in equal
measures, and in this way the Sarvatobhadra are produced.
SARVATOBHADRA OF VARHAMIHIRA
As the commentator Bhaotpala (c.950) explains:
S
u ~ " ~-
" ?
+
S? u Sz
Sz z US
u " ? U
j ? :
In this kacchapua with 16 cells, when four substances are
mixed in whatever way: When the four substances with
their mentioned number of parts are mixed, then the total
will be 18 parts; this happens in the above kacchapua
when the perfumes are mixed from top to bottom (along the
columns) or horizontally (along the rows), along the four
directions, or the central quadrangle, or the four corner
cells, or the middle two cells of the first row together with
those of the last row; the middle two cells of the second and
third row or the first and last cells of the same, or in any
other manner. If the substances in such four cells are added
there will be 18 parts in all. ... Since, in whatever way they
are mixed, they lead to 18 parts, they are called
Sarvatobhadra.
SARVATOBHADRA OF VARHAMIHIRA

If we add

8 0 8 0
0 8 0 8
0 8 0 8
8 0 8 0

to the Sarvatobhadra of Varhamihira, we get

10 3 13 8
5 16 2 11
4 9 7 14
15 6 12 1

This belongs to a class of 4x4 pan-diagonal magic squares
studied by Nryaa Paita in Gaitakaumud (c.1356)

JAINA MAGIC SQUARE


7 12 1 14
2 13 8 11
16 3 10 5
9 6 15 4

Pan-diagonal magic square found in the Inscriptions at
Dudhai in Jhansi District (c. 11 the Century) and at the
Jaina Temple in Khajuraho (c. 12
th
Century)




ANCIENT INDIAN METHOD FOR ODD SQUARES

8 1 6
3 5 7
4 9 2

17 24 1 8 15
23 5 7 14 16
4 6 13 20 22
10 12 19 21 3
11 18 25 2 9

This method of proceeding along small diagonals
(alparuti) is described as an ancient method by Nryaa
Paita in Gaitakaumud (c.1356). Nryaa also displays
the eight 3x3 magic squares can be constructed this way.

De La Loubere, French Ambassador in Siam, wrote in 1693
that he learnt this Indian method from a French doctor
M Vincent who had lived in Surat.

BHADRAGAITA OF NRYAA (C.1356)

Chapter XIV of Gaitakaumud, titled Bhadragaita, is
devoted to a detailed mathematical study of magic squares.
?
"]
] u
-


H " q
j" "
" ]
Thus, a nxn magic square is Samagarbha if n = 4m,
Viamagarbha if n = 4m + 2, and Viama if n = 2m + 1,
where m =1, 2, 3 ...
The classification of Magic Squares in to Samagarbha,
Viamagarbha and Viama is also found in the Prkta
work Gaitasrakaumud of hakkura Pheru (c.1300)
KUAKA AND MAGIC SQUARES

Nryaa uses the following linear indeterminate equation
to determine the initial term a and the constant difference d
of the arithmetic progression to be used to fill an n x n
square in order to have the entries in each row and column
add to the sum S
nS = (n
2
/2) [a + a+( n
2
- 1) d ]

S = na + (n/2) (n
2
- 1) d
There exist (an infinite number of) integral solutions for a,
d, if S is divisible by gcd(n, (n/2)(n
2
-1)), i.e., if S is
divisible by n when n is odd, by n/2 for n even.
NryaaExample: S = 40 and n = 4.
40 = 4a +30d
a =-5, d = 2, or a =10, d = 0, or a =25, d = -2, etc.
-5 9 19 17

10101010 25 11 1 3
21 15 -3 7

10101010 -1 5 23 13
1 3 25 11

10101010 19 17 -5 9
23 13 -1 5

10101010 -3 7 21 15
PANDIAGONAL 4x4 SQUARES OF NRYAA
1 8 13 12
14 11 2 7
4 5 16 9
15 10 3 6

1 12 13 8
15 6 3 10
4 9 16 5
14 7 2 11

Pan-diagonal Magic Square: Apart from the sum of the
entries of each row, column and the principal diagonals, the
sum of all "broken diagonals" add up to the same number.
Nryaa Paita displayed 24 pan-diagonal 4x4 magic
squares, with the top left entry being 1.
Nryaa also remarked that (by permuting the rows and
columns cyclically) we can construct 384 pan-diagonal 4x4
magic squares with entries 1, 2, ..., 16.
Proved by [Link] and [Link] (1938)
Simpler proof due to [Link] (1941)
PROPERTIES OF PANDIAGONAL 4x4 MAGIC
SQUARES

Property 1: Let M be a pan-diagonal 4x4 magic square
with entries 1, 2, ..., 16, which is mapped on to the torus by
identifying opposite edges of the square. Then the entries of
any 2x2 sub-square formed by consecutive rows and
columns on the torus add up to 34.


1 12 13 8
15 6 3 10
4 9 16 5
14 7 2 11

1+12+15+6 = 1+12+14+7 = 34

Property 2: Let M be a 4x4 pan-diagonal magic square
with entries 1, 2, ..., 16, which is mapped on to the torus.
Then, the sum of an entry of M with another which is two
squares away from it along a diagonal (in the torus) is
always 17.

1+16 = 6+11 = 15+2 = 4+13 = 14+3 = 9+8 = 17
PROPERTIES OF PANDIAGONAL 4x4 MAGIC
SQUARES

The "neighbours" of an element of a 4x4 pan-diagonal
magic square (which is mapped on to the torus as before)
are the elements which are next to it along any row or
column. For example, 3, 5, 2 and 9 are the "neighbours" of
16 in the magic square below.


1 12 13 8
15 6 3 10
4 9 16 5
14 7 2 11


Property 3 (Vijayaraghavan): Let M be a 4x4 pan-
diagonal magic square with entries 1, 2, ..., 16, which is
mapped on to the torus. Then the neighbours of the entry 16
have to be the entries 2, 3, 5 and 9 in some order.

We can use the above properties to construct 4x4 pan-
diagonal magic squares starting with 1 placed in any
desired cell.

Proposition: There are precisely 384 pan-diagonal 4x4
magic squares with entries1, 2, ..., 16.
SAMAGARBHA MAGIC SQURES

This seems to be an old method for construction of
samagarbha or 4nx4n magic square from a 4x4 magic
square which is also described by hakkura Pheru and
Nryaa.

We illustrate this by constructing an 8x8 square following
the method given by hakkura Pheru.

We start with a pan-diagonal 4x4 square.

1 8 13 12
14 11 2 7
4 5 16 9
15 10 3 6

Then we proceed as follows.

1 5
2 6
4 8
3 7
9 13
10 14
12 16
11 15





1 32 5 28
2 31 6 27
4 29 8 25
3 30 7 26
9 24 13 20
10 23 14 19
12 21 16 17
11 22 15 18

Finally we arrive at the pan-diagonal 8x8 magic square


1 32 61 36 5 28 57 40
62 35 2 31 58 39 6 27
4 29 64 33 8 25 60 37
63 34 3 30 59 38 7 26
9 24 53 44 13 20 49 48
54 43 10 23 50 47 14 19
12 21 56 41 16 17 52 45
55 42 11 22 51 46 15 18


One of the properties of an 8x8 pan-diagonal magic square
seems to be that the sum of four alternating cells along any
diagonal adds to half the magic sum.

SAMAGARBHA MAGIC SQURES

Another version of this traditional method has been noted
Nryaa, who has given the following example of
construction of a 8x8 square from a 4x4 square.

1 8 13 12
14 11 2 7
4 5 16 9
15 10 3 6





The above construction does not lead to a pan-diagonal 8x8
magic square, even though we started with a pan-diagonal
4x4 square.
We slightly modify Nryaas procedure so that we obtain
a pan-diagonal 8x8 square from a pan-diagonal 4x4 square

1 8 13 12
14 11 2 7
4 5 16 9
15 10 3 6


1 2
8 7
16 15
9 10
3 4
6 5
14 13
11 12


1 32 49 48 2 31 50 47
56 41 8 25 55 42 7 26
16 17 64 33 15 18 63 34
57 40 9 24 58 39 10 23
3 30 51 46 4 29 52 45
54 43 6 27 53 44 5 28
14 19 62 35 13 20 61 36
59 38 11 22 60 37 12 21
NRYAAS FOLDING METHOD FOR
SAMAGARBHA SQUARES

z
Uq
?? U
z>



U
(SU S
++




NRYAAS FOLDING METHOD FOR
SAMAGARBHA SQUARES

Two samagarbha squares known as the coverer and the
covered are to be made. Their combination is to be
understood in the same manner as the folding of palms.
The mlapakti (base sequence) has an arbitrary first
term and constant difference and number of terms equal
to the order of the magic square. Another similar
sequence is called the parapakti (other sequence). The
quotient of phala (desired magic sum) decreased by the
sum of the mlapakti when divided by the sum of the
parapakti [is the gua]. The elements of the parapakti
multiplied by that gives the guapakti. The two
sequences mlapakti and guapakti are reversed after
half of the square is filled. The cells of the coverer are
filled horizontally and those of the covered vertically.
Half of the square is filled [by the sequence] in order
and the other half in reverse order. The way of
combining magic square is here enunciated by the son
of Nhari.
Nryaas Example 1: 4x4 Square adding to 40
Mlapakti: 1, 2, 3, 4
Parapakti: 0, 1, 2, 3
Gua = [40 - (1+ 2+ 3+ 4)] / [0+1+2+3] = 5
Guapakti: 0, 5, 10, 15
The chdya (covered) and chdaka (coverer) are

2 3 2 3 5 0 10 15
1 4 1 4 10 15 5 0
3 2 3 2 5 0 10 15
4 1 4 1 10 15 5 0
Sampukaraa (folding) gives
2+15 3+10 2+0 3+5

17 13 2 8
1+0 4+5 1+15 4+10

1 9 16 14
3+15 2+10 3+0 2+5
=
18 12 3 7
4+0 1+5 4+15 1+10

4 6 19 11

Nryaa also displays the other square which is obtained
by interchanging the covered and the coverer.

This method leads to a pan-diagonal magic square.
Nryaas Example 2: 8x8 Square adding to 260
Mlapakti: 1, 2, 3, 4, 5, 6, 7, 8
Parapakti: 0, 1, 2, 3, 4, 5, 6, 7
Gua = [260 - (1+ 2+ +8)] / [0+1+2++7] = 8
Guapakti: 0, 8, 16, 24, 32, 40, 48, 56
The chdya and chdaka are

Sampukaraa gives

NRYAAS FOLDING METHOD
FOR ODD SQUARES

u
S
+ ? +
zU zq zU>
U uz

Two sequences referred to as the mlapakti and the
guapakti are to be determined as earlier. The first
number should be written in the middle cell of the top
row and below this the numbers of the sequence in
order. The rest of the numbers are to be entered in
order from above. The first number of the second
sequence is to be written in the same way [in the
middle cell of the top row]; the second etc. numbers are
also to be written in the swame way. The rule of
combining the covered and the coverer is also the same
as before.
Example: 5x5 Square adding to 65
Mlapakti: 1, 2, 3, 4, 5
Parapakti: 0, 1, 2, 3, 4
Gua = [65 - (1+ 2+ 3+ 4+ 5)] / [0+1+2+3+4] = 5
Guapakti: 0, 5, 10, 15, 20
The chdya and chdaka are

4 5 1 2 3 15 20 0 5 10
5 1 2 3 4 20 0 5 10 15
1 2 3 4 5 0 5 10 15 20
2 3 4 5 1 5 10 15 20 0
3 4 5 1 2 10 15 20 0 5
Sampukaraa gives
4+10 5+5 1+0 2+20 3+15

14 10 1 22 18
5+15 1+10 2+5 3+0 4+20

20 11 7 3 24
1+20 2+15 3+10 4+5 5+0
=
21 17 13 9 5
2+0 3+20 4+15 5+10 1+5

2 23 19 15 6
3+5 4+0 5+20 1+15 2+10

8 4 25 16 12
Nryaas method happens to be an instance of combining
two Mutually Orthogonal Latin Squares. However, it does
not yield a pan-diagonal magic square as the diagonal
elements of the squares are not all different.
MODIFICATION OF NRYAAS FOLDING
METHOD FOR ODD SQUARES

We may modify the above prescription and construct pan-
diagonal magic squares for all orders n 5 as follows:
Example: Pan-diagoanl 5x5 Square adding to 65
Mlapakti: 1, 2, 3, 4, 5
Parapakti: 0, 1, 2, 3, 4
Gua = [65 - (1+ 2+ 3+ 4+ 5)] / [0+1+2+3+4] = 5
Guapakti: 0, 5, 10, 15, 20

The chdya and chdaka are now chosen as
2 4 1 3 5

5 15 0 10 20
3 5 2 4 1

10 20 5 15 0
4 1 3 5 2

15 0 10 20 5
5 2 4 1 3

20 5 15 0 10
1 3 5 2 4

0 10 20 5 15
Sampukaraa gives
2+20 4+10 1+0 3+15 5+5

22 14 1 18 10
3+0 5+15 2+5 4+20 1+10

3 20 7 24 11
4+5 1+20 3+10 5+0 2+15
=
9 21 13 5 17
5+10 2+0 4+15 1+5 3+20

15 2 19 6 23
1+15 3+5 5+20 2+10 4+0

16 8 25 12 4
The above square is clearly pan-diagonal.
EXAMPLES FROM RAMANUJANS NOTEBOOK

The above happens to be an example of Nryaas folding
method for odd squares.


The second example above is same as Nryaas folding
method for doubly even squares.
EXAMPLES FROM RAMANUJANS NOTEBOOK

REFERENCES
1. De La Loubere, Description Du Royaume De Siam, Paris, 1693, Tome II,
p.235-288.
2. Gaitakaumud of Nryaa Paitas, Ed. by Padmkara Dvivedi, 2
Vols, Varanasi 1936, 1942.
3. B. Rosser and R. J. Walker, On the Transformation Groups of Diabolic
Magic Squares of Order Four, Bull. Amer. Math. Soc., 44, 1938, 416-
420.
4. T. Vijayaraghavan, On Jaina Magic Squares, The Mathematics Student, 9
(3), 1941, 97-102.
5. B. Datta and A. N. Singh (Revised by K. S. Shukla), Magic Squares in
India, Ind. Jour. Hist. Sc. 27, 1992, 51-120.
6. T. Kusuba, Combinatorics and Magic-squares in India: A Study of
Nryaa Paitas Gaita-kaumud, Chapters 13-14, PhD Dissertation,
Brown University 1993.
7. Paramanand Singh, The Gaitakaumud of Nryaa Paita: Chapter
XIV, English Translation with Notes, Gaita Bhrat, 24, 2002, 34-98.
8. Gaitasrakaumud of hakkura Pheru, Ed. with Eng. Tr. and Notes by
SaKHYa (S. R. Sarma, T. Kusuba, T. Hayashi, and M. Yano), Manohar,
New Delhi, 2009.
9. Raja Sridharan and M. D. Srinivas, Study of Magic Squares in India , in
R. Sujatha et al ed., Math Unlimited: Essays in Mathematics, Taylor &
Francis, London 2011, pp. 383-391.

STUDY OF MAGIC SQUARES IN INDIA 
 
 
M.D.SRINIVAS 
 
Centre for Policy Studies 
Chennai 
mdsrinivas50@gmail.com
MAGIC SQUARES IN INDIA 
 
The first Chapter of Srinivasa Ramanujan’s Note Books 
is on Magic Squares. It is said to be "much
KAKúAPUòA OF NĀGĀRJUNA (c. 100 BCE) 
अकर् इन्दुिनधा नारी तेन लᲨ िवनासनम्। 
0 
1
0 
8 
0 
9
0 2 
6 
0
3 
0 
4 
0
7 
0 
 
n-3 1
SARVATOBHADRA OF VARĀHAMIHIRA (550 CE) 
In 
the 
Chapter 
on 
Gandhayukti 
of 
Bçhatsaühitā  
Varāhamihira  describes the Sar
SARVATOBHADRA OF VARĀHAMIHIRA 
As the commentator Bhaññotpala (c.950) explains: 
अिस्मन् षोडशके षोडशकको᳧के कच्छपुटे यथा तथा य
SARVATOBHADRA OF VARĀHAMIHIRA 
 
If we add 
 
8 
0 
8 
0 
0 
8 
0 
8 
0 
8 
0 
8 
8 
0 
8 
0 
 
to the Sarvatobhadra of Varāh
JAINA MAGIC SQUARE 
 
 
7 
12 
1 
14 
2 
13 
8 
11 
16 
3 
10 
5 
9 
6 
15 
4 
 
Pan-diagonal magic square found in the Inscr
ANCIENT INDIAN METHOD FOR ODD SQUARES 
 
8 
1 
6 
3 
5 
7 
4 
9 
2 
 
17 
24
1 
8 
15
23 
5 
7 
14
16
4 
6 
13 
20
22
10 
12
BHADRAGAöITA OF NĀRĀYAöA (C.1356) 
 
Chapter XIV of Gaõitakaumudī, titled Bhadragaõita, is 
devoted to a detailed mathematica
KUòòAKA AND MAGIC SQUARES 
 
Nārāyaõa uses the following linear indeterminate equation 
to determine the initial term a and t

You might also like