MAGICSQUARE (Size,FirstNumber,GammaIncrement,Plus2Increment)
- is the size of the magic square.
- is the value of the first number.
- is the value of the gamma increment.
- is the value of the plus2 increment.
Description
- This function gives the table values of a magic square.
- A magic square contains set of numbers that is arranged in same number of rows and columns such that the sum of each row,column and the front and back main diagonals are the same value.
- There are many ways to find the magic square values.
- Also all the values are existing for magic square other than the 2x2 matrix.
- Because it is impossible to construct the magic square of size 2.
- Let the order of the magic square is n.
- According to that the magic square is of three main types:
1. Odd number. 2. Singly even 3. Doubly even.
- Let the magic square of order n.
- Odd number: It means that the magic square with the order of odd numbers.
- To determine the sum of any normal magic square we use the formula: .
- Singly even : It means the number which is divisible by 2 but not by 4.
- There is no magic square constructed by 2x2 square matrix , so singly even magic square is constructed for 6,10,14 and so on.
- So the formula for generating the singly even numbers is: .
- The formula for magic sum for the singly even magic square is: .
- Doubly even: It means the number which is divisible by 4.
- So doubly even square is constructed for 4,8,12 and so on.
- The formula for magic sum for the doubly even magic square is: .
- In , is the size of the magic square.
- is the starting number which is indicating the numbers have to start from.
- is the gamma increment and is the plus 2 increment.
- The formulas for the magic square is:
- Let square size = ,First number = ,Gamma increment = ,and Plus two increment = .
*Pure Sum=(1/2)(M)(M^2+1). *First number total=M(F-1). *CT=1+2+..M. *Gamma increment total(GIT)=(CT-M){M(GI-1)}. *PIT(Plus2 Increment Total )=(CT-M)(PI-1). *SET(singly even total)=(M*M/2)(PI-GI) for singly even, 0 otherwise. *Calculated Magic Sum = PS + FT + GIT + PIT + SET
Examples
1.MAGICSQUARE(3)
2 | 7 | 6 |
9 | 5 | 1 |
4 | 3 | 8 |
2.MAGICSQUARE(4,7,2,4)
7 | 41 | 39 | 13 |
33 | 19 | 21 | 27 |
23 | 29 | 31 | 17 |
37 | 11 | 9 | 43 |
3.MAGICSQUARE(6,4,2,3)
69 | 18 | 15 | 48 | 60 | 57 |
22 | 76 | 4 | 64 | 55 | 46 |
74 | 8 | 20 | 53 | 50 | 62 |
6 | 81 | 78 | 27 | 39 | 36 |
85 | 13 | 67 | 43 | 34 | 25 |
11 | 71 | 83 | 32 | 29 | 41 |