A magic square M is an n × n matrix in which entries along each row, each column, the main diagonal, and the cross diagonal add to the same value μ called the magic sum of M. If the entries of M are integers from 1 through n^2 where each number appears once then μ = n(n^2+1)/ 2 and M is called a classical magic square (or natural magic square). A magic square M = [mi,j ] is said to be regular (also called associated or symmetrical) if the sum of the entries mi,j and m_n+1-i,n+1−j that are symmetrically placed across the center of the square is equal to the number 2μ/ n . In the case of classical magic square this sum is n^2 + 1.