a magic square is a square with a special arrangement of numbers such that the numbers in each row as column and the for example aA3 X 3 magic square of number 129 can be arranged following
Now, at the arrangement of the number
carefully.
If you arrange the given numbers in an
ascending order, you get 1,2,3,4,5,6,7,8,
9 where 5 is the number that lies, exactly
in the middle
26 2o the above magic Squone notice that 3
is right in the middle of the square.
Let us now look at the dig diagonals, 2,5,8
5-2=3; 8-5=3
Similarly the anther diagonals : 6,3,4
6-5=1; 5-4=
And second row
9-5-4, 5-1=4
Answers
Answered by
4
Step-by-step explanation:
of order n is an arrangement of n2 numbers, usually distinct integers, in a square, such that the n numbers in all rows, all columns, and both diagonals sum to the same constant. A magic square contains the integers from 1 to n2.
The constant sum in every row, column and diagonal are called the magic constant or magic sum, M. The magic constant of a normal magic square depends only on n and has the following value:
M = n(n2+1)/2
For normal magic squares of order n = 3, 4, 5, ...,
the magic constants are: 15, 34, 65, 111, 175, 260, ...
In this post, we will discuss how programmatically we can generate a magic square of size n. Before we go further, consider the below examples:
Similar questions