You are on page 1of 14

Fun with numbers-2

Hello friends, welcome back to one more episode of Fun with


numbers!
Let us know how to construct magic squares

Have you heard of magic squares? I am sure all of you know what a
magic square is!
A magic square is a n x n grid (n is an odd number) in which natural
numbers between and including 1 to n2 (pronounced as n square and
is equal to n x n) are filled in the grid cells such that the sum of the
numbers in any horizontal, vertical or diagonal rows is same.
Here ‘n’ is called the order of the grid.
As an illustration. let us consider a grid of order 3. It has 3x3=9 cells.
Each cell is to be filled with a number. Thus we have 32 (pronounced as
three square and is equal to 3x3) = 9 numbers (1 to 9).
We fill the cells in this 3x3 grid as shown below:
8 1 6 The sum of the digits in each row, column and the
diagonals is same. In this case the sum is 15.
3 5 7
How often you wished to have a technique to
4 9 2
construct your own magic squares! I am sure many of
us do even now.
Today I am going to show you a simple method to construct magic
squares. This is valid for grid of odd order. The method is simple and
by regular practice you will become a master and impress others too!
For a correctly constructed magic square:

The middle number is always half of the sum of first and the last numbers.
For a grid of order 5 (5x5 magic square), the first number is 1 and the last
number is 25. Hence the middle number is (1+25)/2 = 13
For a grid of order 7 (7x7 magic square), the first number is 1 and the last
number is 49. Hence the middle number is (1+49)/2 = 25
(See the next slide).
The sum of the digits in any row, column or diagonal can also be predicted.
The sum is nx(n2+1)/2 where n is the order of the grid. This is valid only when
we use natural numbers in succession.
The sum is also given by n x middle number
The sum is also given by half of sum of the first and last digits multiplied by
the order of the grid.
Before describing the method, I will show you two more magic
squares as a teaser! 7x7 magic square
Magic sum is
5x5 magic square given by product 30 39 48 1 10 19 28
of middle number
17 24 1 8 15 and the order of 38 47 7 9 18 27 29
the grid
23 5 7 14 16 46 6 8 17 26 35 37
4 6 13 20 22 13 x 5 = 65
5 14 16 25 34 36 45
10 12 19 21 3 13 15 24 33 42 44 4
11 18 25 2 9 25 x 7 = 175
21 23 32 41 43 3 12
Magic sum is: 65 for the 5x5 grid 22 31 40 49 2 11 20
Magic sum is 175 for the 7x7 grid
Let us construct a magic square of order 5 (5x5 grid)
Middle number will be 13 and the magic sum will be 65

1 1 1 1

5 5

4 4 6

3 3 3

2 2 2

1. Start from the first row 2. Then come to the last row 4. Proceed to the first cell 6. Come down by one cell
middle cell. Write 1 there. and shift to the adjacent cell of the same row on the left and write the next number.
on right. Write 2 there. edge and go up to the next
3. Then proceed diagonally higher cell in the same
to right filling each cell with column. Write the next
subsequent numbers until number.
you come to the right edge. 5. Proceed diagonally
upward to right filling each
cell with subsequent
numbers until you come to
a filled cell.
1 8 1 8 1 8 1 8 15

5 7 5 7 5 7 5 7 14

4 6 4 6 4 6 4 6 13

3 3 10 3 10 12 3

2 2 9 11 2 9 11 2 9

7. Again proceed diagonally 9. If it is the cell in the first 10. Proceed to the first cell 12. Again proceed
to right filling each cell with row AND NOT the last cell of the same row on the diagonally to right filling
subsequent numbers until in the first row, come to the left edge and go up to the each cell with subsequent
you come to a filled cell or last row and shift to the next higher cell in the numbers until you come to
the top edge. adjacent cell on right. Write same column. Write the a filled cell or the top edge.
8. If it is a filled cell repeat the next number there. next number.
the steps 6 and 7. 11. As the diagonal cell on
(Step 6: Come down by one right is filles, write the next
cell and write the next number in the cell
number immediately below.
1 8 15 17 1 8 15 17 1 8 15 17 1 8 15

5 7 14 16 5 7 14 16 5 7 14 16 5 7 14 16

4 6 13 4 6 13 4 6 13 4 6 13 20

10 12 3 10 12 3 10 12 3 10 12 19 3

11 2 9 11 2 9 11 18 2 9 11 18 2 9
13. If it is the last cell of the
first row, come down by one 14. Go to the first cell of the same row on the left edge and go up to the next higher cell in
cell and write the next the same column. Write the next number.
number. Go to the first cell of From here, it is repetition of the previous steps. See the figures and you will understand the
the same row on the left edge sequence. Repeat the steps until you exhaust all the cells.
and go up to the next higher
cell in the same column.
Write the next number.
17 1 8 15 17 1 8 15 17 24 1 8 15 17 24 1 8 15

5 7 14 16 5 7 14 16 23 5 7 14 16 23 5 7 14 16

4 6 13 20 4 6 13 20 22 4 6 13 20 22 4 6 13 20 22

10 12 19 21 3 10 12 19 21 3 10 12 19 21 3 10 12 19 21 3

11 18 2 9 11 18 2 9 11 18 2 9 11 18 25 2 9

Repeating the steps to fill all the cells in the 5x5 grid Last step: Write the last
number as indicated above.
Start You are done!
17 24 1 8 15
If you have filled all the cells correctly, you will notice
23 5 7 14 16
that the last number will be in the same column as the
first number (middle cell of the last row). The middle By regular practice,
4 6 13 20 22
number will always be average of the first and last filling becomes very
numbers of the row, column or diagonal containing the 10 12 19 21 3 easy and you can do it
middle cell. pretty fast!
11 18 25 2 9
End
Magic square of 7x7 grid. Fill 1 to 49 numbers in the cells. Middle number is 25 and the sum is 25 x 7 = 175

1 1 1 1
7
6
5 5
4 4 4
3 3 3
2 2 2

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

1 10 19 28 1 10 19 28 30 1 10 19 28 30 1 10 19 28
7 9 18 27 7 9 18 27 29 7 9 18 27 29 7 9 18 27 29
6 8 17 26 6 8 17 26 6 8 17 26 6 8 17 26
5 14 16 25 5 14 16 25 5 14 16 25 5 14 16 25
13 15 24 4 13 15 24 4 13 15 24 4 13 15 24 4
21 23 3 12 21 23 3 12 21 23 3 12 21 23 3 12
22 2 11 20 22 2 11 20 22 2 11 20 22 31 2 11 20
30 1 10 19 28 30 1 10 19 28 30 39 1 10 19 28 30 39 1 10 19 28
7 9 18 27 29 7 9 18 27 29 38 7 9 18 27 29 38 7 9 18 27 29
6 8 17 26 35 6 8 17 26 35 37 6 8 17 26 35 37 6 8 17 26 35 37
5 14 16 25 34 5 14 16 25 34 36 5 14 16 25 34 36 5 14 16 25 34 36
13 15 24 33 4 13 15 24 33 4 13 15 24 33 4 13 15 24 33 42 4
21 23 32 3 12 21 23 32 3 12 21 23 32 3 12 21 23 32 41 3 12
22 31 2 11 20 22 31 2 11 20 22 31 2 11 20 22 31 40 2 11 20

30 39 1 10 19 28 30 39 1 10 19 28 30 39 48 1 10 19 28 30 39 48 1 10 19 28
38 7 9 18 27 29 38 7 9 18 27 29 38 47 7 9 18 27 29 38 47 7 9 18 27 29
6 8 17 26 35 37 6 8 17 26 35 37 46 6 8 17 26 35 37 46 6 8 17 26 35 37
5 14 16 25 34 36 5 14 16 25 34 36 45 5 14 16 25 34 36 45 5 14 16 25 34 36 45
13 15 24 33 42 4 13 15 24 33 42 44 4 13 15 24 33 42 44 4 13 15 24 33 42 44 4
21 23 32 41 43 3 12 21 23 32 41 43 3 12 21 23 32 41 43 3 12 21 23 32 41 43 3 12
22 31 40 2 11 20 22 31 40 2 11 20 22 31 40 2 11 20 22 31 40 49 2 11 20

Done!
Magic square of 9x9 grid Sum = 41x9= 369 Magic square of 11x11 grid Sum = 61x11 = 671

68 81 94 107 120 1 14 27 40 53 66
47 58 69 80 1 12 23 34 45
80 93 106 119 11 13 26 39 52 65 67
57 68 79 9 11 22 33 44 46
92 105 118 10 12 25 38 51 64 77 79
67 78 8 10 21 32 43 54 56
104 117 9 22 24 37 50 63 76 78 91
77 7 18 20 31 42 53 55 66
116 8 21 23 36 49 62 75 88 90 103
6 17 19 30 41 52 63 65 76
7 20 33 35 48 61 74 87 89 102 115
16 27 29 40 51 62 64 75 5
19 32 34 47 60 73 86 99 101 114 6
26 28 39 50 61 72 74 4 15
31 44 46 59 72 85 98 100 113 5 18
36 38 49 60 71 73 3 14 25
43 45 58 71 84 97 110 112 4 17 30
37 48 59 70 81 2 13 24 35
55 57 70 83 96 109 111 3 16 29 42
Try these out yourself. 56 69 82 95 108 121 2 15 28 41 54
Savour and enjoy the thrill!!!
Interesting information about magic squares
Magic squares can be constructed with any series of numbers. They need not always start with 1.
They can start with any number and they need not increase always by 1. Only requirement is that the numbers should
be increased/decreased by a constant figure through out. Even negative numbers and zero can be used. In all the cases,
the middle number will always be half of the sum of the first and last numbers.
The magic sum will always be middle number x grid order or product of the order of the grid and half of the sum of first
and last digits. Let us take the magic square of 3x3 grid with order 3 to illustrate these observations.
Last digit is given by a + (n2-1) x d where ‘a’ is the first number, ‘n’ is the order of the grid and ‘d’ is the step difference
between numbers.

8 1 6 22 1 16 40 5 30
Natural Numbers from 1 Numbers from 5
numbers from 3 5 7 to 25 with step 7 13 19 to 45 with step 15 25 35
1 to 9. increase by 3. increase by 5.
Sum is 5x3 = 15 4 9 2 Sum is 13x3 = 39 10 25 4 Sum is 25x3 = 75 20 45 10

7 0 5 4 -10 0 -8 -1 -6
Numbers from 0 Numbers from Numbers from -1
to 8 with step -10 to 6 with step -6 -2 2 to -9 with step -3 -5 -7
2 4 6
increase by 1. increase by 2. decrease by 1.
Sum is 4x3 = 12 Sum is -2x3 = -6 -4 6 -8 Sum is -5x3 = -15 -4 -9 -2
3 8 1
The method described here is valid for odd number grid order magic
squares.
For example, it is valid for 3x3, 5x5, 7x7 etc. magic squares.
For even number order magic squares an altogether different method is
used.
I will describe this in my next video.

I hope you liked the video and the method of constructing magic squares.
Fun with numbers is always enjoyable and gives enough challenge to
inquisitive minds

Please like the video and subscribe and tell your friends to watch.
Wait for my next video.

You might also like