Wednesday, 22 October 2014

Magic Squares 5 : Creating a 5x5 magic square using 25 terms in Arithmetic Progression

Problem Background : A 5x5 magic square is an arrangement of 25 squares arranged in 5 rows and 5 columns. We are given 25 terms in an arithmetic progression(AP) to place one term in each of the squares such that the sum of each of the rows and columns is equal.

Solution : We assume the terms of the AP are a,a+d,a+2d,...,a+23d,a+24d where a is the first term and d is the common difference.
General Solution of a 5x5 magic square

Derived corollary : It can be noted that we get a magic square of any 25 consecutive integers when d=1 and a is the first term among the 25 integers. 

Magic square of any 25 consecutive integers when a is the first integer


Example: If a=1 and d=1, we get a magic square of the integers from 1 to 25.

Magic square of first 25 natural numbers

Q.E.D

© Rishabh Bidya


Thursday, 2 October 2014

Magic Squares 4 : Creating a 4x4 magic square using 16 consecutive integers given the sum of a row or a column

Problem Background : A 4x4 magic square is an arrangement of 16 squares arranged in 4 rows and 4 columns. We are given a sum S which is the sum of any row or column. We need to arrange 16 consecutive integers in the square.

Solution : If the sum of a row is S, S also needs to be the sum of any other row or any other column.


Derived corollary : It can be noted that for the numbers in individual squares to be positive integers, S must be of the form 2(mod4) and S must be greater than or equal to 34.

Note that this solution is however only a special case of the general solution:


Observations:
The numbers in individual squares are positive integers when:
  1. S>30d
  2.  If d is even, S is divisible by 4. If d is odd, S is of the form 2(mod4)
The above result can be derived from  Magic Squares 3 :

Thus, S=4a+30d. After this, we merely substitute for a and simplify.

Q.E.D

© Rishabh Bidya